You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the end-to-end rollback path for Deployments that have started, succeeded, or failed. Operators should be able to record rollback as an explicit recovery action with required context, terminal state behavior, current-state updates, and append-only event history.
Acceptance criteria
POST /deployments/{id}/rollback rolls back Deployments in started status.
POST /deployments/{id}/rollback rolls back Deployments in succeeded status.
POST /deployments/{id}/rollback rolls back Deployments in failed status.
Rollback requests require an explicit actor because authentication is out of scope.
Rollback requires a non-empty note.
Rollback records rolled_back_at and updates current status to rolled_back.
Rollback attempts for pending_approval, approved, rejected, or already rolled_back Deployments return conflict errors distinct from validation errors.
rolled_back is terminal and cannot be mutated by later review, start, completion, or rollback actions.
The rollback action appends exactly one deployment_rolled_back event and updates current Deployment state in one SQLite transaction.
GET /deployments/{id} and GET /deployments/{id}/events reflect rollback state and event history oldest first.
Tests cover rollback from started/succeeded/failed, terminal-state behavior, required rollback notes, SQLite transaction behavior, HTTP success/conflict responses, event ordering, and make test passes.
Parent
Related to #2
What to build
Add the end-to-end rollback path for Deployments that have started, succeeded, or failed. Operators should be able to record rollback as an explicit recovery action with required context, terminal state behavior, current-state updates, and append-only event history.
Acceptance criteria
Blocked by