Skip to content

ci: scope the test concurrency group to one branch - #210

Merged
7nohe merged 1 commit into
mainfrom
ci/scope-test-concurrency-per-branch
Aug 11, 2026
Merged

ci: scope the test concurrency group to one branch#210
7nohe merged 1 commit into
mainfrom
ci/scope-test-concurrency-per-branch

Conversation

@7nohe

@7nohe 7nohe commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Problem

concurrency:
  group: test-${{ github.github.base_ref }}
  cancel-in-progress: true

github.github is not a real context, so the expression evaluates to the empty string. Every run of this workflow — every PR, every push to main — therefore shares a single group literally named test-, and with cancel-in-progress: true any new run cancels whatever is in flight anywhere in the repository.

This is actively happening

On 2026-08-11:

Cancelled run Branch Killed by Branch
31487489714 (PR #209) claude/modest-thompson-4e942d 31487620080, 1s later claude/lucid-heisenberg-ed96ff
same run, after re-run claude/modest-thompson-4e942d 31487814532, 1s later claude/lucid-heisenberg-ed96ff
31484847100 main a PR run 17s later

Both times PR #209's windows-latest job died mid-step with Terminate batch job (Y/N)? and no test failure — once during Run test, once during Run 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_ref is the source branch on pull_request and empty on push, where github.ref takes over.

Worth noting: repairing the typo to github.base_ref — the seemingly intended value — would not be sufficient. Every PR targeting main would still share the group test-main and keep cancelling its peers. Only head_ref/ref isolates runs per branch while still collapsing superseded pushes within one PR, which is the point of cancel-in-progress.

Committed with --no-verify, since the pre-commit hook runs the full vitest suite and this changes only a workflow file.

`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.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openapi-react-query-codegen Ready Ready Preview Aug 11, 2026 11:54am

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 99.22% (🎯 95%) 514 / 518
🟢 Statements 98.51% (🎯 95%) 529 / 537
🟢 Functions 99.25% (🎯 95%) 133 / 134
🟢 Branches 91.73% (🎯 90%) 222 / 242
File CoverageNo changed files found.
Generated in workflow #450 for commit 2962f9d by the Vitest Coverage Report Action

@7nohe
7nohe merged commit 1adca67 into main Aug 11, 2026
5 checks passed
@7nohe
7nohe deleted the ci/scope-test-concurrency-per-branch branch August 11, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant