Repository navigation
π fix(ci): label events no longer cancel required checks on the same head - #18580
Conversation
β¦head pr-verifier.yml, dco-squash-attribution.yml and changelog-fragment-guard.yml shared a per-PR concurrency group across label events. Label bursts cancelled the run in flight (cancel-in-progress) or dropped queued runs (queue replacement), leaving CANCELLED check-runs for required contexts and jamming Tide. Key the verifier and squash-attribution groups on the head SHA, and give labeled/unlabeled (plus edited/reopened/ready_for_review where triggered) runs their own run_id-suffixed group so same-head re-checks never cancel or get cancelled. Add test-required-check-concurrency.py, which evaluates every required-check workflow's concurrency for a push plus a label burst and fails on any shared group. Fixes #18578 Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. βΉοΈ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No Review findings from Correctness review at 32b0668: no in-scope blocker. The concurrency groups in pr-verifier.yml, dco-squash-attribution.yml and changelog-fragment-guard.yml do what #18578 asks. Re-checks of the same head each get their own group, and nothing cancels a same-head run. Advisory (low): Note: label-dependent verdicts (dco |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Security perspective: no exploitable regression found in pr-verifier.yml, dco-squash-attribution.yml or changelog-fragment-guard.yml at 32b0668. Permissions and triggers are untouched. The new group key adds only the head SHA, a fixed action name and run_id. The SHA is hex and server-assigned, so a fork cannot inject into the key.
Advisory, low severity: pr-verifier.yml is pull_request_target with checks: write. After this change edited and ready_for_review get a unique group, and cancel-in-progress is false on every event. A fork author can edit their own PR title or body repeatedly, and each edit queues an uncancellable run of up to 10 minutes. Before this PR those edits cancelled the previous run. Cost is bounded by the job's timeout and GitHub's per-repo concurrency limits, but it is new cost amplification by a low-trust actor. If this matters, drop edited from the unique-group list and keep it in the shared per-SHA group. The verdict is not label-dependent, per the PR's own comment.
β hive: agent=adjudicator-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
|
Self-test result.
Tide merged once the surviving runs were green. |
Fixes #18578
Problem
verify PR contents(pr-verifier.yml),Sign-off survives the squash(dco-squash-attribution.yml) andchangelog-fragment-guardare required on v5 and re-run on label events. All three used one concurrency group per PR. GitHub scores every check-run of a required name on a commit, so a single CANCELLED sibling leaves the PR BLOCKED, even with a green run beside it, and Tide retries it at the head of the queue.Two concurrency behaviors produced those cancelled siblings:
lgtm,approved, size, stage) cancelled the run in flight.cancel-in-progressoff for labels): a group holds at most one pending run, and the next run to queue cancels it even withcancel-in-progress: false. A burst of three or four labels therefore still cancelled queued runs.Before / after
<workflow>-<PR><workflow>-<PR>-<head SHA>; changelog guard: unchanged per-PR group-<action>-<run_id>: each re-check runs alone, never cancels and is never cancelledsynchronizecancel-in-progressfalse(pr-verifier, dco). In a per-SHA group it could only ever cancel a same-head runTrade-off: with the head SHA in the group, a new push can no longer cancel the previous commit's verifier and squash-attribution runs, because they are in a different group now. They run to completion instead. Both jobs are short and timeout-capped.
Label dependence (step 2 of the issue)
continue-on-error, so the wrapper is green whatever the label set.labeled/unlabeledare kept because ci: 'verify PR contents' is required on v5 but pr-verifier.yml skips dependabot, so dependabot PRs can never mergeΒ #17036 / π fix(ci): pr-verifier re-runs on label events so bot-pushed heads satisfy 'verify PR contents'Β #17048 rely on them: an App or PAT label flip re-runs the verifier on a head that agithub.tokenpush left without apull_request_targetrun. Theworkflow_dispatchpath, theinputs.pr_numbergroup key and the stale-head bail-out are unchanged.merge-method/merge. Label runs still run the job in full; no skipped job is ever scored as a pass. Each run reads labels from its own event payload, so the newest run has the newest label set.no-changelog. Same treatment.Other required checks (step 3)
Read-only review of the v5
required_status_checks.gate,build-and-test,test,coverage,golangci-lint,gosec,govulncheckcome fromdocker.yml,v2-ci.yml,v2-tests.ymlandgo-security-analysis.yml. All of them use the defaultpull_requesttypes, so they have no label triggers.DCOcomes from an app. No change is needed there.Guard
.github/scripts/test-required-check-concurrency.py, in Python + PyYAMLunittestliketest-native-queue-workflows.py, runs frompr-auto-update-test.yml. That workflow now also triggers on any.github/workflows/*.ymlchange. The guard parses every workflow, finds the jobs that produce a v5 required context, and evaluates their real concurrency expressions with a small GitHub-expression evaluator for a push followed bylgtm+approved-style label bursts on one head SHA. It fails if any two of those runs share a group, and the message names "cancels it in flight" or "replaces it in the queue". Self-tests check that the pre-#18578 shapes (per-PR group with cancel, head-SHA-only group, changelog guard's queue-replacement shape) are all flagged. The evaluator raises on any construct it cannot model; it never passes silently.Workflow security: no change to what any workflow checks out or runs, and no change to permissions or action pins. Only
concurrency:blocks, comments, and the test workflow's path filter and one step changed.actionlintis clean on every edited workflow.Self-test on this PR
When every other check is green, this PR is labeled
lgtmandapprovedtogether. Expected: both required checks stay green with no cancelled runs. The result is reported in a comment below.π€ Generated with Claude Code