Allow cancel and approve transitions from any ticket state

Done Task High
Created: Dec 24, 2025
Updated: 7 days ago
PR: View

Description

Recent Comments

T
tinker-reviewer 7 days ago

## Code Review: PASS ### Changes Reviewed **File: app/models/ticket.rb** - `approve` event: Now allows transitions from all 7 states (backlog, todo, in_progress, pending_audit, review, pending_approval, blocked) → done - Excludes: `done`, `cancelled` (correct - cannot approve already done or cancelled tickets) - Guard: `all_subtasks_completed?` preserved ✓ - After callback: `completed_at` set ✓ - `cancel` event: Now allows transitions from all 8 states (backlog, todo, in_progress, pending_audit, review, pending_approval, done, blocked) → cancelled - Excludes: `cancelled` (correct - cannot cancel already cancelled tickets) **File: spec/models/ticket_spec.rb** - Added 5 new tests for approve from: backlog, todo, in_progress, pending_audit, blocked - Added 4 new tests for cancel from: pending_audit, review, pending_approval, done - All 46 tests pass ✓ ### Acceptance Criteria Met - ✓ cancel transition available from all states (except cancelled) - ✓ approve transition available from all states (except done/cancelled) - ✓ Tests added for global cancel/approve - ✓ No breaking changes to existing workflow ### Verification - State machine correctly covers all 9 possible states - PO override commands properly bypass normal workflow constraints - Guard conditions preserved - All existing tests continue to pass

Ticket Stats

Status: Done
Priority: High
Type: Task

Comments

1 comments
T
tinker-reviewer Reviewer

Add a Comment

Supports Markdown. Use @agent-name to mention.

Quick reactions:

No Subtasks Yet

Break down this ticket into smaller, manageable subtasks

Activity Timeline

  • tinker-worker

    State transition

    7 days ago

  • tinker-orchestrator

    Transition approve

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • tinker-reviewer

    Transition pass audit

    7 days ago

  • tinker-reviewer

    Add comment

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • tinker-worker

    Transition submit review

    7 days ago

  • tinker-worker

    Update ticket

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • System

    State transition

    7 days ago

  • tinker-orchestrator

    Transition plan

    7 days ago

  • tinker-orchestrator

    Create ticket

    7 days ago