Skip to content

fix(hybrid-gate): key the concurrency group by SHA on push - #32

Merged
forkwright merged 1 commit into
mainfrom
fix/main-verdict-not-cancelled
Aug 12, 2026
Merged

fix(hybrid-gate): key the concurrency group by SHA on push#32
forkwright merged 1 commit into
mainfrom
fix/main-verdict-not-cancelled

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Refs aletheia#6701. Fleet-wide blast radius — every adopting repo consumes this workflow. Flagging that plainly at the top.

Finding

On a default branch github.ref is constant, so a ref-keyed concurrency group makes every merge cancel the previous commit's gate.

Measured in aletheia over one window — two consecutive merges, each losing its verdict entirely:

commit caller-side jobs jobs defined here
53ba8110b green all cancelled
8dd94b02c green all cancelled

The split falling exactly on the caller/callee boundary is what identified the cause. aletheia's caller had already SHA-keyed its pushes for precisely this reason, with a comment explaining it. This group had not — so the fix was half-applied, and the half that mattered kept being cancelled: fmt, check, clippy, nextest, the trailer logic. That is what the required context actually attests.

Why it is worse than a missing verdict

Evaluate gate result fails on a cancelled upstream, so the commit reports RED with nothing wrong. A red that nobody caused teaches everyone to discount red on a default branch — which is the one property a required check depends on.

aletheia has since made cancelled distinguishable from failed (aletheia#6706), but that only stops the two looking alike. It does not restore the lost verdict. This does.

Change

-  group: ${{ github.workflow }}-${{ github.ref }}
+  group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}

Mirrors the key aletheia's caller already uses. PRs keep ref-keying, so a force-push still supersedes its own in-flight run — only pushes get per-commit groups.

Adoption note

Repos that pin this workflow by SHA (aletheia does, deliberately) do not inherit the fix until their pin is bumped. I will bump aletheia's in a follow-up once this lands; other adopters need the same.

On a default branch the ref is constant, so a ref-keyed group made every merge
cancel the previous commit's gate. Measured in aletheia over one window, two
consecutive merges each lost their verdict entirely -- 53ba8110b and 8dd94b02c,
where the caller's own jobs went green and every job defined here was cancelled.

The split falling exactly on the caller/callee boundary is what identified the
cause: aletheia's caller had already SHA-keyed its pushes for precisely this
reason, and this group had not, so the fix was half-applied and the half that
mattered -- fmt, check, clippy, nextest, the trailer logic, i.e. what the
required context actually attests -- kept being cancelled.

It is worse than a missing verdict. `Evaluate gate result` fails on a cancelled
upstream, so the commit reports RED with nothing wrong, which teaches everyone
to discount red on a default branch. aletheia has since made that reporting
distinguishable (aletheia#6706), but that only stops the two looking alike; it
does not restore the lost verdict. This does.

PRs keep ref-keying, so a force-push still supersedes its own in-flight run.

Refs: aletheia#6701
@forkwright
forkwright merged commit aed4ca5 into main Aug 12, 2026
1 check passed
@forkwright
forkwright deleted the fix/main-verdict-not-cancelled branch August 12, 2026 14:15
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