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


##########
.github/workflows/label_prs.yml:
##########
@@ -0,0 +1,83 @@
+# 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
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
+jobs:
+  label:
+    runs-on: ubuntu-slim
+    steps:
+      - name: Label by changed paths
+        uses: actions/labeler@v7
+        with:
+          configuration-path: .github/labeler.yml
+          sync-labels: false
+
+      # The type label follows the conventional commit prefix in the title, 
matching how
+      # maintainers label by hand. Only on open, so later hand edits are not 
overwritten, and
+      # not for dependabot, whose PRs already carry the dependencies label.
+      - name: Label by title prefix
+        if: github.event.action == 'opened' && github.actor != 
'dependabot[bot]'

Review Comment:
   ### Correctness
   
   [P2] Preserve the opened run until type labeling finishes
   
   If a non-Dependabot PR is opened with a `fix:` title and no `bug` label, 
then receives a push while the opening run is still in its path-labeling step, 
the `synchronize` run has the same concurrency group and cancels it. This 
condition then skips title labeling in the replacement run; future pushes and 
reopens also skip it, so the missing type label is never recovered 
automatically. Keep the opening operation out of the cancellation group for 
later events, or otherwise ensure it completes once. Changing only 
`cancel-in-progress` to false is insufficient for an opening run that gets 
replaced while pending. This follows the [documented concurrency 
behavior](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency).
   



-- 
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