Uh oh!
There was an error while loading. Please reload this page.
test(drift): CI guard for source-of-truth drift (backend hosts + workload names) - #218
Conversation
…load names) Mocked unit tests can't catch a chart rename that breaks the names summary.sh / diagnose.sh grep for, or a backend host changed in one of the three files that hardcode it — they ship green and break in the field. Add a drift checker: - backend API host parity across preflight.sh / install-client-helm.sh / install-k8s.ps1 (dev/stg/prod hosts must match). - workload-name contract: the Deployments/DaemonSet that summary.sh (readiness wait) and diagnose.sh (--diagnose bundle) reference by name must be rendered by the chart (helm template), and the scripts must still reference each. - 8 bats cases for the checker; drift-checks.yaml runs on scripts/ or client/ changes (helm set up in CI); check-drift.sh added to the shellcheck list. Refs tracebloc/backend#746 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jun 6, 2026
👋 Heads-up — Code review queue is at 24 / 8 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
saadqbal
left a comment
There was a problem hiding this comment.
Solid net-new drift guard — CI-only, can't affect runtime. Check 1 (backend host parity across preflight.sh / install-client-helm.sh / install-k8s.ps1) and Check 2 (workload-name contract: 2a scripts ↔ 2b helm template render) both look correct, and sourcing is side-effect-safe (set + main gated on direct execution) so the bats suite can exercise the helpers. 8/8 bats green. LGTM.
Uh oh!
There was an error while loading. Please reload this page.
What
Net-new CI drift check — fails when two sources of truth that must agree have silently diverged. From the test-hardening analysis; the only roadmap item with no existing PR. Tracks backend#746.
Two checks (
scripts/tests/check-drift.sh):1. Backend API host parity — the dev/stg/prod hosts are hardcoded in three files (
preflight.sh::_pf_backend_host,install-client-helm.sh::_backend_url,install-k8s.ps1::Get-BackendUrl). Asserts all three carry the identical*.tracebloc.iohost set.2. Workload-name contract —
summary.sh(readiness wait,rollout status deployment/<name>) anddiagnose.sh(--diagnosebundle,logs deploy/<name>+daemonset/<name>) referencemysql-client,<release>-jobs-manager,<release>-requests-proxy,tracebloc-resource-monitorby name. A chart rename breaks readiness + diagnostics silently — same class as theapp=managerselector bug. Renders the chart (helm template) and asserts each name exists, and that the scripts still reference each (so the contract can't go stale on either side).How
.github/workflows/drift-checks.yamlruns onscripts/**ORclient/**(either side moving is the drift), sets up helm, runs the check.scripts/tests/check-drift.bats— 8 cases (parity match / mismatch / removed; contract drop; render-missing; helm-absent skip).check-drift.shadded to the static job's shellcheck list.Testing
bash scripts/tests/check-drift.sh→ green on develop (both checks pass; the chart render confirms the four workload names).bats scripts/tests/check-drift.bats→ 8/8.Follow-ups (separate)
docs-l app=…selectors ↔ chart labels (the originalapp=managersurface) — needs a cross-repo guard.Source-of-truth driftjob to a required status check once proven stable.Refs tracebloc/backend#746
🤖 Generated with Claude Code