Describe the bug
A PR that is opened with a label already applied never gets a usable Required Checks status. The merge box shows Required Checks — Expected — Waiting for status to be reported. "Merge when ready" then waits forever with "This pull request will be added to the merge queue when all requirements are met".
Opening a PR with a label sends both an opened event and a labeled event for the same commit, so ci.yml runs twice on that SHA:
- the
opened run publishes Required Checks (success)
- the
labeled run, which starts a few seconds later, publishes only Required Checks (label run)
The check-runs API and GraphQL (isRequired: true, rollup SUCCESS) both show Required Checks as present and passing. The PR's merge requirements seem to be evaluated against the newest check suite of the workflow, though, and that suite is the label run, which has no Required Checks. The label-run renaming added for #5007 assumed GitHub uses the most recent check run per name. For merge requirements it appears to use the most recent run of the workflow.
Steps to reproduce
Seen on #6156, which was opened with run-all-spark-profiles already applied:
- run 35874311100 (
opened): Required Checks success at 15:13:45Z
- run 35874318859 (
labeled): Required Checks (label run) success at 15:13:23Z
mergeStateStatus: BLOCKED, auto-merge enabled, the PR never enters the queue
Every recent PR that did enter the queue (#6094, #6073, #4816, #6041, #5677, #6072) had exactly one Comet CI run at its head SHA.
Expected behavior
Labels applied when the PR is opened should not stop it from merging.
Additional context
Possible directions:
Describe the bug
A PR that is opened with a label already applied never gets a usable
Required Checksstatus. The merge box showsRequired Checks — Expected — Waiting for status to be reported. "Merge when ready" then waits forever with "This pull request will be added to the merge queue when all requirements are met".Opening a PR with a label sends both an
openedevent and alabeledevent for the same commit, soci.ymlruns twice on that SHA:openedrun publishesRequired Checks(success)labeledrun, which starts a few seconds later, publishes onlyRequired Checks (label run)The check-runs API and GraphQL (
isRequired: true, rollupSUCCESS) both showRequired Checksas present and passing. The PR's merge requirements seem to be evaluated against the newest check suite of the workflow, though, and that suite is the label run, which has noRequired Checks. The label-run renaming added for #5007 assumed GitHub uses the most recent check run per name. For merge requirements it appears to use the most recent run of the workflow.Steps to reproduce
Seen on #6156, which was opened with
run-all-spark-profilesalready applied:opened):Required Checkssuccess at 15:13:45Zlabeled):Required Checks (label run)success at 15:13:23ZmergeStateStatus: BLOCKED, auto-merge enabled, the PR never enters the queueEvery recent PR that did enter the queue (#6094, #6073, #4816, #6041, #5677, #6072) had exactly one Comet CI run at its head SHA.
Expected behavior
Labels applied when the PR is opened should not stop it from merging.
Additional context
Possible directions:
labeledrun when the label event arrives together withopened(same SHA, within seconds), so only one check suite existsRequired Checks, but only as a pass-through of the commit run's verdict (this needs to preserve the CI: non-gating label (e.g. auto-addedperformance) spawns a phantom all-skipped CI run that shadows real checks #5007 guarantee)Required Checksjob in theopenedrun, or push a new commit