Skip to content

feat(installer): stop prompting for location during register — auto-derive from timezone (#354)#355

Merged
saadqbal merged 1 commit into
developfrom
feat/provision-drop-location-prompt
Jul 15, 2026
Merged

feat(installer): stop prompting for location during register — auto-derive from timezone (#354)#355
saadqbal merged 1 commit into
developfrom
feat/provision-drop-location-prompt

Conversation

@saadqbal

@saadqbal saadqbal commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes #354.

What

The installer's Register this machine step prompted for both a client name and a location zone. This drops the location prompt: we now prompt for the name only and derive the carbon zone silently from the system timezone. When detection yields nothing, we provision with no location rather than asking.

Why it's safe now

The location prompt was an explicit INTERIM measure (provision.sh), kept only because the deployed CLI hard-required --name/--location without a TTY. cli#137 has since shipped — in CLI v0.9.2 and main — so tracebloc client create now auto-names <firstname>-NN and treats --location as fully optional (never prompted, never required; sends nothing when absent, backend records no location). The installer pulls the CLI from releases/latest, so it already has this behavior. No CLI-repo change is needed.

Behavior

Case Before After
Interactive install prompts name and location (Enter to accept detected zone) prompts name only; zone auto-derived from timezone
Timezone not detectable required-entry loop until a zone is typed provisions with no --location, no prompt
TRACEBLOC_CLIENT_LOCATION set used, prompt skipped used, still overrides (unchanged)
Unattended (env name) silent auto-derive silent auto-derive (unchanged)

Changes

  • scripts/lib/provision.sh: remove the interactive location block (detected-zone accept + required-entry loop); refresh the now-stale interim comments and the _report_create_failure hint that referenced the removed prompt.
  • scripts/tests/provision.bats: +2 tests (auto-derive from timezone → --location; no detection → no --location, never prompts). Full suite green (23/23).
  • scripts/manifest.sha256: regenerated (R8 Static-analysis gate).

shellcheck clean.

🤖 Generated with Claude Code


Note

Low Risk
Installer UX and provisioning-args logic only; name prompting and env overrides are unchanged, with new bats tests locking behavior.

Overview
Interactive Register this machine now asks only for the client name; carbon zone is never prompted.

When TRACEBLOC_CLIENT_LOCATION is unset, provision.sh silently derives a zone from the system timezone and passes --location only when one is found. If detection fails, it calls client create without --location instead of blocking on a required-entry loop. Invalid-zone errors now tell users to set TRACEBLOC_CLIENT_LOCATION rather than referring to the removed prompt.

provision.bats adds coverage for silent auto-derive and no-location provisioning; manifest.sha256 is updated for the changed script.

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

…erive from timezone (#354)

The "Register this machine" step prompted for both a name and a location
zone. The location prompt was an explicit INTERIM measure, kept only
because the deployed CLI hard-required --name/--location without a TTY.

cli#137 has since shipped (CLI v0.9.2 / main; the installer pulls the CLI
from releases/latest): `client create` auto-names <firstname>-NN and
treats --location as fully optional — never prompted, never required,
sends nothing when absent so the backend records the client with no
location. The blocker is gone.

Now: prompt for the name only. Derive the carbon zone from the system
timezone silently (no network); when detection yields nothing, provision
with no --location rather than asking. A pinned TRACEBLOC_CLIENT_LOCATION
still overrides for unattended installs.

- provision.sh: drop the interactive location block (detected-zone accept
  + required-entry loop); refresh the interim comments and the
  _report_create_failure hint that referenced the removed prompt.
- provision.bats: add coverage for the two new paths (auto-derive from
  timezone; no-detection → no --location, never prompts).
- manifest.sha256: regenerated for the provision.sh change (R8 gate).

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

Copy link
Copy Markdown
Contributor

👋 Heads-up — Code review queue is at 48 / 30

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.)

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

@saadqbalApproved. Correctly-sequenced removal of the interim location prompt (the "KEEP THIS PROMPT until cli#137 ships" block from #341) — and importantly you waited for cli#137 to actually release, not just merge. I verified the load-bearing bits:

  • ✅ cli#137 is shipped, not just closed. At the v0.9.2 tag (released today, the latest the installer pulls), client create's --location is a plain optional StringVar with no MarkFlagRequired — "optional … never prompted, never required … omitted if unset," request field omitempty (backend records no location, not a silent default), plus auto-naming. So a no-detection curl | bash install sending client create --name X with no --location now succeeds — the exact breakage the interim comment guarded against is gone.
  • ✅ Manifest hash matches — recomputed provision.sh = bf283e1… == manifest.sha256. R8 intact.
  • --location conditionally passed[[ -n "$client_location" ]] && _create_args+=(--location "$client_location"); never --location "", clean array construction.
  • ✅ Clean removal — parses, no orphaned refs to the deleted locals/prompt strings, _detect_location_zone still defined + used by the silent fallback, and _report_create_failure's hint was updated in lockstep to point at TRACEBLOC_CLIENT_LOCATION.
  • ✅ Tests pin both paths — detection → --location FR silently, no prompt; no-detection → no --location, no prompt, non-fatal. Both feed only a name on stdin, so a lingering prompt would hang the test — good structural guard. (bats isn't installed locally; I parse-checked + logic-reviewed, CI runs the suite.)

⚪ Minor (non-blocking)

  • No explicit CLI-version gate for optional-location: safety rests on "latest release carries cli#137" (v0.9.2 does). A run that pins an older TRACEBLOC_CLI_VERSION and has no detectable zone and no TRACEBLOC_CLIENT_LOCATION would send a --location-less client create to a pre-#137 CLI and fail. Edge case — the env override covers it and _report_create_failure surfaces the real error rather than failing blind — but a one-line note wouldn't hurt.

Touches your code-owned provision.sh + manifest (R8); you're the author, so this is the approving second set of eyes. Clear to merge.

🤖 Generated with Claude Code

@saadqbal
saadqbal merged commit a179e0c into develop Jul 15, 2026
35 checks passed
saadqbal added a commit that referenced this pull request Jul 16, 2026
…from timezone (#356)

* Merge pull request #355 from tracebloc/feat/provision-drop-location-prompt

feat(installer): stop prompting for location during register — auto-derive from timezone (#354)

* fix(installer): attribute rejected-zone hint to its real source (Bugbot #356) (#357)

* fix(installer): attribute rejected-zone hint to its real source (Bugbot #356)

The invalid-location failure branch always told the operator the zone was
auto-derived from the timezone and pointed them at TRACEBLOC_CLIENT_LOCATION
as the fix. When the rejected value actually came FROM that env override, the
hint read as "your override was ignored" — the opposite of what happened.

Track whether the location was pinned via TRACEBLOC_CLIENT_LOCATION ("env") or
timezone-derived ("auto") and pass the source into _report_create_failure so the
fix hint names the real origin. Defaults to "auto" when the caller omits it.

Adds three unit tests covering both sources plus the default.

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

* chore(installer): refresh manifest checksum for provision.sh (R8)

The rejected-zone-hint edit changed scripts/lib/provision.sh; regenerate
scripts/manifest.sha256 so the supply-chain "manifest is current" check passes.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <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.

3 participants