Skip to content

feat(deployment): record deployment rollback #8

Description

@ctxswitch

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

  • 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.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions