You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.5 KiB

+++ title = "Add backlog status to tickets" priority = 5 status = "done" ticket_type = "feature" dependencies = [] +++

Goal

Add a backlog status variant so tickets can be created without immediately surfacing in the active work queue. Tickets in backlog are created but intentionally deferred; they should not appear in nbd list, nbd ready, or nbd next by default.

Semantics

  • backlog = created, but not yet ready to be worked on (intentionally deferred)
  • Default status for new tickets remains todo
  • backlog tickets are excluded from nbd list (same as done and closed)
  • backlog tickets are excluded from nbd ready and nbd next
  • backlog tickets do not count as resolved for dependency purposes (unlike done and closed) — a dependency on a backlog ticket still blocks
  • backlog tickets are visible with --all, --filter status=backlog, or --filter status=*

Files to change

src/ticket.rs

Add Backlog variant to the Status enum:

pub enum Status {
    #[default]
    Todo,
    InProgress,
    Done,
    Closed,
    Backlog,  // new
}

Serialises as "backlog".

src/main.rs

  • parse_status: add "backlog" => Ok(Status::Backlog) arm and update the error message
  • cmd_list: exclude Status::Backlog in the default (no --all, no status= filter) case, alongside Done and Closed
  • cmd_ready: exclude Status::Backlog from the ready set (a backlog ticket is never ready)
  • cmd_next: same exclusion as cmd_ready

src/display.rs

  • status_str: add Status::Backlog => "backlog" arm

src/graph.rs

  • status_str (internal helper, duplicated): add Status::Backlog => "backlog" arm

README.md

  • Update the Status table to include backlog
  • Update nbd list usage examples to mention that backlog is also hidden by default

CLAUDE.md

  • Update CLI Interface block to show backlog as a valid status value

src/tests.rs

  • Add unit test: a ticket with Status::Backlog is excluded from the ready list and is visible under --all

tests/integration.rs

  • Add integration test: create a ticket with --status backlog, confirm it does not appear in plain nbd list or nbd ready, and does appear in nbd list --all

Validation

cargo fmt && cargo check && cargo clippy && cargo test
cargo run -- create --title "Backlog item" --status backlog --json
cargo run -- list --json           # should NOT appear
cargo run -- list --all --json     # should appear
cargo run -- ready --json          # should NOT appear