Skip to content

ci(env): move the CLIENT_ENV vocabulary guard into the job that gates (backend#1729) - #715

Merged
LukasWodka merged 1 commit into
developfrom
ci/1729-gate-vocabulary-guard
Aug 14, 2026
Merged

ci(env): move the CLIENT_ENV vocabulary guard into the job that gates (backend#1729)#715
LukasWodka merged 1 commit into
developfrom
ci/1729-gate-vocabulary-guard

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The vocabulary-agreement guard from #706 ran in helm-ci.yaml → job Helm lint. That job is not a required status check on this repo. The required contexts on develop are:

Unit tests · Lint · quality/gitleaks · quality/house-rules · quality/shellcheck
quality/action-pins · version-bump-gate/version-check · Source-of-truth drift

So a PR that made the four CLIENT_ENV declarations disagree was mergeable with the guard red. It advised; it did not gate.

That is backend#1729's own class, in backend#1729's own flagship deliverable — a mechanism that looks like verification but isn't connected to the outcome it claims to control.

What changed

Move the step into drift-checks.yamlSource-of-truth drift, which needed no new configuration to make this real:

helm-ci loses the step and the two paths: entries that arrived with it in #706:

entry why
scripts/install-k8s.ps1 genuinely leaves — helm-ci is the heaviest workflow here (real k3d cluster + two 4-platform matrices); a PowerShell installer edit has no other reason to start it
scripts/lib/common.sh also goes, but was always redundant — the pre-existing scripts/lib/** glob still matches it, so triggering is unchanged

No branch-protection change is required or included. The gate comes from landing in an already-required job.

Test plan

Mutation-proved rather than assumed:

mutation applied  (staging) → stagingXX) in scripts/lib/common.sh)
guard exit after mutation = 1
guard exit after restore  = 0

The mutation anchor was asserted to have applied before trusting the result — an inert mutation and good coverage look identical in a log.

Armed while green. On this branch all four declarations agree and every accepted spelling is exercised: dev 12, development 2, prod 11, production 4, staging 9, stg 6.

Both workflow files re-parse as valid YAML; Source-of-truth drift now lists check-drift + CLIENT_ENV vocabulary agreement.

Checklist

  • Targets develop
  • No new required-check contexts added (uses an existing one)
  • Guard verified green before arming
  • Guard verified able to go red

Refs backend#1729


Note

Low Risk
CI workflow wiring only; no application or chart runtime behavior changes. Effect is stronger enforcement of an existing guard via an already-required check.

Overview
Moves the CLIENT_ENV vocabulary agreement step (env-vocabulary-agreement.sh) from helm-ci’s Helm lint job into drift-checks’s Source-of-truth drift job so a mismatch across the four declarations (Go template, JSON Schema, bash, PowerShell) blocks merge instead of only failing a non-required check.

drift-checks gains the new step and header comments that position it as the home for duplicated-declaration guards and note CLIENT_ENV alongside existing drift checks. helm-ci drops that step and removes paths: entries for scripts/tests/env-vocabulary-agreement.sh, scripts/install-k8s.ps1, and the explicit scripts/lib/common.sh line (installer-only edits no longer trigger the heavy workflow; scripts/lib/** still covers common.sh).

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

… (backend#1729)

The guard added in #706 parses all four CLIENT_ENV declarations and compares
them. It ran in helm-ci.yaml's `Helm lint` job. `Helm lint` is not a required
status check on this repo -- the required contexts on develop are `Unit tests`,
`Lint`, `quality/*`, `version-bump-gate/version-check` and `Source-of-truth
drift` -- so a PR that made the four declarations disagree was mergeable with
the guard red. It could advise; it could not block.

That is the shape backend#1729 is about, in the epic's own flagship deliverable:
a mechanism that appears to verify something without being connected to the
outcome it claims to control.

`Source-of-truth drift` is the correct home and needed no new configuration:

  - it is REQUIRED on develop and on main, so a disagreement blocks the merge;
  - it deliberately carries NO `paths:` on pull_request (its header records why
    -- a path-filtered required check bricks PRs outside those paths, which is
    what happened to #651/#657/#660 on 2026-08-11), so the guard now also runs
    on the installer-only PRs helm-ci's filter would have skipped;
  - it is already the home of the other duplicated-declaration guard
    (check-drift.sh), and the guard needs only bash + python3, ~2s.

helm-ci loses the step and the two `paths:` entries that arrived with it in
#706. `scripts/install-k8s.ps1` genuinely leaves -- helm-ci is the repo's
heaviest workflow (a real k3d cluster plus two 4-platform matrices) and a
PowerShell installer edit has no other reason to start it. The explicit
`scripts/lib/common.sh` entry also goes, but that one was always redundant:
the pre-existing `scripts/lib/**` glob still matches it, so helm-ci's
triggering on a common.sh change is unchanged.

Mutation-proved rather than assumed: with `staging)` renamed in
scripts/lib/common.sh the guard exits 1; restored, it exits 0. The mutation
anchor was asserted to have applied first -- an inert mutation and good
coverage look identical in a log.

Verified green on this branch before arming: all four declarations agree and
all six spellings are exercised (dev 12, development 2, prod 11, production 4,
staging 9, stg 6).

Refs backend#1729
@LukasWodka LukasWodka self-assigned this Aug 13, 2026
@LukasWodka

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bfa967d. Configure here.

@LukasWodka
LukasWodka requested review from aptracebloc and saqlainsyed007 and removed request for aptracebloc August 13, 2026 22:50

@saqlainsyed007 saqlainsyed007 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.

Reviewed for correctness (high effort). This is a clean CI-wiring change and I recommend it.

Traced the move end-to-end:

  • No coverage lost by the removed paths: entries.

    • scripts/lib/common.sh — still matched by the retained scripts/lib/** glob, so helm-ci triggering on a common.sh change is unchanged. ✓
    • scripts/install-k8s.ps1 — the PowerShell installer is exercised by installer-tests.yaml (scripts/**), windows-e2e.yaml, and release-helm-chart.yaml; helm-ci's own jobs (lint/template/unittest/ingestor-multiarch/e2e) never tested it beyond the vocabulary guard, which now runs in drift-checks. ✓
    • scripts/tests/env-vocabulary-agreement.sh — the guard itself; now runs in Source-of-truth drift, which is unfiltered on pull_request, so an edit to it still triggers the check. ✓
  • The guard genuinely gates now. Source-of-truth drift is a required context and its job name is unchanged by adding a step, so branch protection keeps recognizing it — no config change needed, as the PR states.

  • Runtime deps satisfied in the new home. env-vocabulary-agreement.sh needs only bash + python3 (present on ubuntu-latest) and the checked-out client/** + scripts/** sources; the drift job checks out the repo, so all four declarations and client/tests are readable. The script fails closed (exit 2) if not, which is the correct posture for a required gate.

  • Both changed workflow files re-parse as valid YAML; the added step is indented consistently with check-drift.

Altitude is good: the fix lands the guard in the already-required job rather than bolting on a branch-protection special case. No correctness, cleanup, or convention issues found.

@LukasWodka
LukasWodka merged commit 617af7b into develop Aug 14, 2026
24 checks passed
@LukasWodka
LukasWodka deleted the ci/1729-gate-vocabulary-guard branch August 14, 2026 05:45
LukasWodka added a commit that referenced this pull request Aug 14, 2026
Resolves the helm-ci.yaml conflict with #715, which moved the CLIENT_ENV
vocabulary-agreement guard out of `Helm lint` into drift-checks.yaml's
required `Source-of-truth drift` job. Calling `make helm-vocab` from the
lint job would have quietly put it back, so the guard moves to `make
drift` (the target that mirrors the drift gate) and `helm-vocab` is now
the chart vocabulary only. `make check` runs both, so the local tier is
unchanged.

Bugbot, two findings on b5c21fe:

- Helm setup removed from lint job. Correct: dropping the
  azure/setup-helm v3.15.4 pin left both make targets running against
  whatever helm the runner image ships, and chart-env-vocabulary.sh
  branches on the helm version (its helper-backstop cases self-skip
  below 3.16), so the pin decides which assertions run. Installing helm
  is environment bootstrap, the same class as the shellcheck apt install
  this PR deliberately kept. Restored, with the same action + pin
  drift-checks.yaml uses.

- Makefile missing from path filters. Correct: the lint job now executes
  the Makefile, so a Makefile-only edit to those targets has to be able
  to start this workflow. Added to both `paths:` lists.
  standard-checks.yml needs no equivalent -- it is deliberately not
  path-filtered at all, being a required check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants