Repository navigation
fix(ci): a green deploy could ship a stale image without saying so - #479
Merged
Merged
Conversation
Observed on the first real run of deploy.yml. It reported success having rolled
an er-api image from nine commits back, and said so only on line 140 of a step
log:
er-api: no image tagged a5e6100 — reusing newest digest sha256:f4e00a99
The fallback itself is right, and §14.2 is right that a deploy passes a digest
rather than a tag: images are built only when their own tree moves, so for a
frontend-only commit there is legitimately no er-api tag and reusing what is
already running is the correct answer.
What made it misleading was the combination. The images run that WOULD have
built er-api — the one carrying the telemetry exporter — died in the Actions
outage. The next merge was frontend-only, so er-api was correctly skipped. The
deploy then reused the newest digest, which predated all of it, and reported
success. "Deployed" and "deployed what you just merged" are different claims
and the run made only the first one.
So the reuse is now a `::warning::` annotation, which lands in the run summary
rather than in a log nobody opens, and the job writes a table saying per image
whether the digest came from THIS commit. That summary is the artifact someone
reads a week later asking "was that change actually out?" — a digest alone does
not answer it.
Deliberately a warning and not a failure: reuse is the correct behaviour most
times it happens, and a deploy that refuses on it would block every
frontend-only merge. The goal is that it cannot happen QUIETLY.
The summary's shell was tested rather than assumed — the digest contains a
colon, so the field splitting is easy to get wrong, and an unset output had to
degrade to "yes" rather than crash the step.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
pushed a commit
that referenced
this pull request
Nov 5, 2026
The deploy becomes five phases instead of one `helm upgrade`, and traffic only
moves after the new colour has answered through its own Services.
Say what was deployed (#479, unchanged)
The namespace chart
Read the live colour from svc/er-web's selector — never guessed
Deploy the inactive colour new digests, color.active UNCHANGED
Smoke-test the inactive colour through the PREVIEW Services
Cut over one field on two Service objects
Retire the old colour only after the cutover is verified
**The live colour is READ, not stored.** `svc/er-web`'s selector is the same
field the cutover moves, so it cannot drift from reality the way a convention
or a recorded value would. `make dev-resume` reads it the same way. An absent
selector means first install: nothing to cut over from, so the cutover steps
skip.
**The live colour is pinned to the digests it is ALREADY serving** during the
deploy phase. Without that the live Deployment re-renders to the new digest and
restarts the pod taking traffic — the outage this exists to remove. Those
digests are read off the live Deployment's own containers BY CONTAINER NAME, so
the two halves cannot be transposed.
**The schema gate is the hook, not a step here.** `er-schema-migrate` (weight
-5) already runs `er-server migrate --expect-additive`, which plans first and
refuses — writing nothing — if the release is breaking; Helm runs hooks before
any release object is applied, so a breaking release fails with the live colour
untouched. A separate preflight Job would be the same check twice.
**The smoke test hits the PREVIEW Services, and that is the point.** Hitting the
live ones would test what is already in production and pass for the wrong
reason. `charts-check.py` now refuses a chart whose previews point at the live
colour, so the two halves of that property are enforced in different places.
**Retiring the old colour is deliberately decoupled from the cutover.** It runs
only after the cutover is verified, so a failure there leaves traffic correctly
on the new colour with one surplus pod — the harmless direction. Scaled to zero
rather than left warm (two serving pods doubles a namespace's cost); the
Deployment is kept, so the next deploy scales it up with its image cached. A
rollback after that point needs the replica count back as well as the selector,
which is why the step summary prints the command while the old pod is still
there.
**`executor.dagKinds` is now ONE value in `env:`, not two literals.** This step
pair introduces a second `helm upgrade`, and #498 had just extended the
allowlist to the `run_all_*` kinds — two hardcoded copies would have drifted
the first time someone added a third kind to one of them. #498's reasoning for
which kinds are on moves up with the value rather than being left behind in the
step that carried it.
Rebuilt on main's file rather than hand-resolving a conflict, after a
cherry-pick hit two hunks: #479 added a summary step immediately before the
step this replaces, and #498 expanded the allowlist inside it. Taking either
side alone would have silently dropped one of them. Verified both survive —
the summary step, and #498's expanded list in both invocations with its
rationale.
Verified on a real cluster, in throwaway namespaces, because the parts most
likely to be subtly wrong are the ones a render cannot check:
- every `run:` block syntax-checked with `bash -n` (0 errors)
- no inline `${{ }}` in any shell body this adds — values arrive through `env:`
- the colour read, against a live Service: `'blue'` -> target `green`
- digest extraction, against digest-pinned Deployments: both halves parsed to
`sha256:…`, selected by container NAME
- the first-install branch: absent Service -> empty -> direct path
- **and that the smoke test can FAIL.** `kubectl run` propagates the
container's exit code: unreachable target -> exit 7, with a positive control
against a reachable one -> exit 0. A smoke test that cannot fail is worse
than none, and the positive control is what makes the negative result mean
"the target is down" rather than "DNS or the image was broken".
Verified: `make check` green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
added a commit
that referenced
this pull request
Nov 5, 2026
…#472) The deploy becomes five phases instead of one `helm upgrade`, and traffic only moves after the new colour has answered through its own Services. Say what was deployed (#479, unchanged) The namespace chart Read the live colour from svc/er-web's selector — never guessed Deploy the inactive colour new digests, color.active UNCHANGED Smoke-test the inactive colour through the PREVIEW Services Cut over one field on two Service objects Retire the old colour only after the cutover is verified **The live colour is READ, not stored.** `svc/er-web`'s selector is the same field the cutover moves, so it cannot drift from reality the way a convention or a recorded value would. `make dev-resume` reads it the same way. An absent selector means first install: nothing to cut over from, so the cutover steps skip. **The live colour is pinned to the digests it is ALREADY serving** during the deploy phase. Without that the live Deployment re-renders to the new digest and restarts the pod taking traffic — the outage this exists to remove. Those digests are read off the live Deployment's own containers BY CONTAINER NAME, so the two halves cannot be transposed. **The schema gate is the hook, not a step here.** `er-schema-migrate` (weight -5) already runs `er-server migrate --expect-additive`, which plans first and refuses — writing nothing — if the release is breaking; Helm runs hooks before any release object is applied, so a breaking release fails with the live colour untouched. A separate preflight Job would be the same check twice. **The smoke test hits the PREVIEW Services, and that is the point.** Hitting the live ones would test what is already in production and pass for the wrong reason. `charts-check.py` now refuses a chart whose previews point at the live colour, so the two halves of that property are enforced in different places. **Retiring the old colour is deliberately decoupled from the cutover.** It runs only after the cutover is verified, so a failure there leaves traffic correctly on the new colour with one surplus pod — the harmless direction. Scaled to zero rather than left warm (two serving pods doubles a namespace's cost); the Deployment is kept, so the next deploy scales it up with its image cached. A rollback after that point needs the replica count back as well as the selector, which is why the step summary prints the command while the old pod is still there. **`executor.dagKinds` is now ONE value in `env:`, not two literals.** This step pair introduces a second `helm upgrade`, and #498 had just extended the allowlist to the `run_all_*` kinds — two hardcoded copies would have drifted the first time someone added a third kind to one of them. #498's reasoning for which kinds are on moves up with the value rather than being left behind in the step that carried it. Rebuilt on main's file rather than hand-resolving a conflict, after a cherry-pick hit two hunks: #479 added a summary step immediately before the step this replaces, and #498 expanded the allowlist inside it. Taking either side alone would have silently dropped one of them. Verified both survive — the summary step, and #498's expanded list in both invocations with its rationale. Verified on a real cluster, in throwaway namespaces, because the parts most likely to be subtly wrong are the ones a render cannot check: - every `run:` block syntax-checked with `bash -n` (0 errors) - no inline `${{ }}` in any shell body this adds — values arrive through `env:` - the colour read, against a live Service: `'blue'` -> target `green` - digest extraction, against digest-pinned Deployments: both halves parsed to `sha256:…`, selected by container NAME - the first-install branch: absent Service -> empty -> direct path - **and that the smoke test can FAIL.** `kubectl run` propagates the container's exit code: unreachable target -> exit 7, with a positive control against a reachable one -> exit 0. A smoke test that cannot fail is worse than none, and the positive control is what makes the negative result mean "the target is down" rather than "DNS or the image was broken". Verified: `make check` green. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Observed on the first real run of
deploy.yml. It reported success having rolled an er-api image from nine commits back, and said so only on line 140 of a step log:The fallback is right; the silence was not
§14.2 is right that a deploy passes a digest, never a tag, and the reuse is correct on its own terms: images are built only when their own tree moves, so for a frontend-only commit there is legitimately no er-api tag and rolling what is already running is the right answer.
What made it misleading was the combination:
detectcorrectly skipped er-api."Deployed" and "deployed what you just merged" are different claims, and the run made only the first one.
What changes
::warning::annotation, which lands in the run summary rather than in a log nobody opens.er-apisha256:f4e00a99eefc…er-websha256:ea87bd8e86ac…That summary is the artifact someone reads a week later asking "was that change actually out?". A digest alone does not answer it; whether it came from the commit does.
Deliberately a warning, not a failure
Reuse is the correct behaviour most times it happens, and a deploy that refused on it would block every frontend-only merge. The goal is only that it cannot happen quietly.
Tested rather than assumed
The summary's shell parsing was run locally first: the digest contains a colon, so the field splitting is easy to get wrong, and an unset output had to degrade to "yes" rather than crash the step. Both cases checked.
🤖 Generated with Claude Code