feat(tpagectl): implement site get subcommand #553

Merged
fuzzy merged 2 commits from feat/cli-site-get into main 2026-08-05 14:06:43 +00:00
Owner

What

Implements the site get subcommand.

  • Positional arg (#188): required SITE name.
  • GET (#178): fetches /api/v1/sites/{name} (the daemon status endpoint) and decodes the SiteStatus payload.
  • Full config (#179): block showing owner, visibility, custom domain, URL, repo, preview status, and creation time.
  • Current deployment (#180): version, commit SHA, status, and deployed-at timestamp (or Deployment: none).
  • Not found (#178): 404 maps to a friendly site "X" not found error.
  • Renamed the shared listResponse/listDeployment types to siteResponse/siteDeployment so both list and get decode the same SiteStatus shape (no duplication).

Why

Phase 2 roadmap task #182.

Testing

  • httptest: full config output (site + deployment fields), no-deployment notice, 404 → friendly message, missing positional arg error
  • go test -race ./... passes (17 packages)
  • golangci-lint run clean
  • pre-commit hooks pass (gofmt, go mod tidy, go test)

Breaking Changes

None.

Notes

#181 (show preview deployments) is deferred to Phase 4 — the daemon has no previews listing API yet (planned as GET /api/v1/sites/{name}/previews in #218). It remains unchecked in CLI-ROADMAP.md.

Closes #178
Closes #179
Closes #180
Closes #182
Closes #188

## What Implements the `site get` subcommand. - **Positional arg** (#188): required `SITE` name. - **GET** (#178): fetches `/api/v1/sites/{name}` (the daemon status endpoint) and decodes the `SiteStatus` payload. - **Full config** (#179): block showing owner, visibility, custom domain, URL, repo, preview status, and creation time. - **Current deployment** (#180): version, commit SHA, status, and deployed-at timestamp (or `Deployment: none`). - **Not found** (#178): 404 maps to a friendly `site "X" not found` error. - Renamed the shared `listResponse`/`listDeployment` types to `siteResponse`/`siteDeployment` so both `list` and `get` decode the same `SiteStatus` shape (no duplication). ## Why Phase 2 roadmap task #182. ## Testing - [x] httptest: full config output (site + deployment fields), no-deployment notice, 404 → friendly message, missing positional arg error - [x] `go test -race ./...` passes (17 packages) - [x] `golangci-lint run` clean - [x] pre-commit hooks pass (gofmt, go mod tidy, go test) ## Breaking Changes None. ## Notes **#181 (show preview deployments) is deferred** to Phase 4 — the daemon has no previews listing API yet (planned as `GET /api/v1/sites/{name}/previews` in #218). It remains unchecked in CLI-ROADMAP.md. Closes #178 Closes #179 Closes #180 Closes #182 Closes #188
Add site get: a required positional site name, GET /api/v1/sites/{name},
and a full configuration block showing owner, visibility, domain, URL,
repo, preview status, creation time, and current deployment (version,
commit, status, deployed at). Missing sites surface a friendly
not-found error.

Rename the shared listResponse/listDeployment types to siteResponse/
siteDeployment so both list and get decode the daemon SiteStatus payload.
docs(roadmap): mark site get subcommand complete
All checks were successful
Test and Release / lint (pull_request) Successful in 4m42s
Test and Release / test (pull_request) Successful in 23m47s
6dc5c3ee88
Record completion of the tpagectl site get subcommand: positional site
name, GET /api/v1/sites/{name}, full configuration display, and current
deployment information. Preview deployment display (#181) is deferred to
the Phase 4 preview commands.

closes #178
closes #179
closes #180
closes #182
closes #188
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-08-05 13:48:49 +00:00
the.auditor left a comment

Summary

site get subcommand for tpagectl. Verified: go test -race ./... passes (17 packages) and golangci-lint run ./... is clean. Closes #178/#179/#180/#182/#188; #181 (preview deployments) correctly deferred and left unchecked since the daemon has no previews API yet.

Verified payload parity: siteResponse mirrors the daemon's SiteStatus (Site fields + url + current_deployment), matching the status endpoint output.

No blocking issues.

Suggestions (filed as issues)

  1. internal/tpagectl/site/get.go – only the 404 path is tested; non-404 error passthrough (500, 403 owner-scoped) is untested. Filed as #554

Praise

  • Clean shared-type refactor: listResponsesiteResponse reused by both list and get, no duplication
  • Output block style consistent with site create
  • Missing-arg check runs before the client fetch; friendly 404 message matches daemon ErrNotFound semantics
  • Honest deferral of #181 with justification
## Summary `site get` subcommand for tpagectl. Verified: `go test -race ./...` passes (17 packages) and `golangci-lint run ./...` is clean. Closes #178/#179/#180/#182/#188; #181 (preview deployments) correctly deferred and left unchecked since the daemon has no previews API yet. Verified payload parity: `siteResponse` mirrors the daemon's `SiteStatus` (Site fields + `url` + `current_deployment`), matching the status endpoint output. No blocking issues. ## Suggestions (filed as issues) 1. `internal/tpagectl/site/get.go` – only the 404 path is tested; non-404 error passthrough (500, 403 owner-scoped) is untested. Filed as #554 ## Praise - Clean shared-type refactor: `listResponse`→`siteResponse` reused by both list and get, no duplication - Output block style consistent with `site create` - Missing-arg check runs before the client fetch; friendly 404 message matches daemon `ErrNotFound` semantics - Honest deferral of #181 with justification
fuzzy merged commit 6dc5c3ee88 into main 2026-08-05 14:06:43 +00:00
fuzzy deleted branch feat/cli-site-get 2026-08-05 14:06:44 +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!553
No description provided.