ci: self-cancel merge_group runs superseded by a queue re-stage (BLO-21953) - #1042
ci: self-cancel merge_group runs superseded by a queue re-stage (BLO-21953)#1042allyblockcast[bot] wants to merge 1 commit into
Conversation
1 similar comment
|
Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Important Issues (2)
Strengths
Recommended Action
This PR is authored by |
kkroo
left a comment
There was a problem hiding this comment.
Approved: workflow-only load shedding is scoped to merge_group, validates the current SHA against the live merge queue, uses actions:write only on the policy job, and fails open on lookup/cancel errors.
|
@kkroo — one setting, ~30 seconds, and it is currently set the wrong way. Everything else here is evidence for that one line. The askSettings → Branches → Not ruleset-managed ( Why this is a revert, not a new changeThe value was 5 at 15:22Z today — I measured and published it. It reads 25 now: Throughput across that boundary, measured by
Capacity math for why 25 cannot work: 25 entries × 13 jobs ≈ 325 jobs against a 78-runner pool. A batch can't finish inside
Correcting our own report, twiceTwo errors of ours are in the Paperclip thread and possibly in what reached you. Both are ours, not yours:
Optional second click#1042 — On routingBoard decisions stopped at 05:54Z; you've had 25+ events in this repo today, the most recent ~20 minutes ago. I'm treating GitHub as the reliable channel for repo-admin asks from now on rather than the approval queue. Say the word if you'd prefer otherwise. — CEO (Paperclip BLO-21953) |
The workflow-level concurrency group keys merge_group events on merge_group.head_sha, which changes on every queue re-stage, so cancel-in-progress never fires across successive attempts for the same PR. Superseded generations pile up and starve the shared runner pool, which is the amplification loop behind the 8h+ master merge freeze in BLO-21953. Add an early step to the policy job (before checkout) that queries the live merge queue via GraphQL and self-cancels via the Actions API if this run's head_sha is no longer a live entry. Fails open on any lookup/cancel error. Scoped to merge_group events only; pull_request behavior is unchanged. Paperclip: BLO-21953
9fcf4a2 to
1f75b51
Compare
Thinking Path
Linked Issues or Issue Description
Paperclip issue BLO-21953 tracks the frozen
mastermerge queue and the superseded merge-group run amplification loop. The root cause is workflow-level concurrency using a per-generation SHA rather than a stable per-entry queue identity.What Changed
merge_group-only policy step in.github/workflows/pr.yml.mastermerge queue via GraphQL and compares this run'sgithub.shaagainst the live queue entry SHAs.actions: writepermission only to the policy job so the self-cancel request has the required token scope.Verification
The change is workflow-only and is verified by code inspection against the
merge_groupevent contract: it runs before checkout, only onmerge_group, and cancels only when the current SHA is absent from the live queue. The check is fail-open, so API failures do not fail or cancel valid runs.Risks
Moderate operational risk because this changes CI workflow behavior. The risk is bounded by event gating, exact SHA matching against the live queue, and fail-open behavior. A lookup failure leaves the workflow running exactly as before.
Model Used
Claude Sonnet 5 (
claude-sonnet-5[1m]), agentic coding session with GitHub Actions and merge-queue analysis.Checklist