Skip to content

ci: Cancel stale merge-queue runs when the queue rebuilds a PR's group - #980

Closed
zackees wants to merge 1 commit into
masterfrom
ci974
Closed

zackees wants to merge 1 commit into
masterfrom
ci974

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #974 (option 2).

Before: when the merge queue rebuilt an entry, the old merge_group run kept running on its old ref (concurrency is keyed on the unique ref), tying up runners.

After: on merge_group only, ci/merge_queue_stale.py (run via uv) asks GraphQL for master's merge queue entry head commits and runs gh run cancel if this run's merge_group.head_sha is not among them. It runs first in Event Data, macOS, Windows, Rust Tests and Rust Tests Linux. No-op for other events; any API or parse error leaves the run alone. Jobs get actions: write, and the four callers of build-project.yaml grant it. No new workflow files.

Tests: ci/test_merge_queue_stale.py (decision logic and workflow wiring). ./lint: only a local rustfmt toolchain error, unrelated.

@zackees
zackees enabled auto-merge October 16, 2026 03:04
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Superseded by #988 (Cancel Superseded Queue Runs), which landed first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: Cancel stale merge-queue runs when the queue rebuilds a PR's group

1 participant