Skip to content

Installer copy catalog (byte-exact golden of what a user sees)#366

Open
LukasWodka wants to merge 1 commit into
developfrom
style/installer-copy-catalog
Open

Installer copy catalog (byte-exact golden of what a user sees)#366
LukasWodka wants to merge 1 commit into
developfrom
style/installer-copy-catalog

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a copy catalog for the installer — a byte-exact golden of every stable piece of user-facing copy, so wording + layout can be reviewed without running an install. Mirrors the CLI's golden catalog (cli repo, internal/cli/testdata/golden/).

scripts/tests/copy-catalog.bats renders the copy colour-off (NO_COLOR) into two files under scripts/testdata/golden/, ordered like the run:

  • 00-install.golden — the banner (versioned + direct-run variants), the "2. Installing" roadmap, the six running step headers (a–f; titles read live from install-k8s.sh so they can't drift), and --help.
  • 01-outcomes.goldenprint_summary's five end states (connected / starting / bad creds / image pull / crash) + the reboot footer, including the macOS/Windows variant.

Why

So we stop the "change copy → deploy → see it in prod → fix" loop: the catalog is reviewable on any PR that touches installer copy, and the test fails on drift.

Determinism

  • Colour off → text is byte-exact.
  • The one live read (_chart_version) is stubbed; $HOME collapses to ~ in the summary, so the goldens are stable across machines/CI.
  • The step titles are extracted from install-k8s.sh at test time, so they track the real installer.

Test plan

  • TB_UPDATE_GOLDEN=1 bats scripts/tests/copy-catalog.bats regenerates; plain bats scripts/tests/copy-catalog.bats verifies (drift guard). Both green locally.
  • Not in the R8 manifest (tests/ + testdata/ aren't installer scripts). CI already globs scripts/tests/*.bats and excludes .bats from shellcheck, so it runs with no wiring changes.

🤖 Generated with Claude Code


Note

Low Risk
Test-only additions (golden fixtures + BATS); no installer runtime or deployment behavior changes.

Overview
Adds a byte-exact copy catalog for the tracebloc installer so stable user-facing text and layout can be reviewed on PRs without running a full install (same idea as the CLI golden catalog).

New BATS suite scripts/tests/copy-catalog.bats renders installer copy with NO_COLOR=1, stubs _chart_version, and pulls step a–f titles live from install-k8s.sh via sed so headers stay aligned with the real script. Output is diffed against two goldens under scripts/testdata/golden/: 00-install.golden (banner variants, roadmap, step headers, --help) and 01-outcomes.golden (all print_summary end states plus the macOS/Windows reboot note). Drift fails CI; intentional copy updates use TB_UPDATE_GOLDEN=1 bats scripts/tests/copy-catalog.bats.

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

Adds scripts/tests/copy-catalog.bats — a golden catalog mirroring the CLI's
(cli repo, internal/cli/testdata/golden/), so the installer's user-facing copy
can be reviewed without running an install. Two files under
scripts/testdata/golden/, ordered like the run:

  00-install.golden  — the banner (versioned + direct-run variants), the
                       "2. Installing" roadmap, the six running step headers
                       (a-f; titles read live from install-k8s.sh so they can't
                       drift), and --help.
  01-outcomes.golden — print_summary's five end states (connected / starting /
                       bad creds / image pull / crash) + the reboot footer,
                       incl. the macOS/Windows variant.

Rendered colour-off (NO_COLOR) so the text is byte-exact; the one live read
(_chart_version) is stubbed for determinism, and $HOME collapses to ~, so the
goldens are stable across machines/CI. The tests fail on drift; regenerate with
TB_UPDATE_GOLDEN=1 bats scripts/tests/copy-catalog.bats.

Not in the R8 manifest (tests/ + testdata/ aren't installer scripts); CI already
globs scripts/tests/*.bats and excludes .bats from shellcheck.

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f5bfebf. Configure here.

GPU_VENDOR=none; TB_NAMESPACE=tracebloc; HOST_DATA_DIR="$HOME/.tracebloc"
# Stub the one live read the summary makes, so it's deterministic.
_chart_version() { echo "1.9.5"; }
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Banner catalog not environment-stable

Low Severity

setup never clears TRACEBLOC_BANNER_SHOWN, but print_banner no-ops when that variable is set. An inherited value from the shell (or a prior install debug session) suppresses both banner samples in emit_install, so the drift check fails or TB_UPDATE_GOLDEN=1 rewrites 00-install.golden without banners. Existing print_banner tests in common.bats already unset this for the same reason.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f5bfebf. Configure here.

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