Skip to content

fix(chart): the ingestor tag fallback is per-environment, not always prod's - #694

Merged
LukasWodka merged 2 commits into
developfrom
fix/1723-ingestor-tag-fallback-env-aware
Aug 13, 2026
Merged

fix(chart): the ingestor tag fallback is per-environment, not always prod's#694
LukasWodka merged 2 commits into
developfrom
fix/1723-ingestor-tag-fallback-env-aware

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

tracebloc.ingestorTag's last-resort literal was a bare "0.8" for every
environment. On the --reuse-values replay it exists for — a release predating
channelTags, where no chart default is adopted — a dev or staging edge
spawned the PROD ingestor line
.

That inverts the whole point of backend#1360: dev/stg channels exist so an
ingestor change can be validated on a real edge without a prod release. An
edge silently validating prod's image reports on the wrong artifact.

It is no longer merely a wrong tag. The prod float has moved past the
ordering ceiling documented at values.yamlprodDigest: the 0.8 line no
longer carries the ingestor's edgeuserDB_USER default that
data-ingestors#468 removed (backend#1853). serviceDbAccountsByEnv supplies
DB_USER on dev/stg, so those two survive it — but the coupling is accidental,
and the same literal is where an out-of-vocabulary CLIENT_ENV lands, where
serviceDbAccountsByEnv misses too and nothing supplies DB_USER. That is
backend#1752 reconstructed from a typo.

Fallback is now keyed on the resolved environment (devdev, stgstg,
prod0.8), so the documented aliases reach it too.

Verified on the real chart — input reaching output, with a control

Rendered against client/ci/bm-values.yaml, helm v4.1.1.

Before (origin/develop @ ead58c6)channelTags: null, i.e. the replay
this branch serves:

channelTags:null CLIENT_ENV=dev -> INGESTOR_IMAGE_TAG value: "0.8" <-- prod line on a dev edge
channelTags:null CLIENT_ENV=stg -> INGESTOR_IMAGE_TAG value: "0.8" <-- prod line on a stg edge
channelTags:null CLIENT_ENV=prod -> INGESTOR_IMAGE_TAG value: "0.8"

Control proving the opposite input differs (same command, channelTags present):

channelTags present, CLIENT_ENV=dev -> INGESTOR_IMAGE_TAG value: "dev"

After (this branch):

dev channelTags:null -> value:"dev"
stg channelTags:null -> value:"stg"
prod channelTags:null -> value:"0.8" <-- control: prod unchanged
development channelTags:null -> value:"dev" <-- alias reaches the fallback
staging channelTags:null -> value:"stg"
production channelTags:null -> value:"0.8"
produktion channelTags:null -> value:"0.8" <-- unknown still renders, unchanged

The duplication is now documented in both directions

The prod literal is a second copy of values.yamlchannelTags.prod and
cannot read the first: --reuse-values (unlike --reset-then-reuse-values)
does not adopt new chart defaults, so a values lookup is nil on exactly the
releases this branch serves. So each copy now points at the other, and the suite
pins both — a bump that touches only one fails CI instead of drifting.

Tests

An existing case asserted 0.8 for a dev edge with channelTags absent —
the bug written down as an expectation. Replaced by four cases plus a prod
control
, so "dev falls back to dev" cannot pass by merely echoing the
environment.

make check (lint + drift guards + helm lint, all 4 platform value files):

1 chart(s) linted, 0 chart(s) failed (x5: default, aks, bm, eks, oc)
==> check: green (bats + helm unit tests are in 'make check-all')

make helm-template — all four platforms render:

=== Rendering aks ===
=== Rendering bm ===
=== Rendering eks ===
=== Rendering oc ===

make helm-unittest:

Charts: 1 passed, 1 total
Test Suites: 30 passed, 30 total
Tests: 388 passed, 388 total
Time: 2.04795475s

Mutation-checked — the new cases actually catch the bug rather than
describing it:

MUTATION 1: restore the old bare "0.8" literal
Tests: 3 failed, 385 passed, 388 total
MUTATION 2: fallback echoes the resolved env (naive fix — breaks prod)
Tests: 2 failed, 386 passed, 388 total <-- the prod control earns its place
restored -> Tests: 388 passed, 388 total

scripts/gen-manifest.sh --check passes unchanged: the manifest covers
scripts/** only, and this PR touches no file it hashes.

Type

  • Bug fix (non-breaking)

Notes for the reviewer

  • Not a breaking change. Prod behaviour is byte-identical; only dev/stg
    edges whose channelTags are absent change, and they change from "prod's
    image" to "their own channel", which is what the schema already promises.
  • Chart version bumped 1.9.34 → 1.9.35 (values.yaml + templates/** are
    chart content per scripts/chart-version-guard.sh).
  • Sibling PR closes the CLIENT_ENV / channelTags vocabulary that lets an
    edge reach this fallback by typo in the first place. That one is breaking and
    is flagged for your decision; this one is independent and safe on its own.

Note

Medium Risk
Changes which ingestor image tag dev/stg edges use when channelTags is absent; prod behavior is unchanged but ingestion spawn paths are operationally sensitive.

Overview
tracebloc.ingestorTag no longer uses a single last-resort "0.8" when images.ingestor.channelTags is missing (typical --reuse-values upgrades). It now maps resolvedCLIENT_ENV to devdev, stgstg, prod0.8, with unknown envs still defaulting to 0.8.

That stops dev/staging from spawning the prod ingestor line when channel tags were never stored—restoring backend#1360’s intent and avoiding accidental prod-image validation on non-prod edges (including DB_USER coupling with the 0.8 line).

Docs and tests:_helpers.tpl and values.yaml document the duplicated prod literal vs channelTags.prod; ingestor_channel_tag_test.yaml replaces the old “dev gets 0.8” expectation with per-env fallback, prod control, alias, and sync checks. Chart version 1.9.37 → 1.9.38.

Reviewed by Cursor Bugbot for commit 59d26e0. Bugbot is set up for automated code reviews on this repo. Configure here.

…prod's
tracebloc.ingestorTag's last-resort literal was a bare "0.8" for every
environment. On the `--reuse-values` replay it exists for — a release
predating `channelTags`, where no chart default is adopted — a dev or
staging edge therefore spawned the PROD ingestor line.
That inverts backend#1360: dev/stg channels exist so an ingestor change can
be validated on a real edge without a prod release, and an edge silently
validating prod's image reports on the wrong artifact.
The literal is also no longer merely wrong. The prod float has moved past
the ordering ceiling documented at values.yaml `prodDigest`: the 0.8 line no
longer carries the ingestor's `edgeuser` DB_USER default that
data-ingestors#468 removed (backend#1853). serviceDbAccountsByEnv supplies
DB_USER on dev/stg so those two survive it, but that coupling is accidental,
and the same literal is where an out-of-vocabulary CLIENT_ENV lands — there
serviceDbAccountsByEnv misses too and nothing supplies DB_USER. That is
backend#1752 reconstructed from a typo.
Keyed on the RESOLVED environment, so the documented aliases reach it too.
Also documents the duplication in both directions: the prod literal is a
second copy of values.yaml `channelTags.prod` and cannot read the first
(a values lookup is nil on exactly the releases this branch serves), so
each now points at the other and the suite pins both.
An existing case asserted `0.8` for a DEV edge with channelTags absent —
the bug written down as an expectation. Replaced by four cases plus a prod
control, so "dev falls back to dev" cannot pass by echoing the environment.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
saadqbal
saadqbal previously approved these changes Aug 13, 2026

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix. Fallback is now keyed on the resolved env via get $fallbacks $clientEnv | default "0.8", so dev→dev, stg→stg, prod→0.8, and an out-of-vocab env still lands on 0.8 (no empty render). Runs through tracebloc.clientEnv so aliases normalize before the key lookup, and the whole path stays nil-guarded for the --reuse-values replay (channelTags absent) this exists for. The prod-control + values-vs-literal pin tests are the right guards against "echo the env" and silent drift. prod unchanged (still digest-pinned). Chart bumped 1.9.34→1.9.35. helm-unittest green locally (17/17). 👍

…tag-fallback-env-aware
# Conflicts:
#	client/Chart.yaml

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at the merge head — the develop merge is clean. Chart.yaml conflict correctly resolved to 1.9.38 (one above develop's 1.9.37), and the helper + test auto-merged coherently with #695's vocabulary close. Per-env fallback and the values-vs-literal drift guard intact, full helm-unittest 394/394 green. 👍

@LukasWodka
LukasWodka merged commit fe9a76d into developAug 13, 2026
22 checks passed
@LukasWodka
LukasWodka deleted the fix/1723-ingestor-tag-fallback-env-aware branch August 13, 2026 09:30
Sign up for freeto 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.

2 participants

@LukasWodka@saadqbal