Repository navigation
fix: show workspace and automation names instead of ids (0.1.27) - #44
Merged
Merged
Conversation
… (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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With the final cloud-api wire shapes (ids only),
nan automations ls,nan automations show,nan approvals ls,nan runs showandnan runs proposalprinted 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:
GET /api/workspaces(workspace_uuid,name). PATs needworkspaces:read; sessions andsk-keys work.GET /v1/automations(PATs needautomations:read).runsEnv), made only when a name is missing (runs already carry their workspace name, soruns showdoes not hit/api/workspaces). 5s timeout per lookup.automations show,runs show,runs proposal) showname (uuid)so the id stays copyable.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 lsalso 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/workspacescall 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;--jsonmakes only the command's own request and prints byte-identical output whether names are available or not.cmd/golden_test.go: golden render now expectsPR review api (a000...)anddevelop (1111...).internal/runs:NameAndIDunit test.TestNamesOneLookupPerCommandfail.go build ./...,go vet ./...,gofmt -l .(clean),go test ./...all pass.🤖 Generated with Claude Code