(2c95d38) Gate a blocker by the column it is in, not by whether it is done, and bump to 0.33.1
check_blockers refused every move while a blocked by target was still open, so a dependent sat in backlog until its blocker landed even when the blocker was in reviewing and its code was there to build on. The way out was -f, which also waives the backward and skipping guard, on every move for as long as the pair existed. The rule is now the columns: a ticket may stand level with what it waits on but never ahead of it, so a blocker in reviewing lets the dependent be committed and reviewed and gates only done. util::blocks_move is the one place it is decided, taking the status moved into and the blocker's own, and mv passes the target through. A finished blocker still holds up nothing, answered through is_open, and a target of discarded is answered by name rather than by its place in Status::ALL, where it sits last. The refusal now names the status moved into and only the blockers still behind it: a dependent told to wait for work already ahead of it has nothing to act on. The board asks the same function about the column one stage ahead, so the blocked mark means the card cannot advance rather than that a dependency was ever recorded, which also takes it off cards in the two terminal columns. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9c224fb768
commit
ead3c4340d
+98
-10
@@ -702,9 +702,10 @@ fn move_ticket(temp: &TempDir, ticket: &str, status: &str, force: bool) -> std::
|
||||
}
|
||||
|
||||
/// Refused, and nothing written: not the rename, not the Status field, not a stray
|
||||
/// temp file. The blocker is named with its status, since that is what has to change.
|
||||
/// temp file. The blocker is named with its status, since that is what has to change,
|
||||
/// and the move names the status it was for, since that is what decides the refusal.
|
||||
#[test]
|
||||
fn mv_refuses_a_move_while_a_blocker_is_open() {
|
||||
fn mv_refuses_a_move_past_a_blocker() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
let filename = create_gated_pair(&worklane, &temp, "backlog");
|
||||
@@ -715,6 +716,7 @@ fn mv_refuses_a_move_while_a_blocker_is_open() {
|
||||
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
assert!(stderr.contains("blocked by"), "{stderr}");
|
||||
assert!(stderr.contains("to committed"), "the move is not named: {stderr}");
|
||||
assert!(stderr.contains("The Blocker"), "{stderr}");
|
||||
assert!(stderr.contains("backlog"), "{stderr}");
|
||||
assert!(stderr.contains("--force"), "{stderr}");
|
||||
@@ -729,16 +731,19 @@ fn mv_refuses_a_move_while_a_blocker_is_open() {
|
||||
assert_eq!(stray_files(&worklane), Vec::<String>::new());
|
||||
}
|
||||
|
||||
/// Every open blocker, not the first: clearing the one the message happened to name
|
||||
/// would leave the ticket blocked and the reader surprised.
|
||||
/// Every blocker still behind the move, not the first: advancing the one the message
|
||||
/// happened to name would leave the ticket held up and the reader surprised.
|
||||
///
|
||||
/// The gated ticket is in reviewing and both blockers are behind it, so the move to done
|
||||
/// is ahead of both. A blocker further along than the move is a separate case, below.
|
||||
#[test]
|
||||
fn mv_names_every_open_blocker() {
|
||||
fn mv_names_every_blocker_behind_the_move() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_gated_pair(&worklane, &temp, "backlog");
|
||||
create_gated_pair(&worklane, &temp, "reviewing");
|
||||
create_ticket(
|
||||
&worklane,
|
||||
"reviewing",
|
||||
"committed",
|
||||
"The Second Blocker",
|
||||
"Also not done.",
|
||||
"cccc3333cccc3333cccc3333cccc3333cccc",
|
||||
@@ -754,12 +759,95 @@ fn mv_names_every_open_blocker() {
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let out = move_ticket(&temp, "aaaa1111", "committed", false);
|
||||
let out = move_ticket(&temp, "aaaa1111", "done", false);
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
assert!(stderr.contains("The Blocker"), "{stderr}");
|
||||
assert!(stderr.contains("The Second Blocker"), "{stderr}");
|
||||
}
|
||||
|
||||
/// A blocker that has moved on is not in the way, and it is left out of the message
|
||||
/// rather than listed with the ones that are: a ticket told to wait for work that is
|
||||
/// already ahead of it has nothing to act on.
|
||||
#[test]
|
||||
fn mv_leaves_out_a_blocker_the_move_does_not_pass() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
create_gated_pair(&worklane, &temp, "backlog");
|
||||
create_ticket(
|
||||
&worklane,
|
||||
"reviewing",
|
||||
"The Second Blocker",
|
||||
"Further along than the move.",
|
||||
"cccc3333cccc3333cccc3333cccc3333cccc",
|
||||
"bob",
|
||||
"_Not set_",
|
||||
"test",
|
||||
);
|
||||
|
||||
Command::cargo_bin(BIN_NAME)
|
||||
.unwrap()
|
||||
.current_dir(temp.path())
|
||||
.args(["relate", "aaaa1111", "--blocked-by", "cccc3333"])
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
// Refused by the backlog blocker, which is the only one the move passes.
|
||||
let out = move_ticket(&temp, "aaaa1111", "committed", false);
|
||||
assert!(!out.status.success());
|
||||
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
assert!(stderr.contains("The Blocker"), "{stderr}");
|
||||
assert!(
|
||||
!stderr.contains("The Second Blocker"),
|
||||
"a blocker ahead of the move was named: {stderr}"
|
||||
);
|
||||
}
|
||||
|
||||
/// The walk the change is for: a dependent follows its blocker one column at a time,
|
||||
/// standing level with it and never ahead, and none of it costs a `-f`.
|
||||
#[test]
|
||||
fn mv_walks_a_dependent_up_behind_its_blocker() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
let worklane = setup_worklane(&temp);
|
||||
let filename = create_gated_pair(&worklane, &temp, "backlog");
|
||||
|
||||
// Level is allowed: the blocker is committed, so the dependent may be committed too,
|
||||
// and reviewing is the stage it may not reach yet.
|
||||
assert!(
|
||||
move_ticket(&temp, "bbbb2222", "committed", false)
|
||||
.status
|
||||
.success()
|
||||
);
|
||||
let out = move_ticket(&temp, "aaaa1111", "committed", false);
|
||||
assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr));
|
||||
assert!(worklane.join("committed").join(&filename).exists());
|
||||
|
||||
let refused = move_ticket(&temp, "aaaa1111", "reviewing", false);
|
||||
assert!(
|
||||
!refused.status.success(),
|
||||
"the dependent moved a column ahead of its blocker"
|
||||
);
|
||||
|
||||
// The blocker submits, and reviewing opens for the dependent while done does not.
|
||||
assert!(
|
||||
move_ticket(&temp, "bbbb2222", "reviewing", false)
|
||||
.status
|
||||
.success()
|
||||
);
|
||||
let out = move_ticket(&temp, "aaaa1111", "reviewing", false);
|
||||
assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr));
|
||||
|
||||
let refused = move_ticket(&temp, "aaaa1111", "done", false);
|
||||
assert!(!refused.status.success(), "the dependent landed before its blocker");
|
||||
assert!(worklane.join("reviewing").join(&filename).exists());
|
||||
|
||||
// And the last stage, which is the one that was ever worth waiting for.
|
||||
assert!(move_ticket(&temp, "bbbb2222", "done", false).status.success());
|
||||
let out = move_ticket(&temp, "aaaa1111", "done", false);
|
||||
assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr));
|
||||
assert!(worklane.join("done").join(&filename).exists());
|
||||
}
|
||||
|
||||
/// `-f` is where the deliberate overrides live, beside the backward and skipping moves.
|
||||
#[test]
|
||||
fn mv_moves_a_blocked_ticket_with_force() {
|
||||
@@ -790,8 +878,8 @@ fn mv_allows_the_move_once_the_blocker_is_done() {
|
||||
assert!(worklane.join("committed").join(&filename).exists());
|
||||
}
|
||||
|
||||
/// Every move, not only the one into committed. An open blocker is a reason not to
|
||||
/// finish as much as a reason not to start.
|
||||
/// Every move is asked, not only the one into committed: a blocker that has not started
|
||||
/// is a reason not to finish as much as a reason not to start.
|
||||
#[test]
|
||||
fn mv_checks_the_blockers_on_every_move() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user