feat: add issue delete, pin, and unpin (task 0006) #7
Reference in New Issue
Block a user
Delete Branch "task-0006-issue-delete-pin-unpin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0006-issue-delete-pin-unpin.mdSummary
Adds the remaining simple issue mutations:
issue delete <n>— hard-deletes via the DELETE endpoint. Deliberately not idempotent: a nonexistent issue yieldsISSUE_NOT_FOUND(exit 1) rather than reporting a deletion that never happened (ADR 0010). Output:issue: { number, status: "deleted" }.issue pin <n>/issue unpin <n>— read the current pin state and short-circuit to an idempotent no-op (Already pinned/Already unpinned, exit 0) when there is nothing to do. Output:issue: { number, state, pinned }.Pin state is derived from Gitea's
pin_orderfield (positive = pinned) via a smallisPinnedhelper — Gitea has no booleanpinnedflag on the issue struct.issue lock/unlock,transfer, andsubissueremain excluded per the spec.Fixture-server tests cover delete success, delete-missing refusal, and both pin/unpin no-ops (plus the happy paths and
--help). Full unit suite: 197 passing.Deviations
issue deleteruns no confirmation prompt. This is an agent-facing CLI with structured TOON output where interactive prompts don't fit, and the spec specifies a hard, non-idempotent delete without one. Left unguarded by design.issuePin/issueUnpinare kept as two near-identical functions per the repo's established one-function-per-subcommand convention (asissueClose/issueReopenalready do).Review
Risk
Overall: High
src/commands/issue.tsplus two new test files; new switch cases don't alter existing paths.issue deleteperforms an irreversible hard delete of remote data (ADR 0010 confirms non-idempotent).--help.issueDeleteis a destructive data-deletion operation with no confirmation prompt.The High rating is inherent to the hard-delete operation, not a code defect. See the deviation note above for why no
--yesguard was added.Standards & Spec findings left unaddressed
issuePin/issueUnpinare near-identical mirrors — Duplicated Code. Left as-is because the repo's one-function-per-subcommand convention (issueClose/issueReopen) overrides the baseline smell.No Spec findings.