Skip to content

feat(proposals): evolution auto-rollback CLI + webui (F3)#1620

Merged
nextlevelshit merged 1 commit into
mainfrom
feat/proposals-rollback
Apr 30, 2026
Merged

feat(proposals): evolution auto-rollback CLI + webui (F3)#1620
nextlevelshit merged 1 commit into
mainfrom
feat/proposals-rollback

Conversation

@nextlevelshit
Copy link
Copy Markdown
Collaborator

Closes the F3 follow-up from epic #1565.

What

  • CLI: wave proposals rollback <pipeline_name>
  • Webui: POST /pipelines/{pipelineName}/rollback

Both flip the active pipeline_version to the highest version below the currently-active one, using the existing state.ActivateVersion atomic flip. Emergency lever for an approved evolution that misbehaves in production.

Design

  • internal/proposals/rollback.goPriorVersion(store, name) returns (prior, current, err). Sentinels: ErrNoActiveVersion, ErrNoPriorVersion.
  • Gap-aware: if the active is v5 and prior committed is v1 (gap), rollback targets v1, not v4.
  • No schema change; reuses existing pipeline_version table.
  • Route under /pipelines/{name}/rollback to avoid net/http mux conflict with /proposals/{id}/{approve,reject} wildcards.

Tests

  • internal/proposals/rollback_test.go — 4 cases: prior-found, gap-aware, no-active, no-prior.
  • internal/webui/handlers_proposals_test.go — 3 cases: 200 flip, 404 no-active, 409 no-prior.

Lint

nix run nixpkgs#golangci-lint -- run ./internal/proposals/... ./internal/webui/... ./cmd/wave/commands/...0 issues.

Part of epic #1565.

`wave proposals rollback <pipeline_name>` and POST
/pipelines/{pipelineName}/rollback flip the active pipeline_version
to the highest version below the active one. Reuses the existing
state.ActivateVersion atomic flip — no schema changes.

- `internal/proposals/rollback.go` PriorVersion helper + sentinels
  (ErrNoActiveVersion, ErrNoPriorVersion).
- CLI subcommand under existing `wave proposals` group.
- Webui handler returns JSON {pipeline_name, rolled_back_from,
  now_active, yaml_path, decided_by}; 404 no-active, 409 no-prior.
- Route under /pipelines/{name}/rollback to avoid mux conflict with
  the existing /proposals/{id}/{approve,reject} wildcards.
- Tests cover prior-found, gap-aware rollback, no-active, no-prior.

Part of epic #1565 follow-ups.
@nextlevelshit nextlevelshit merged commit a148614 into main Apr 30, 2026
10 checks passed
@nextlevelshit nextlevelshit deleted the feat/proposals-rollback branch April 30, 2026 11:07
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