feat(tpagectl): add progress feedback and colored output #602
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!602
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tpagectl-progress-feedback"
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 Phase 7 progress feedback (roadmap #269) using the org's own
thwap/konsoruANSI library (added as the only new dependency).internal/tpagectl/uiwrapper — terminal-aware rendering over konsoru: coloredSuccess/Warning/Errortext, an animated spinner (StartSpinner/Stop), and a progress bar (NewProgressBar/Inc/Finish). Color and animation activate only when the destination is a terminal andNO_COLORis unset; redirected/piped output stays plain (existing output assertions unchanged).--insecureand keychain-unavailable warnings yellow, and success confirmations green acrosssite create/delete/update,deployment promote/rollback,preview deploy/delete,token set/clear,login, plusstatushealth/ready values (ok/readygreen,unhealthy/not readyred).preview deploywait loop,logindevice-flow wait, anddeployment promote(also closes #207).preview delete --alldelete loop.Why
Roadmap task #269; also clears the Phase-3 leftover #207.
Testing
uiunit tests: non-terminal → no color, no spinner, no bar output; colorize on when enabled;NO_COLORhonored; spinner writes cursor hide/show + frames; bar renders +done; zero-total bar is a no-opSite registered:,Deleted 2 preview(s)…,Health: ok, etc.)go test -race ./...passes (27 packages)golangci-lint runcleanBreaking Changes
None. Colored/rendered output only appears on an interactive terminal; exit codes and messages are unchanged.
Notes
git.lan.thwap.org/thwap/konsoru v1.0.1added to go.mod and vendored (requiresgolang.org/x/term, already vendored at a newer version; MVS keeps v0.44.0).Closes #207
Closes #266
Closes #267
Closes #268
Closes #269
Clean, well-scoped addition. The
uiwrapper degrades correctly to plain output for non-terminals (all existing message-assertion tests unchanged), terminal/NO_COLORdetection is spec-compliant, spinner/progress-bar goroutines are properly synchronized (Stopdrainsdonebefore callers write), and the konsoru dependency is vendored cleanly (BSD-3 license,golang.org/x/termalready present at v0.44.0 with no version bump). Approving; one low-priority formatting finding filed.Suggestions
cmd/tpagectl/main.go:44– The red coloring splitsclierr.Render(err)at the first newline, assuming one error line + one hint line. When a friendly status embeds a multi-line response body (5xx/401 detail), the split cuts mid-error and thehint:line gets folded into the tail — styling and hint separation are mangled (all text still prints). Split on thehint:marker instead. Filed as #603.Questions
--verboseon a terminal, zap log lines can interleave with spinner frames duringwaitForPreviewpolling (spinner writes\r-based frames while the logger writes independently). Cosmetic, but worth confirming it's acceptable as-is.ui.Newre-probes the terminal on every call — trivial for a CLI, no action needed.Praise
NO_COLORhandling are correct.deployment promotefinally clears #207 via the spinner path without changing non-animated behavior.