Skip to content

feat(installer): install the tracebloc CLI as part of the client install (Step 5, both OSes)#202

Merged
saadqbal merged 7 commits into
developfrom
feat/201-cli-in-client-installer
Jun 4, 2026
Merged

feat(installer): install the tracebloc CLI as part of the client install (Step 5, both OSes)#202
saadqbal merged 7 commits into
developfrom
feat/201-cli-in-client-installer

Conversation

@saadqbal
Copy link
Copy Markdown
Contributor

@saadqbal saadqbal commented Jun 4, 2026

Closes #201.

When a user installs the client (scripts/install.sh on macOS/Linux, install.ps1 on Windows), the tracebloc CLI is now installed too — so they can immediately tracebloc dataset push ./data against the client they just set up.

Design

  • New scripts/lib/install-cli.shinstall_tracebloc_cli() runs the CLI's own released installer (tracebloc/cli, releases/latest/download/install.sh), which downloads the right build for the OS/arch and verifies it (SHA256 + cosign). No install logic duplicated here.
  • NON-FATAL: the client is already connected when Step 5 runs, so a CLI hiccup must never fail the install. The lib downloads to a temp file, checks each step, and return 0s on every path — it does not rely on the caller's set -o pipefail (so no curl | sh mis-reporting a failed download as success).
  • New Step 5/5 after wait_for_client_ready; step N 4N 5 across the orchestrator + helm lib + roadmap.
  • Wired into the bootstrap FILES=() in install.sh (else it wouldn't be downloaded).

Windows parity

install-k8s.ps1: Install-TraceblocCli runs the CLI's install.ps1 in a child powershell process (its $ErrorActionPreference='Stop'/exit can't abort the parent installer); Step 5/5; roadmap + summary updated.

UX / docs

  • Summary 'What to do next' → tracebloc dataset push ./data.
  • README quick-install + docs/INSTALL.md callout note the CLI is installed.

Tests / validation

  • scripts/tests/install-cli.bats asserts the non-fatal property (download-fail, install-fail, success paths all return 0).
  • bash -n clean on all touched shell files; install-k8s.ps1 parses clean; renumbering verified (no leftover N 4).

🤖 Generated with Claude Code


Note

Medium Risk
Installers now fetch and execute external release scripts from github.com/tracebloc/cli at install time; Step 5 is designed to be non-fatal, but network or supply-chain issues could still affect users who expect the CLI to be present immediately.

Overview
Adds Step 5/5 to the client installers so the tracebloc CLI is installed after the client is connected, enabling tracebloc dataset push ./data without a separate setup step.

On macOS/Linux, new scripts/lib/install-cli.sh delegates to the CLI repo’s released install.sh (download to temp, then run — not curl | sh). Bootstrap install.sh includes the lib in its download list; install-k8s.sh sources it only if present so older bootstraps skip Step 5 instead of failing under set -e. Install flow renumbers steps from 4 to 5 in roadmap, helm sub-steps, and orchestrators.

On Windows, Install-TraceblocCli runs the CLI’s install.ps1 in a child PowerShell process so the CLI installer’s stop-on-error behavior cannot abort the parent; success is judged solely by child exit code.

Step 5 is non-fatal everywhere: failures warn and manual install hints are shown; the overall install still succeeds if the client is up. Success summaries and README / docs/INSTALL.md quick-install text now mention CLI install and tracebloc dataset push.

Tests: new install-cli.bats (non-fatal paths) and Pester coverage for Install-TraceblocCli. New .github/workflows/standard-checks.yml runs unconditional Lint and Unit tests jobs for branch protection.

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

…indows)

When a user installs the client, also install the tracebloc CLI so they can
`tracebloc dataset push ./data` against the client they just set up — no
separate step.

- New scripts/lib/install-cli.sh: install_tracebloc_cli() runs the CLI's own
  released installer (github.com/tracebloc/cli; SHA256 + cosign verified, all
  arches) — no logic duplicated. NON-FATAL: downloads to a temp file, checks
  each step, returns 0 on every path, so a CLI hiccup never fails an
  already-connected client install (and doesn't rely on the caller's pipefail).
- install.sh: add the lib to the bootstrap FILES[].
- install-k8s.sh: source it + call after wait_for_client_ready; step N/4 -> N/5.
- install-k8s.ps1: Install-TraceblocCli (runs the CLI's install.ps1 in a CHILD
  process so its exit-on-failure can't abort us); Step 5/5; renumber + roadmap.
- common.sh roadmap + summary.sh "what to do next": surface tracebloc dataset push.
- docs (README quick-install + INSTALL.md callout) note the CLI is installed.
- tests: scripts/tests/install-cli.bats asserts the non-fatal property.

Closes #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka
Copy link
Copy Markdown
Contributor

👋 Heads-up — Code review queue is at 14 / 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.)

Comment thread scripts/install-k8s.ps1
saadqbal and others added 2 commits June 4, 2026 16:01
common.sh declares CURL_SECURE readonly and load_lib sources it, so the
setup() reassignment errored ("readonly variable") and failed all three
install-cli cases. Drop it — curl is mocked in every test, so the value is
irrelevant. (Refs #201.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- install-k8s.sh: source + call install_tracebloc_cli only if present, so a
  stale bootstrap (e.g. a not-yet-updated tracebloc.io/i.sh, whose FILES list
  is hand-maintained) degrades gracefully — Step 5 is skipped instead of
  aborting the whole installer under `set -e`. Uses `if` blocks, not
  `[[ -f ]] && source` (a false `&&` test would itself trip `set -e`).
- install-k8s.Tests.ps1: Pester coverage for Install-TraceblocCli — asserts the
  non-fatal property (warns, never throws) when the CLI installer exits
  non-zero and when Start-Process throws, plus success on exit 0. Parity with
  the bash-side install-cli.bats.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saadqbal saadqbal self-assigned this Jun 4, 2026
Comment thread scripts/lib/install-cli.sh Outdated
saadqbal and others added 2 commits June 4, 2026 17:12
$env:TEMP is null under Linux pwsh (which the ubuntu-latest Pester job
exercises), so `Join-Path $env:TEMP ...` threw. Use
[System.IO.Path]::GetTempPath() (%TEMP% on Windows, /tmp on Linux). The
function is Windows-only in production, but the Pester suite runs on Linux too.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rsion probe

- install-k8s.ps1 (Install-TraceblocCli): Start-Process -Wait -PassThru with
  redirected output can leave .ExitCode $null on Windows, misreporting a
  successful install as a failure. Refresh PATH and use `Has tracebloc` as the
  primary success signal, with ExitCode as a secondary check. Added a Pester
  case for the null-ExitCode quirk.
- install-cli.sh: the cosmetic `$(tracebloc version | head -1)` could fail under
  `set -o pipefail` (incl. SIGPIPE from head) and, in some bash semantics, abort
  the "non-fatal" step. Capture into a `local` with `|| true` so it can never
  abort the client install.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 7ab391b. Configure here.

Comment thread scripts/install-k8s.ps1
Bugbot: the previous fix accepted "tracebloc already on PATH OR exit 0" as
success, so a failed re-install on a machine that already had the CLI was
misreported as success (the bash step warns on installer failure regardless).

Gate on the installer's exit status alone, mirroring bash (`if sh installer`).
To keep that exit code reliable on Windows (where -Wait -PassThru with
redirected output can leave .ExitCode $null), switch to -PassThru + cache
.Handle + WaitForExit(). Replaced the obsolete null-ExitCode test with a
regression test: failed re-install + CLI already on PATH must still warn.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aptracebloc
aptracebloc previously approved these changes Jun 4, 2026
client/develop's ruleset requires the status contexts `Lint` and `Unit tests`,
but this repo's CI emitted equivalents under other names (Static analysis /
bats / Pester) — so every PR sat blocked at "Expected — waiting for status to
be reported".

Add a Standard checks workflow that emits exactly `Lint` (bash -n + shellcheck)
and `Unit tests` (bats), reusing installer-tests.yaml's proven steps. It is NOT
path-filtered: a required check must report on every PR, or a PR that doesn't
touch the filtered paths re-creates the same "Expected" deadlock.

Refs #201

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saadqbal saadqbal merged commit dc287ca into develop Jun 4, 2026
20 checks passed
saadqbal added a commit that referenced this pull request Jun 4, 2026
…er (#203)

feat(installer): install the tracebloc CLI as part of the client install (Step 5, both OSes)
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.

3 participants