sunchao commented on code in PR #5762:
URL: https://github.com/apache/datafusion-comet/pull/5762#discussion_r3956421772


##########
.github/workflows/label_prs.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Label pull requests
+
+# Runs on pull_request_target so it can label pull requests from forks. 
Nothing from the pull
+# request is checked out or executed: the labeler reads the changed file list 
through the API
+# and the title step reads the event payload.
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]
+
+permissions:
+  contents: read
+  pull-requests: write
+
+# Pushes replace each other's path-labeling run, but the opened run stays in 
its own group:
+# the title step runs on open only, and a synchronize run that cancelled it 
would leave the
+# type label missing with no later event to add it.
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ 
github.event.action }}

Review Comment:
   ### Correctness
   
   [P2] Prevent overlapping runs from replacing the title label
   
   Including the event action allows `opened` and `synchronize` to write labels 
concurrently. Despite `sync-labels: false`, labeler v7 [refreshes the current 
labels and then replaces the complete 
set](https://github.com/actions/labeler/blob/bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13/src/labeler.ts#L119-L145),
 using 
[`issues.setLabels`](https://github.com/actions/labeler/blob/bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13/src/api/set-labels.ts#L9-L14).
 If a push introduces a new area label, its path run can finish that final read 
before the opening title step adds `bug`, then replace the labels after the 
addition and remove `bug`. The refresh preserves additions observed before the 
read, but cannot protect one arriving between the read and replacement. Later 
pushes/reopens still skip the title step, leaving it missing. Could we 
serialize label mutations while preserving the opening operation, or make the 
path update genuinely additive? Separating the event groups alone trades 
cancellation for
  this lost update.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to