feat(tpagectl): implement deployment get subcommand #567

Merged
fuzzy merged 2 commits from feat/cli-deployment-get into main 2026-08-06 04:49:27 +00:00
Owner

What

Implements deployment get end to end: the daemon's missing GET /api/v1/sites/{name}/deployments/{version} endpoint plus the tpagectl deployment get subcommand.

Daemon

  • SiteService.Deployment(ctx, siteName, version) returns a specific deployment, ErrNotFound when the site or deployment is missing.
  • GET /api/v1/sites/{name}/deployments/{version} handler: owner-scoped (403), 404, 200 with the Deployment.
  • Tests: service (found / unknown site / unknown version), handler 200/404.

CLI

  • Flags (#201): --site plus exactly one of --version or --latest; --latest resolves the newest deployment via the list endpoint.
  • GET (#202): /api/v1/sites/{name}/deployments/{version} decoded into a deploymentRecord.
  • Display (#203): details block — site, version, commit SHA, status, deployed at.
  • Friendly 404s (deployment "vX" for site "Y" not found, site "X" not found); missing site/version and --version+--latest conflict errors.
  • Tests: --site+--version, --latest resolution (verifies list → per-version calls), 404, missing site, missing version, conflict.

Why

Phase 3 roadmap task #204.

Testing

  • Daemon: service Deployment tests (found/unknown site/unknown version), handler 200/404 tests
  • CLI: version happy path, --latest resolution, deployment 404, site 404, missing site/version, version∧latest conflict
  • go test -race ./... passes (18 packages)
  • golangci-lint run clean
  • pre-commit hooks pass (gofmt, go mod tidy, go test)

Breaking Changes

None. SiteService gains Deployment (already implemented by the concrete type).

Notes

#203 asks to display "assets, logs, metadata"; these are not yet part of the daemon Deployment model (which carries site, version, commit SHA, status, deployed at), so the CLI displays all modeled fields and that gap is noted in the roadmap. The remaining deployment subcommands (promote, rollback) are still stubs tracked by their own issues.

Closes #201
Closes #202
Closes #203
Closes #204

## What Implements `deployment get` end to end: the daemon's missing `GET /api/v1/sites/{name}/deployments/{version}` endpoint plus the tpagectl `deployment get` subcommand. **Daemon** - `SiteService.Deployment(ctx, siteName, version)` returns a specific deployment, `ErrNotFound` when the site or deployment is missing. - `GET /api/v1/sites/{name}/deployments/{version}` handler: owner-scoped (403), 404, 200 with the `Deployment`. - Tests: service (found / unknown site / unknown version), handler 200/404. **CLI** - **Flags** (#201): `--site` plus exactly one of `--version` or `--latest`; `--latest` resolves the newest deployment via the list endpoint. - **GET** (#202): `/api/v1/sites/{name}/deployments/{version}` decoded into a `deploymentRecord`. - **Display** (#203): details block — site, version, commit SHA, status, deployed at. - Friendly 404s (`deployment "vX" for site "Y" not found`, `site "X" not found`); missing site/version and `--version`+`--latest` conflict errors. - Tests: `--site`+`--version`, `--latest` resolution (verifies list → per-version calls), 404, missing site, missing version, conflict. ## Why Phase 3 roadmap task #204. ## Testing - [x] Daemon: service Deployment tests (found/unknown site/unknown version), handler 200/404 tests - [x] CLI: version happy path, `--latest` resolution, deployment 404, site 404, missing site/version, version∧latest conflict - [x] `go test -race ./...` passes (18 packages) - [x] `golangci-lint run` clean - [x] pre-commit hooks pass (gofmt, go mod tidy, go test) ## Breaking Changes None. `SiteService` gains `Deployment` (already implemented by the concrete type). ## Notes #203 asks to display "assets, logs, metadata"; these are **not yet part of the daemon `Deployment` model** (which carries site, version, commit SHA, status, deployed at), so the CLI displays all modeled fields and that gap is noted in the roadmap. The remaining deployment subcommands (`promote`, `rollback`) are still stubs tracked by their own issues. Closes #201 Closes #202 Closes #203 Closes #204
Add the daemon GET /api/v1/sites/{name}/deployments/{version} endpoint and
the tpagectl deployment get subcommand.

Daemon: SiteService.Deployment returns a specific deployment, 404 when the
site or deployment is missing. The handler is owner-scoped and returns 200
with the deployment.

CLI: deployment get takes --site plus exactly one of --version/--latest,
resolves --latest from the list endpoint, fetches the deployment, and
prints a details block (site, version, commit, status, deployed at).
docs(roadmap): mark deployment get subcommand complete
All checks were successful
Test and Release / lint (pull_request) Successful in 4m32s
Test and Release / test (pull_request) Successful in 23m51s
d25d1e2f7f
Record completion of the tpagectl deployment get subcommand and its
daemon endpoint: --site with --version or --latest, GET
/api/v1/sites/{name}/deployments/{version}, and full detail display of the
fields the daemon models (assets, logs, and metadata are not yet part of
the Deployment model).

closes #201
closes #202
closes #203
closes #204
fuzzy merged commit d25d1e2f7f into main 2026-08-06 04:49:27 +00:00
fuzzy deleted branch feat/cli-deployment-get 2026-08-06 04:49:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!567
No description provided.