Fix concurrency key so ciflow tag re-pushes cancel prior runs - #21622
Open
huydhn wants to merge 1 commit into
Open
Fix concurrency key so ciflow tag re-pushes cancel prior runs#21622huydhn wants to merge 1 commit into
huydhn wants to merge 1 commit into
Conversation
Tag-triggered workflows built their concurrency group from `github.event.pull_request.number || github.sha`. On a `ciflow/*` tag push there is no PR number, so the group keyed on `github.sha`; every re-push of a tag pointed at a new sha, landed in its own group, and never cancelled its predecessor. On Aug 5 a burst of ciflow re-pushes fanned out to 46 shas / 117 runs and buried the shared macos-m1-stable fleet, taking main macOS coverage to 0. Adopt the expression already used by periodic.yml: fall back to `github.ref_name` (stable across re-pushes of the same tag) and gate the sha term on `github.ref_type == 'branch'` so branch pushes keep per-sha isolation. periodic.yml is the reference; every other workflow now converges on that same group expression. Also drops a stray double dash in the nightly/test-backend group strings. Applies to all workflows carrying the old key, including the seven that are not tag-triggered, so the pattern is uniform and cannot be copy-pasted back in. Authored with assistance from Claude Code.
jeanschmidt
approved these changes
Aug 6, 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.
Problem
Tag-triggered workflows key concurrency on
${{ github.event.pull_request.number || github.sha }}. On aciflow/*tag push there is no PR number, so the group falls back togithub.sha— each re-push points at a new sha, gets its own group, and never cancels the prior run.cancel-in-progressis dead for tag pushes.On Aug 5 a burst of ciflow re-pushes fanned out to 46 shas / 117 runs, buried the shared
macos-m1-stablefleet, and drovemainmacOS coverage to 0 (gha-infra#1391).Fix
Fall back to
github.ref_name(stable across re-pushes of the same tag) and gate the sha term ongithub.ref_type == 'branch', matchingperiodic.ymlin this repo andpytorch/pytorch'strunk.yml:Applied to all 29 workflows carrying the old key (22 are tag-exposed; the other 7 are fixed for uniformity). Also drops a stray
--in the nightly/test-backend group strings.doc-build.ymlwas already correct (keys ongithub.ref) and is untouched.Review
periodic.yml(unchanged) is the template — verifytrunk.ymlmatches it; the other 28 are the identical one-line change.Authored with assistance from Claude Code.