ci: scope Quality Gate concurrency to the calling workflow#74
Merged
Conversation
9861a22 to
b83ead7
Compare
publish.yml calls quality-gate.yml as a reusable workflow, and a reusable
workflow's concurrency group is evaluated in the caller's ref context. On a
release (merge to main → push, immediately followed by a tag/dry-run Publish),
the publish-embedded gate joined the same `quality-refs/heads/main` group as the
standalone push-triggered gate, and `cancel-in-progress: true` cancelled the
latter — which GitHub renders as a red ✗ on main even though nothing failed.
Key the concurrency group on github.workflow too, so the standalone gate and the
publish-embedded gate never share a group while each still de-dupes among its own
runs. github.workflow resolves to the caller's workflow name ("Quality Gate" vs
"Publish"), which relies on each caller declaring an explicit `name:` (both do);
documented in a comment.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b83ead7 to
c01970b
Compare
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
After a release,
mainshowed a red ✗ at the release commit — looking like CI was failing. It wasn't. The mark was a standalone Quality Gate run with conclusioncancelled(GitHub renderscancelledidentically to a failure). The code was healthy: every other gate run on that commit passed all jobs and the release shipped to PyPI.Root cause (structural, recurs on every release)
publish.ymlcallsquality-gate.ymlas a reusable workflow (uses:). A reusable workflow'sconcurrencyis evaluated in the caller's ref context. When Publish runs onmain, its embedded quality-gate joins the same groupquality-refs/heads/mainas the standalone Quality Gate triggered by the push tomain.The standard release flow — merge release PR to main (push → standalone gate) immediately followed by a tag push / dry-run dispatch (→ Publish, whose embedded gate shares the group) — therefore triggers
cancel-in-progress: true, which cancels the older standalone gate. Red ✗.Fix
Key the concurrency group on
github.workflowas well:github.workflowresolves to the caller's workflow name ("Quality Gate"on a direct push/PR,"Publish"when invoked viauses:), so the standalone gate and the publish-embedded gate never share a group — while each still de-dupes among its own runs (the cancellation savings concurrency was added for are preserved). A comment documents the one caveat: this relies on each caller declaring an explicitname:(both do today), else GitHub falls back to the file path and the group silently changes.Verification
quality-gate.yml+publish.yml).gh workflow run publish.yml --ref mainimmediately after a push to main no longer cancels the standalone Quality Gate (both complete green).🤖 Generated with Claude Code