Repository navigation
Cancel superseded main validation runs - #6537
Merged
Merged
Conversation
Every push to main currently runs the full validation suite to completion even when a newer push has already landed. When several PRs merge close together, the newest commit contains all of them, so its checks validate the combined result and the older runs only consume runners. Add a per-job concurrency group to each validation job so a newer push cancels the older run's in-progress validation. Concurrency is deliberately not set at the workflow level: that would also cancel image publishing part-way through, leaving pushed-but-unsigned tags. Add a publish gate that runs after validation and skips publishing when the commit is no longer the tip of the branch. Publishing that has already started is never cancelled. Tagged releases run from releaser.yml and are unaffected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6537 +/- ##
==========================================
- Coverage 78.67% 78.66% -0.02%
==========================================
Files 777 777
Lines 76687 76687
==========================================
- Hits 60335 60327 -8
- Misses 16347 16355 +8
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jhrozek
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #6533, which cancels superseded pull request checks. Pushes to
mainwere left alone because that workflow also publishes and signs container images, and a workflow-levelcancel-in-progresswould abort a publish half-way through, leaving pushed-but-unsigned tags in GHCR.This applies the same "only the latest validation matters" idea to
mainwithout touching in-flight publishing. When PRs A, B, and C merge close together, C already contains all three changes, so its checks validate the combined result and the older runs are redundant.Behaviour after this change:
maincancels the older run's in-progress lint, tests, codegen, security scan, Helm, E2E, operator CI, and skills jobs. Each job has its own concurrency group keyed on the ref, so jobs in different tiers do not cancel each other.publish-gatejob runs after validation and checks whether the commit is still the tip of the branch. If it has been superseded, the five multi-arch image builds are skipped. A cancelled validation job also skips publishing for that run vianeeds.releaser.ymlon thereleaseevent, not from this workflow.Type of change
Test plan
actionlinton the changed workflow: no diagnostics.git diff --check: clean.mainlanding within a few minutes of each other. Expect the older run's unfinished validation jobs to end as cancelled and its publish job to be skipped, while the newer run publishes.Does this introduce a user-facing change?
No. Dev images for superseded
maincommits will no longer be published; the newer commit's image contains their changes.Special notes for reviewers
concurrencyis one of the keys GitHub permits on a job that calls a reusable workflow (uses:), and cancelling the caller job cancels its nested jobs. The called workflows carry no concurrency groups of their own that would interfere;security-scan.ymlhas one from Cancel superseded pull request checks #6533 but it only cancels onpull_request.mainwill show as cancelled rather than green in the commit list and on the README build badge until the newer run finishes. That is the intended trade-off.workflow_dispatchon a non-mainbranch keeps working: groups includegithub.ref, and the gate compares against that branch's tip.Generated with Claude Code
🤖 Generated with Claude Code