andygrove opened a new pull request, #6161:
URL: https://github.com/apache/datafusion-comet/pull/6161

   ## Which issue does this PR close?
   
   Closes #6159.
   
   ## Rationale for this change
   
   When a pull request is opened with a label already applied, GitHub fires 
`opened` and `labeled` together, so `ci.yml` runs twice on the same commit. 
With two runs of one workflow on a commit, GitHub checks the PR's required 
checks against only one of them. The label run publishes only `Required Checks 
(label run)`. So when GitHub picked the label run, `Required Checks` stayed 
"Expected — Waiting for status to be reported" forever, and "Merge when ready" 
never added the PR to the queue. #6156 is stuck this way right now.
   
   The dependabot PRs show the same pattern: `dependencies` is applied about a 
second after the PR opens. On #6011 and #6012 the commit's check-runs listing 
shows only one of the two runs' `Required Checks*` results. Those PRs merged 
only because they were added to the queue by hand. Re-running the `Required 
Checks` job in the `opened` run does not help (tried on #6156), because it 
reuses the existing check suite.
   
   ## What changes are included in this PR?
   
   - `ci.yml`: remove `labeled` from the `pull_request` types and add a 
`workflow_call` trigger.
   - New `ci_label.yml` (`Comet CI (label run)`): runs on `pull_request: 
[labeled]` and calls `ci.yml`. A called workflow shares its caller's event 
context, so `POLICY` in `compute-changes.py` still reads the `labeled` action 
and label name and runs only what the new label gates. Nothing in the pipeline 
changes. Label runs now get their own check suite, and their check names are 
nested under `Label run / …`, so they can't hide or replace the commit run's 
checks.
     - The caller grants `actions: read`, `contents: read` and `issues: write`. 
That is the combined set of permissions `ci.yml`'s jobs request, and GitHub 
checks it for every nested job when the run starts.
     - The caller declares no `concurrency`. `ci.yml`'s group already includes 
the caller's workflow name and the label, and declaring the same group on both 
would deadlock.
   - `dev/ci/check-ci-config.py`: a new `label runs` check fails if `ci.yml` 
triggers on `labeled`, if it lacks `workflow_call`, or if `ci_label.yml` is 
missing, doesn't call `ci.yml`, or triggers on anything besides `labeled`.
   - Comments in `ci.yml`, the workflows README and `contributor-guide/ci.md` 
updated to match.
   
   ## How are these changes tested?
   
   - `python3 dev/ci/check-ci-config.py` passes. Adding `labeled` back to 
`ci.yml`, removing `workflow_call`, or deleting `ci_label.yml` each makes the 
new check fail with its message.
   - `actionlint` and `dev/ci/local-ci-config.py` pass. The docs pass prettier.
   - The end-to-end behavior can only be checked on GitHub: this PR's own 
`Comet CI` run should be the only run of that workflow on its commit, and 
applying a `run-*` label afterwards should start a separate `Comet CI (label 
run)` run.
   


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