Skip to content

fix: show workspace and automation names instead of ids (0.1.27) - #44

Merged
sre-helmcode merged 2 commits into
mainfrom
feat/resolve-names
Oct 11, 2026
Merged

sre-helmcode merged 2 commits into
mainfrom
feat/resolve-names

Conversation

@sre-helmcode

Copy link
Copy Markdown
Contributor

What

With the final cloud-api wire shapes (ids only), nan automations ls, nan automations show, nan approvals ls, nan runs show and nan runs proposal printed the workspace UUID and the automation UUID where a person expects names (found in the prod E2E).

The text views now resolve names client-side:

  • Workspace names: GET /api/workspaces (workspace_uuid, name). PATs need workspaces:read; sessions and sk- keys work.
  • Automation names: GET /v1/automations (PATs need automations:read).
  • At most one request per list per command (cached on the command's runsEnv), made only when a name is missing (runs already carry their workspace name, so runs show does not hit /api/workspaces). 5s timeout per lookup.
  • Tables show the name; detail views (automations show, runs show, runs proposal) show name (uuid) so the id stays copyable.
  • Any failure (403 token_scope_denied, 401, 5xx, bad JSON, dropped connection, id not in the list) falls back silently to the UUID; the command never fails because of it.
  • --json: no extra request, output is the API's shape, unchanged.
  • nan runs ls also falls back to the workspace id (instead of an empty column) when a run carries no workspace name.

Version bump: 0.1.26 -> 0.1.27 (merging publishes the release).

Tests

  • cmd/names_test.go (httptest + the phase2 golden files): names rendered in each view; exactly one lookup per command even with many rows and after a refusal; no /api/workspaces call when the run already names its workspace; fallback to the UUID on 403 token_scope_denied, 401, 500, non-JSON and dropped connection, with empty stderr; unknown id falls back; names are sanitised; --json makes only the command's own request and prints byte-identical output whether names are available or not.
  • cmd/golden_test.go: golden render now expects PR review api (a000...) and develop (1111...).
  • internal/runs: NameAndID unit test.
  • Mutation check: disabling the per-command cache makes TestNamesOneLookupPerCommand fail.

go build ./..., go vet ./..., gofmt -l . (clean), go test ./... all pass.

🤖 Generated with Claude Code

barckcode and others added 2 commits October 12, 2026 00:13
… (0.1.27)

The platform names a run's, an approval's and an automation's workspace and
automation by id only, so automations ls/show, approvals ls, runs show and
runs proposal printed UUIDs where people look for names. The text views now
look the names up client-side (GET /api/workspaces, GET /v1/automations), at
most once per command and only when a name is missing. Tables show the name;
detail views show name (id). Any failure (403 token_scope_denied, network,
unknown id) falls back to the id silently. --json makes no extra request and
prints the API's shape unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- golden test exercises the named workspace path (one lookup)
- nan automations run says what the member typed, not the automation UUID
- runs ls shares the run workspace lookup with runs show
- help for nan runs and nan approvals mentions automations:read
- lookup timeout 3s; case-insensitive id test; drop a weak assertion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sre-helmcode
sre-helmcode merged commit 8ea65a0 into main Oct 11, 2026
5 checks passed
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