Skip to content

feat(cli): list a deployment's attempts - #615

Draft
PiquelChips wants to merge 1 commit into
fix/newest-deployment-not-first-rowfrom
feat/cli-deployment-attempts
Draft

PiquelChips wants to merge 1 commit into
fix/newest-deployment-not-first-rowfrom
feat/cli-deployment-attempts

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

What and why

Fixes PQD-159

The dashboard's Attempts tab lists each time piqueld tried to roll a deployment out. The CLI had no way to do the same, though the API and Client::deployment_attempts already existed. PQD-125's audit found the gap.

This adds piquelctl env attempts and piquelctl preview attempts. They show what the dashboard shows: each attempt's number, state, failure (code: message) and when it last changed. Output is a human table or --json, which is the API's page of operations.

$ piquelctl env attempts hello production
Deployment: <id>
Attempt  State    Outcome                                        Updated
3        running                                                 …
2        failed   runtime_failed: runtime reconciliation failed  …
Next cursor: older

Like env wait, they list the latest deployment's attempts unless you pass --deployment ID. The latest deployment is #616's latest_deployment: the environment's latest operation, not the deployment list's first row (PQD-149). Its operation is also the running attempt that leads the first page. --cursor pages the deployment that --deployment names. As on the dashboard, the first page starts with the attempt running now, until the API retains its outcome. An unknown deployment fails with invalid_input: deployment "…" of production was not found. The API is unchanged.

Two rules move from the dashboard onto piqueld_core::Operation so both surfaces share them: attempts (the running attempt goes first) and failure (how an attempt's failure reads). The new command and find_deployment share the 404 mapping.

I updated the user docs (reference/cli.md and operations/history.md) and regenerated reference/cli-commands.md.

Stacked on #616 (fix/newest-deployment-not-first-row).

Proved by a fake-server CLI test that covers the human table, --json with and without --deployment, a second page and an unknown deployment. In that test the deployment list's first row is an older deployment with a higher ID, and the command still lists the newer one's attempts. Core tests cover Operation::attempts and Operation::failure. Clippy passes natively and for the dashboard on wasm32, and just docs passes. The dev instance couldn't run: the host Docker engine kept a stale container name. cargo test -p piquelctl passes apart from auth::tests::concurrent_credential_updates_preserve_every_login, which fails under this load on main too.

Checklist

  • The feature reaches each surface in AGENTS.md it applies to,
    documentation included, with its reverse states.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips force-pushed the feat/cli-deployment-attempts branch from dc819aa to f2629b0 Compare November 22, 2026 12:32
@PiquelChips
PiquelChips changed the base branch from main to fix/newest-deployment-not-first-row November 22, 2026 12:32
@PiquelChips
PiquelChips force-pushed the fix/newest-deployment-not-first-row branch from 04e6103 to 49387a0 Compare November 22, 2026 22:12
`piquelctl env attempts` and `preview attempts` list each try at rolling
a deployment out, newest first, as the dashboard's Attempts tab does:
the attempt number, state, failure and when it last changed, as a table
or `--json`. They default to the latest deployment, like `env wait`, and
take `--deployment` and `--cursor` for older pages.

The rule that the running attempt leads the list, and how an attempt's
failure reads, move from the dashboard onto `piqueld_core::Operation`,
so both surfaces share them.

Fixes PQD-159
@PiquelChips
PiquelChips force-pushed the feat/cli-deployment-attempts branch from f2629b0 to ed57f3f Compare November 22, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant