(451fb83) Add a discarded status for work that will not be done, and bump to 0.31.0
The flow ended at done, so a ticket that turned out to be a duplicate or obsolete had nowhere to go: it sat in the backlog or was deleted by hand, which destroyed the record and left every relation to it dangling. Discarded is a fifth status with its own directory, keeping the invariant that the filename, the Status field and the directory agree, and keeping done meaning the work landed. Entering it is allowed from any status without -f, because discarding is not a stage of work. Discarded sits last in Status::ALL, which is what makes the rest fall out rather than needing cases: nothing follows it, so a discard clears no stamp and a ticket abandoned from reviewing keeps the journey it made, and every move out is a backward move, so un-discarding needs -f. The two dependency guards now look opposite ways. check_blockers asks what a ticket waits on and gates work moves; check_dependents asks who waits on it and gates the discard, because those plans depended on work about to be declared never-happening. Both skip targets that are themselves terminal. Status::FLOW is the four stages the board draws, so a discarded column on screen stays a136d13's ticket and done stays the last drawn column. Every tree walker keeps using Status::ALL, or a discarded ticket would be unaddressable. util::is_open replaces three spellings of "not done and not discarded", across mv, ls and the campaign standing. The board's blocked mark goes through it as well: that path was only accidentally correct, since a discarded blocker is absent from the FLOW columns, and drawing the column later would have diverged it from what mv allows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c03f47c52d
commit
5bf0fd1bfe
@@ -903,3 +903,47 @@ fn ls_ids_prints_the_same_order_the_listing_does() {
|
||||
let seen = positions(&stdout, ["Oldest", "Newest", "Unstamped"]);
|
||||
assert!(seen[0] < seen[1] && seen[1] < seen[2], "{stdout}");
|
||||
}
|
||||
|
||||
/// Discarded is the other terminal status, so the decorated listing leaves it out the
|
||||
/// way it leaves done out: it is counted in the summary and not listed. The positional
|
||||
/// and `--ids` still reach it, since a ticket nobody will work still has to be nameable.
|
||||
#[test]
|
||||
fn ls_hides_discarded_but_counts_and_can_name_it() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
temp.child(".worklane")
|
||||
.child("discarded")
|
||||
.create_dir_all()
|
||||
.unwrap();
|
||||
|
||||
create_ticket_with_id(
|
||||
&worklane,
|
||||
"backlog",
|
||||
"Still open",
|
||||
"aaaaaaa1-0000-0000-0000-000000000001",
|
||||
"bug",
|
||||
);
|
||||
create_ticket_with_id(
|
||||
&worklane,
|
||||
"discarded",
|
||||
"Abandoned",
|
||||
"ccccccc3-0000-0000-0000-000000000003",
|
||||
"bug",
|
||||
);
|
||||
|
||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||
cmd.current_dir(temp.path()).arg("ls");
|
||||
let stdout = get_stdout(&mut cmd);
|
||||
assert!(stdout.contains("Still open"), "{stdout}");
|
||||
assert!(!stdout.contains("Abandoned"), "discarded was listed: {stdout}");
|
||||
assert!(stdout.contains("DISCARDED"), "discarded is not counted: {stdout}");
|
||||
|
||||
// Nameable both ways, the way done is.
|
||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||
cmd.current_dir(temp.path()).args(["ls", "--ids"]);
|
||||
assert!(get_stdout(&mut cmd).contains("Abandoned"));
|
||||
|
||||
let mut cmd = Command::cargo_bin(BIN_NAME).unwrap();
|
||||
cmd.current_dir(temp.path()).args(["ls", "discarded"]);
|
||||
assert!(get_stdout(&mut cmd).contains("Abandoned"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user