Skip to content

cli: show full snapshot ID in snapshot list#55

Merged
rgarcia merged 2 commits into
mainfrom
fix/snapshot-list-full-id
Jun 11, 2026
Merged

cli: show full snapshot ID in snapshot list#55
rgarcia merged 2 commits into
mainfrom
fix/snapshot-list-full-id

Conversation

@rgarcia

@rgarcia rgarcia commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

hypeman snapshot list truncated the snapshot ID to 12 chars (TruncateID), but snapshot get / snapshot restore require the full 24-char ID — so copying the displayed ID returned a 404. The list table now shows the full snapshot ID; -q/quiet output already printed the full ID and is unchanged.

Found during QA of hypeman#277 (snapshot/standby flows).

Test

go build ./... + go test ./pkg/cmd/... green. Verified live: snapshot list now shows the 24-char ID and snapshot get <that id> succeeds.

🤖 Generated with Claude Code


Note

Low Risk
CLI display-only change for snapshot list table formatting; no API or server behavior changes.

Overview
hypeman snapshot list now prints the full 24-character snapshot ID in the table instead of a 12-character TruncateID value, so IDs copied from the list work with snapshot get and snapshot restore (which require the full ID).

On narrow terminals, TruncOrder is updated from ID+SOURCE to NAME+SOURCE, so column shrinking affects those fields while the ID column stays full width. A regression test (TestSnapshotListIDNotTruncated) asserts ID width and rendered output at COLUMNS=40. Quiet (-q) output was already full IDs and is unchanged.

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

`snapshot list` truncated the ID to 12 chars (TruncateID), but `snapshot get`/`snapshot restore` require the full 24-char ID, so the displayed ID returned 404. Show the full ID in the list table; `-q` output was already full and is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: ID column still ellipsized
    • Updated snapshot list table truncation order to only shrink the SOURCE column so full snapshot IDs are no longer ellipsized.

Create PR

Or push these changes by commenting:

@cursor push 50baeafdb2
Preview (50baeafdb2)
diff --git a/pkg/cmd/snapshotcmd.go b/pkg/cmd/snapshotcmd.go
--- a/pkg/cmd/snapshotcmd.go
+++ b/pkg/cmd/snapshotcmd.go
@@ -343,7 +343,7 @@
 	}
 
 	table := NewTableWriter(os.Stdout, "ID", "NAME", "KIND", "SOURCE", "CREATED")
-	table.TruncOrder = []int{0, 3}
+	table.TruncOrder = []int{3}
 	for _, snapshot := range *snapshots {
 		name := snapshot.Name
 		if name == "" {

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 6edb87a. Configure here.

Comment thread pkg/cmd/snapshotcmd.go
@firetiger-agent

Copy link
Copy Markdown

Created a monitoring plan for this PR.

What this PR does: Fixes a UX bug where hypeman snapshot list displayed truncated 12-character IDs that couldn't be used directly with snapshot get or snapshot restore — both of which require the full 24-character ID. CLI users can now copy IDs from snapshot list and use them without getting a 404.

Intended effect:

  • snapshot list table output: baseline shows truncated 12-char IDs; confirmed if the ID column now shows full 24-char IDs and snapshot get <id> succeeds with HTTP 200.
  • Quiet mode and --format output: unchanged by this PR; no regression expected.

Risks:

  • Narrow terminal rendering — the table writer has TruncOrder = []int{0, 3}, so in very narrow terminals the ID column could get re-truncated by the table renderer; verify with hypeman snapshot list at 80-col width.
  • Scripts parsing table output — any script parsing the non-quiet table output for a 12-char ID prefix will now receive a 24-char ID; no telemetry signal, manual audit of consuming scripts if any exist.

Status updates will be posted automatically on this PR as monitoring progresses.

View monitor

The ID column carried the full 24-char ID but was still first in
TruncOrder, so a narrow terminal would ellipsize it and defeat
copy-paste into snapshot get/restore. Truncate NAME and SOURCE
instead, and add a regression test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rgarcia rgarcia merged commit 2f1db7f into main Jun 11, 2026
7 checks passed
@rgarcia rgarcia deleted the fix/snapshot-list-full-id branch June 11, 2026 22:30
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.

1 participant