feat(tpagectl): implement version command #581
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd!581
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/cli-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implements the
versioncommand, the second Phase 5 operational command.internal/tpagectl/versionpackage with a top-levelversioncommand registered on the root (coexisting with the existing--versionflag).-ldflags—NewCommand(version, commit, date string)takes the metadata from main (where the build vars live), with output matching the--versionflag format (tpagectl version <v>/commit: <c>/built: <d>).version;version --helprenders; end-to-end output contains version/commit/built.Why
Phase 5 roadmap task #242.
Testing
versionpackage output test (injected version/commit/date)version,version --helprenders,versionoutputgo test -race ./...passes (21 packages)golangci-lint runcleanBreaking Changes
None.
Notes
#241 (optionally check the latest available version on the server) is deferred — the daemon exposes no version endpoint (
/healthz//readyzonly return status). It remains unchecked in CLI-ROADMAP.md.Closes #240
Closes #242
Summary
versioncommand for tpagectl, second Phase 5 operational command. Verified:go test -race ./...passes (21 packages, including newinternal/tpagectl/version) andgolangci-lint run ./...is clean. Closes #240/#242; #241 (server version check) honestly deferred and left unchecked.Verified: output format matches the
--versionflag'sVersionPrinterexactly; the import aliastpagectlversioncorrectly avoids theversionvariable collision inmain.go;NewCommand(version, commit, date)cleanly receives build metadata.No blocking issues.
Suggestions (filed as issues)
cmd/tpagectl/main.go+internal/tpagectl/version/version.go–tpagectl versionruns the rootBeforehook, which loads config and builds the HTTP client; an invalid--serverURL or broken config would makeversionfail even though it never talks to the daemon. Filed as #582Minor Note (no issue)
--versionVersionPrinterformat (threeFprintflines); a shared helper would remove the duplication (extends the #565 DRY theme).Praise
--versionflagversionbuild var collision--help, and end-to-end output