Skip to content

Fix concurrency key so ciflow tag re-pushes cancel prior runs - #21622

Open
huydhn wants to merge 1 commit into
mainfrom
fix-ciflow-tag-concurrency-cancellation
Open

Fix concurrency key so ciflow tag re-pushes cancel prior runs#21622
huydhn wants to merge 1 commit into
mainfrom
fix-ciflow-tag-concurrency-cancellation

Conversation

@huydhn

@huydhn huydhn commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Tag-triggered workflows key concurrency on ${{ github.event.pull_request.number || github.sha }}. On a ciflow/* tag push there is no PR number, so the group falls back to github.sha — each re-push points at a new sha, gets its own group, and never cancels the prior run. cancel-in-progress is 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-stable fleet, and drove main macOS 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 on github.ref_type == 'branch', matching periodic.yml in this repo and pytorch/pytorch's trunk.yml:

group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-...

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.yml was already correct (keys on github.ref) and is untouched.

Review

periodic.yml (unchanged) is the template — verify trunk.yml matches it; the other 28 are the identical one-line change.


Authored with assistance from Claude Code.

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.
@pytorch-bot

pytorch-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21622

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 123 Cancelled Jobs, 14 Pending, 5 Unrelated Failures, 14 Unclassified Failures

As of commit 7e66c47 with merge base b21661f (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 6, 2026
@huydhn
huydhn deployed to upload-benchmark-results August 7, 2026 00:08 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants