Cancel superseded pull request checks - #6533
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6533 +/- ##
==========================================
- Coverage 78.67% 78.67% -0.01%
==========================================
Files 777 777
Lines 76686 76686
==========================================
- Hits 60334 60330 -4
- Misses 16347 16351 +4
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jhrozek
approved these changes
Sep 8, 2026
4 tasks
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
Successive updates to a pull request currently leave superseded checks consuming runners. Add workflow-level concurrency to all seven PR entrypoints so a replacement run cancels earlier runs of that workflow for the same PR.
Each entrypoint uses a distinct file-specific prefix and the PR number. Non-PR events use the run ID and disable cancellation, keeping manual runs, scheduled scans, and main/release workflows independent.
Type of change
Test plan
git diff --checkand independent code review; no required fixes.66183315ethen9c7c65c6d). All six unfinished workflows for the first commit completed as cancelled; the API no-op had already succeeded. The latest commit started its replacement workflows, and the two API workflows did not cancel one another.Changes
run-on-pr.ymlsecurity-scan.ymltest-e2e-lifecycle.ymlrenovate-config-validation.ymlpr-size-labeler.ymlapi-compat.ymlapi-compat-noop.ymlImplementation plan
Approved implementation plan
Add cancellation only at the seven independently triggered PR workflow entrypoints. Group by a distinct workflow identifier and PR number, use a run-ID fallback, and restrict cancellation to pull_request events. Keep reusable children free of duplicate concurrency groups. Validate workflow syntax and obtain code review before opening a draft PR. Handle API compatibility consolidation and main validation/publishing separation in separate changes.
Special notes for reviewers
The API compatibility workflows share a display name, so their concurrency keys deliberately use distinct literal prefixes. Reusable children must not duplicate the caller's concurrency group.
Cancellation requires a replacement workflow to trigger; path-filtered workflows can still finish an older run if a later update no longer matches their filters. Runtime cancellation was verified with successive pushes on this PR; latest-run completion and cross-PR/manual-dispatch isolation remain to be verified.
Runtime cancellation evidence
The original PR Checks run was also cancelled by the first validation push. The API no-op completed before replacement, so its cancellation was not exercised. Both validation commits are empty and leave the file diff unchanged.