Skip to content

[M8.2b] CLI: deploy, rollback and server removal - #194

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m8.2b-cli-deploy
Nov 7, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m8.2b-cli-deploy

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

What changed

  • deploy: validates shipkeep.yml locally, creates the application or saves its configuration with the expected hash, queues a deployment and follows it. It exits non-zero unless the deployment succeeded. Stopping to follow never stops the deployment, and the message says so.
  • rollback: returns to the newest good deployment of another release than the one serving, or to --to ID.
  • server remove ID --confirm NAME: gets a confirmation token for the exact name, then spends it.

Why

PLAN M8.2b.

How it was tested

cli.integration.spec.ts builds the real binary and runs it against the real API and database (local PostgreSQL 18.4), with a real scoped token and an environment holding only PATH, HOME and XDG_CONFIG_HOME:

  • Login refuses a bad token and accepts a good one from standard input.
  • Create, update, refusal while a deployment runs, and an invalid file refused before any request.
  • Rollback, with the new deployment's trigger recorded as rollback.
  • Secret set, list and unset, with the value appearing in no output.
  • Server removal refuses a wrong name (confirmation_name_mismatch), then succeeds.
  • Audit events record the token as the actor, and another organization is refused.

Unit tests add malicious input: IDs from the server or flags that would change the URL, hostile files, terminal escapes in a failure reason, and rollback cases with nothing to return to.

Not covered: following a deployment to completion against a real worker. Following is unit-tested against a stub, because the integration fixture runs no worker, so deployments there are finished by SQL. Nothing has run on a real server.

Security considerations

  • --confirm has no default and the server checks the name (rule 7). The confirmation token is never printed.
  • IDs that come back from the server are checked before they are used in a URL.
  • go-cli.ts spawns with a fixed argv and no shell; it is test tooling, and secrets go through standard input.

Checklist

  • Tests, including malicious input
  • No new shell invocation in production code, no new secret exposure path
  • Audit events verified for token-driven commands
  • PLAN updated

@samuelmbabhazi
samuelmbabhazi merged commit f0b78cb into main Nov 7, 2026
@samuelmbabhazi
samuelmbabhazi deleted the feat/m8.2b-cli-deploy branch November 7, 2026 13:04
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