Skip to content

cli: show full snapshot ID in snapshot list#55

Open
rgarcia wants to merge 1 commit into
mainfrom
fix/snapshot-list-full-id
Open

cli: show full snapshot ID in snapshot list#55
rgarcia wants to merge 1 commit 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
Single-line CLI display change in snapshot list only; no API or auth impact.

Overview
Fixes a UX bug where hypeman snapshot list showed a shortened snapshot ID while snapshot get, snapshot restore, and related commands expect the full 24-character ID, so copy-paste from the table could 404.

The list table’s ID column now passes snapshot.ID directly instead of TruncateID(snapshot.ID). Quiet mode (-q) was already printing full IDs and is unchanged.

Reviewed by Cursor Bugbot for commit 6edb87a. 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
}
table.AddRow(
TruncateID(snapshot.ID),
snapshot.ID,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ID column still ellipsized

Medium Severity

The list table now passes the full snapshot.ID, but TruncOrder still treats column 0 as the first column to shrink when the table is wider than the terminal. Render can then ellipsize the ID to a few characters, so copy-paste from the table may still fail for snapshot get / restore on typical narrow widths.

Fix in Cursor Fix in Web

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

@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

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