Skip to content

feat: brainpod rollback - #26

Merged
jeroenrinzema merged 1 commit into
mainfrom
feat/rollback
Nov 25, 2026
Merged

jeroenrinzema merged 1 commit into
mainfrom
feat/rollback

Conversation

@jeroenrinzema

Copy link
Copy Markdown
Collaborator

Summary

Adds brainpod rollback, wrapping POST /v1/pods/{pod}/rollback/{revision}. The API has had it for a while; the CLI and the agent skill still told users there was no rollback.

 brainpod --pod <pod> deploy [--summary <text>] [--wait] [--timeout <seconds>]
 brainpod --pod <pod> redeploy
+brainpod --pod <pod> rollback <revision> [--deploy [--wait] [--timeout <seconds>]]
rollback <revision>
  POST rollback/<revision>            # copies the revision into a new draft head
  --deploy  → ?deploy=true            # deploys it in the same request
    --wait  → wait_for_revision       # same health wait as deploy --wait
  • --wait requires --deploy; --timeout requires --wait (default 90s, as deploy).
  • describe rollback marks the effect conditional-deployment and states that the current undeployed draft is replaced. nextSteps points at revision diff <draft> --base <deployed>, because the new draft's parent is the restored revision, so a bare revision diff would be empty.
  • Corrects redeploy's help and describe text: the API retries the pod's current failed head; it never redeploys the live revision. The old wording pushed agents towards redeploy as a restart or rollback.
  • deploy and rollback --wait share one deployment_revision helper.

Evidence

  • cargo test: 238 passed, including rejects_rollback_wait_without_deploy and parses_rollback_deploy_and_wait.
  • cargo clippy --all-targets: no new warnings.
  • Live wiring, against a pod that does not exist (no state changed):
    $ brainpod --json --pod nonexistent-pod-zz9 rollback 00000000-0000-4000-8000-000000000000
    {"error":{"code":"NOT_FOUND","httpStatus":404,"message":"pod not found",...}}
    
  • brainpod describe rollback --json returns the effect, requirements (apiToken, pod), next steps and examples.

Merge Danger

Door: two-way. It adds a command and changes help text only.

Blast Radius: small. Agents that read describe redeploy get the corrected effect text.

Wrap POST /v1/pods/{pod}/rollback/{revision}: restore an earlier revision as the draft head, or deploy it with --deploy [--wait]. Correct redeploy's description: the API retries the current failed head, it does not redeploy the live revision.
@jeroenrinzema
jeroenrinzema added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 46227ea Nov 25, 2026
6 checks passed
jeroenrinzema added a commit to brainpodnl/skills that referenced this pull request Nov 25, 2026
- Code reaches a pod through GitHub: BrainPod onboarding shapes and builds the pod; the agent gets the code there, answers onboarding's questions with the user, and fixes code through pull requests the user merges.
- Replace deploy.md with onboard.md; add local-build.md as the discouraged fallback; rework operate.md (PR-based code changes, services, secrets, rollback) and debug.md (builds, OIDC, tunnels).
- Cut SKILL.md from 635 to ~320 lines; gate on `brainpod api` and `brainpod rollback` (brainpodnl/cli#26, #27).
- Bump all three manifests to 2.0.0; update README and AGENTS.md.
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.

2 participants