Repository navigation
fix(ci): refuse to deploy an image older than the code it claims to ship - #600
Merged
Merged
Conversation
The stale-digest `::warning::` was not enough, and the evidence is specific: it fired on four deploys on 2026-11-05 — P12's metrics, P15's structured logging, P22's gate and P7's action header all merged, green, and absent from the running binary — and nobody read it, including the person who added it for exactly this failure. Something that must not be missed has to fail a check, not annotate one. So the digest step now REFUSES when the tree that builds an image actually moved between what is running and what is being deployed. The question is answerable because the reused digest carries the sha it was built from: `git diff <that sha>..<DEPLOY_SHA>` over the image's own source paths (`rust`, `Dockerfile`, `entities` for er-api; `frontend` for er-web) says whether this deploy would ship older code than it claims. No image tag and no source change is the legitimate case — #587's platform-only path, or a tree that genuinely did not move. No image tag WITH a source change is the bug, and it is now red. Validated against the real incident rather than a hypothetical: the running er-api was built from `8360868d`, main had moved to `17db1dde`, and 51 files under the watched paths changed between them. The guard fires. `fetch-depth: 0` on the checkout is load-bearing, not hygiene. The default of 1 clones a single commit, so the diff cannot resolve its left side and the guard would take its "cannot verify" branch on EVERY deploy — a check that always abstains, which is worse than no check because it looks like one. That flaw was in the first version of this change and caught before pushing. A tag that is not a commit in the checkout still only warns: that is a real state for a hand-pushed image, and refusing on it would block a legitimate deploy on a bookkeeping gap. Companion to #599, which stops the builds being cancelled in the first place. This is the guard for when something else swallows one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Closed
4 tasks
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.
Why a warning was not enough
The stale-digest
::warning::fired on four deploys on 2026-11-05 — P12'smetrics, P15's structured logging, P22's gate and P7's action header all merged,
green, and absent from the running binary — and nobody read it, including the
person who added it for exactly this failure.
Something that must not be missed has to fail a check, not annotate one.
The guard
The digest step now refuses when the tree that builds an image actually
moved between what is running and what is being deployed.
That is answerable because the reused digest carries the sha it was built from:
or a tree that genuinely did not move) → proceeds, with a note
listed and the command to build it
Validated against the real incident, not a hypothetical
The guard fires. It would have refused all four of today's deploys.
One flaw caught before pushing
fetch-depth: 0is load-bearing, not hygiene. The checkout's default depth of1 clones a single commit, so the diff cannot resolve its left side and the
guard would take its "cannot verify" branch on every deploy — a check that
always abstains, which is worse than no check because it looks like one. That
was the first version of this change.
A tag that is not a commit in the checkout still only warns: that is a real
state for a hand-pushed image, and refusing on it would block a legitimate
deploy over a bookkeeping gap.
Relationship to #599
#599 stops the builds being cancelled in the first place. This is the guard
for when something else swallows one — they are complements, not alternatives.
🤖 Generated with Claude Code
One thing checked rather than assumed
The guard reads
imageTags[0]— the first tag on the reused digest. If animage ever carried
latestalongside its sha, that could pick the wrong one.Measured against the live registry rather than reasoned about:
images.ymltags by full sha only, so[0]is correct by the actual schemerather than by luck. And if a second tag is ever added, the guard degrades to
its "cannot verify" warning — a safe abstention, not a silent pass.
Recorded because the alternative was to "harden" something that did not need it,
which is its own kind of noise.