feat(tpagectl): implement preview command group #572

Merged
fuzzy merged 3 commits from feat/cli-preview into main 2026-08-06 10:59:59 +00:00
Owner

What

Adds the preview command group to tpagectl, starting Phase 4 preview management.

  • New internal/tpagectl/preview package with a preview parent command registering four subcommands: list, deploy, delete, and get.
  • Each subcommand renders full --help/usage documentation describing its intended flags (e.g. list takes a site name with --format; deploy uses --site + --branch and waits for readiness; delete uses --site + --branch or --all with confirmation/--force; get uses --site + --branch).
  • Subcommand actions return a clear not implemented yet error; real logic lands with their own roadmap issues (#221, #226, #231, #235).
  • Root command registers the preview group alongside site and deployment.

Why

Phase 4 roadmap task #216. Establishes the preview command scaffolding so subcommand implementation issues land as focused PRs with clean diffs (one file per subcommand).

Testing

  • Unit tests: parent has the 4 expected subcommands; each has non-empty usage/description; stub invocation returns errNotImplemented
  • Wiring tests: root help lists preview; preview --help lists all subcommands; individual subcommand help renders
  • go test -race ./... passes (19 packages)
  • golangci-lint run clean
  • pre-commit hooks pass (gofmt, go mod tidy, go test)

Breaking Changes

None.

Notes

Mirrors the site and deployment command group scaffold pattern. Subcommand stubs do not consume the HTTP client yet — each will when its own issue implements it.

Closes #215
Closes #216

## What Adds the `preview` command group to tpagectl, starting Phase 4 preview management. - New `internal/tpagectl/preview` package with a `preview` parent command registering four subcommands: `list`, `deploy`, `delete`, and `get`. - Each subcommand renders full `--help`/usage documentation describing its intended flags (e.g. `list` takes a site name with `--format`; `deploy` uses `--site` + `--branch` and waits for readiness; `delete` uses `--site` + `--branch` or `--all` with confirmation/`--force`; `get` uses `--site` + `--branch`). - Subcommand actions return a clear `not implemented yet` error; real logic lands with their own roadmap issues (#221, #226, #231, #235). - Root command registers the `preview` group alongside `site` and `deployment`. ## Why Phase 4 roadmap task #216. Establishes the preview command scaffolding so subcommand implementation issues land as focused PRs with clean diffs (one file per subcommand). ## Testing - [x] Unit tests: parent has the 4 expected subcommands; each has non-empty usage/description; stub invocation returns `errNotImplemented` - [x] Wiring tests: root help lists `preview`; `preview --help` lists all subcommands; individual subcommand help renders - [x] `go test -race ./...` passes (19 packages) - [x] `golangci-lint run` clean - [x] pre-commit hooks pass (gofmt, go mod tidy, go test) ## Breaking Changes None. ## Notes Mirrors the site and deployment command group scaffold pattern. Subcommand stubs do not consume the HTTP client yet — each will when its own issue implements it. Closes #215 Closes #216
Add the tpagectl preview command group with list, deploy, delete, and get
subcommands. Each subcommand renders help documenting its intended flags
and returns a not-implemented error until its own roadmap issue lands.
Wire the preview command group into the tpagectl root command and cover
root, group, and subcommand help rendering with tests.
docs(roadmap): mark preview command group complete
All checks were successful
Test and Release / lint (pull_request) Successful in 25s
Test and Release / test (pull_request) Successful in 25s
e79b4fd149
Record completion of the tpagectl preview command group scaffold.

closes #215
closes #216
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-08-06 10:56:32 +00:00
the.auditor left a comment

Summary

Preview command group scaffolding for tpagectl. Verified: go test -race ./... passes (19 packages, including new internal/tpagectl/preview) and golangci-lint run ./... is clean. Closes #215-216.

No blocking issues.

Suggestions (filed as issues)

  1. internal/tpagectl/preview/list.go, deploy.go, delete.go, get.go – help text references flags/behaviors not yet wired (--format, --site/--branch + readiness wait, --all/--force, --site/--branch); users invoking them get "flag provided but not defined". Consider placeholder flags or softened descriptions until #221/#226/#231/#235 land. Filed as #574

Praise

  • Consistent one-file-per-subcommand layout mirroring the site and deployment groups
  • Sentinel errNotImplemented with errors.Is is the right stub pattern
  • Meaningful tests: subcommand presence, help rendering, stub error propagation
  • previews alias and clean root-command wiring
## Summary Preview command group scaffolding for tpagectl. Verified: `go test -race ./...` passes (19 packages, including new `internal/tpagectl/preview`) and `golangci-lint run ./...` is clean. Closes #215-216. No blocking issues. ## Suggestions (filed as issues) 1. `internal/tpagectl/preview/list.go`, `deploy.go`, `delete.go`, `get.go` – help text references flags/behaviors not yet wired (`--format`, `--site/--branch` + readiness wait, `--all`/`--force`, `--site/--branch`); users invoking them get "flag provided but not defined". Consider placeholder flags or softened descriptions until #221/#226/#231/#235 land. Filed as #574 ## Praise - Consistent one-file-per-subcommand layout mirroring the site and deployment groups - Sentinel `errNotImplemented` with `errors.Is` is the right stub pattern - Meaningful tests: subcommand presence, help rendering, stub error propagation - `previews` alias and clean root-command wiring
fuzzy merged commit e79b4fd149 into main 2026-08-06 10:59:59 +00:00
fuzzy deleted branch feat/cli-preview 2026-08-06 10:59:59 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd!572
No description provided.