fix(ci): main runs were being cancelled, recording nothing - #42
Merged
Conversation
The concurrency block intended never to cancel on main -- the comment said
so -- and did the opposite:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
The expression renders to the STRING "false", and a non-empty string is
truthy in that position, so main was cancelled like any other ref. It
failed silently for exactly as long as nobody merged twice in quick
succession.
Four main runs were cancelled during this batch of merges (#36, #37, #39,
#32), each with ZERO jobs recorded -- so those commits have no evidence
they ever built. The runs that were supposed to be the record of what
shipped are the ones that got killed.
Encoding the rule in the concurrency GROUP is unambiguous: on main the SHA
gives every run its own group, so there is nothing to supersede; every
other ref keeps a per-ref group, so a force-push still cancels the old run.
tests/workflow_concurrency.rs guards both halves -- an expression-valued
cancel-in-progress, and a group that lost its per-SHA component (which
with cancel-in-progress: true would cancel main on every push, strictly
worse than the bug it replaced). Mutation-verified: restoring the original
two lines fails both.
118 tests.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
thinkutils | 88c6d0d | Jul 20 2026, 03:46 AM |
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.
Found while checking that main was healthy after this batch of merges. It wasn't being checked at all.
The bug
ci.yml's concurrency block intended never to cancel on main — the comment said "Never cancel on main: those runs record what shipped" — and did the opposite:The expression renders to the string
"false", and a non-empty string is truthy in that position. So main was cancelled like any other ref.It failed silently for exactly as long as nobody merged two things in quick succession — which is why it survived until this batch.
What it cost
Four main runs were cancelled during these merges, each with zero jobs recorded:
Each was killed ~40s in by the next merge. Those four commits have no evidence they ever built. The runs meant to be the record of what shipped are precisely the ones that got killed.
The fix
Put the condition in the concurrency group instead, where it's unambiguous:
On main the SHA gives every run its own group, so there is never a run to supersede. Every other ref keeps a per-ref group, so a force-push still cancels the superseded run.
Guard
tests/workflow_concurrency.rscovers both halves, because fixing one and breaking the other is worse than the original:cancel-in-progressmust be a literaltrue/false, never an expressioncancel-in-progress: trueand a plain per-ref group, main would be cancelled on every pushMutation-verified — restoring the original two lines fails both:
It lives outside
.github/so it can't match its own explanation, and strips#comments so the warning I left inci.ymldocumenting the broken form isn't flagged as a violation.118 tests, clippy clean, fmt clean.