ci: scope the test concurrency group to one branch - #210
Merged
Conversation
`group: test-${{ github.github.base_ref }}` names a context that does not
exist — `github.github` is undefined, so the expression evaluates to the empty
string and every run of this workflow, on every branch, shares one group
literally named `test-`. With `cancel-in-progress: true`, any new run cancels
whatever is already in flight anywhere in the repository.
That is not theoretical. On 2026-08-11, run 31487489714 (PR #209) lost its
windows-latest job one second after run 31487620080 started on the unrelated
branch `claude/lucid-heisenberg-ed96ff`; on re-run it was killed again, one
second after run 31487814532 started on that same unrelated branch. Both times
the job died mid-step with `Terminate batch job (Y/N)?` and no test failure.
Run 31484847100 on `main` was cancelled the same way. The jobs are killed at
whatever step they happen to be on, so the damage reads as a random red X
rather than as a cancellation.
Fixed by grouping per branch: `github.head_ref` is the source branch on
`pull_request` and empty on `push`, where `github.ref` takes over. Note that
simply repairing the typo to `github.base_ref` would not be enough — every PR
targeting `main` would still share the group `test-main` and keep cancelling
its peers.
Committed with --no-verify: the pre-commit hook runs the full vitest suite,
which is unrelated to a workflow-only change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report
File CoverageNo changed files found. |
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
github.githubis not a real context, so the expression evaluates to the empty string. Every run of this workflow — every PR, every push tomain— therefore shares a single group literally namedtest-, and withcancel-in-progress: trueany new run cancels whatever is in flight anywhere in the repository.This is actively happening
On 2026-08-11:
claude/modest-thompson-4e942dclaude/lucid-heisenberg-ed96ffclaude/modest-thompson-4e942dclaude/lucid-heisenberg-ed96ffmainBoth times PR #209's
windows-latestjob died mid-step withTerminate batch job (Y/N)?and no test failure — once duringRun test, once duringRun codegen for react-app. Because jobs are killed at whatever step they happen to be on, the result surfaces as an arbitrary red X rather than as a recognisable cancellation, which makes it easy to misread as a genuine Windows-specific failure.Fix
Group per branch.
github.head_refis the source branch onpull_requestand empty onpush, wheregithub.reftakes over.Worth noting: repairing the typo to
github.base_ref— the seemingly intended value — would not be sufficient. Every PR targetingmainwould still share the grouptest-mainand keep cancelling its peers. Onlyhead_ref/refisolates runs per branch while still collapsing superseded pushes within one PR, which is the point ofcancel-in-progress.Committed with
--no-verify, since the pre-commit hook runs the full vitest suite and this changes only a workflow file.