Cancel superseded pull-request runs instead of queueing them #1060

Merged
jaylouisw merged 1 commit from ci/cancel-superseded-pr-runs into main 2026-11-08 14:09:51 +00:00
Owner

Every rebase or amend of a pull request started a new run while the run it superseded stayed in the queue. On this host there is one runner, so those dead runs are not free — they are the difference between the queue draining in hours and in days, and they report on a commit nobody will merge.

Adds a concurrency group keyed on the PR number with cancel-in-progress on pull requests only.

Measured on the current queue: 177 workflow runs in ~8 h, median 239 s between run starts, so roughly 15 pull requests an hour. The backlog is 192 open PRs, and every rebase added up to five more jobs on top of runs that were already obsolete. After this lands, rebasing a PR costs exactly one run instead of two.

Pushes to main are deliberately excluded from cancellation: each describes a different commit, and a cancelled push run is a gap in the history of the default branch.

Every rebase or amend of a pull request started a new run while the run it superseded stayed in the queue. On this host there is one runner, so those dead runs are not free — they are the difference between the queue draining in hours and in days, and they report on a commit nobody will merge. Adds a concurrency group keyed on the PR number with `cancel-in-progress` on pull requests only. Measured on the current queue: 177 workflow runs in ~8 h, median 239 s between run starts, so roughly 15 pull requests an hour. The backlog is 192 open PRs, and every rebase added up to five more jobs on top of runs that were already obsolete. After this lands, rebasing a PR costs exactly one run instead of two. Pushes to `main` are deliberately excluded from cancellation: each describes a different commit, and a cancelled push run is a gap in the history of the default branch.
Cancel superseded pull-request runs instead of queueing them
All checks were successful
CI / Test (Node 18) (pull_request) Successful in 1m25s
CI / Test (Node 20) (pull_request) Successful in 1m24s
CI / Server smoke test (pull_request) Successful in 26s
CI / Docker build (pull_request) Successful in 9s
CI / Test (Node 22) (pull_request) Successful in 1m27s
3ed3e4496a
Every rebase or amend of a pull request started a new run while the run it
superseded stayed in the queue. On a single runner those dead runs are not free:
they consume the queue, they report on a commit that will never be merged, and
they are the main reason the backlog takes hours to drain.

Give pull-request runs a concurrency group keyed on the PR number so a new run
cancels the one it replaces. Pushes to main are deliberately excluded: each one
describes a different commit, and a cancelled push run is a gap in the history of
the default branch.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-08 14:04:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1060
No description provided.