huskies: merge 891
This commit is contained in:
@@ -192,8 +192,8 @@ mod tests {
|
||||
// CRDT register must hold the deps.
|
||||
let view = crate::crdt_state::read_item("9910_story_foo").expect("CRDT should have story");
|
||||
assert_eq!(
|
||||
view.depends_on,
|
||||
Some(vec![477, 478]),
|
||||
view.depends_on(),
|
||||
&[477, 478],
|
||||
"CRDT register should hold [477, 478]: {view:?}"
|
||||
);
|
||||
// Content store YAML must NOT be mutated with depends_on.
|
||||
@@ -223,8 +223,8 @@ mod tests {
|
||||
);
|
||||
// CRDT register must be empty after clear.
|
||||
let view = crate::crdt_state::read_item("9911_story_bar").expect("CRDT should have story");
|
||||
assert_eq!(
|
||||
view.depends_on, None,
|
||||
assert!(
|
||||
view.depends_on().is_empty(),
|
||||
"CRDT register should be empty after clearing: {view:?}"
|
||||
);
|
||||
// Content store YAML must not be mutated.
|
||||
@@ -260,8 +260,8 @@ mod tests {
|
||||
let view =
|
||||
crate::crdt_state::read_item("8790_story_chat_dep").expect("CRDT must have chat story");
|
||||
assert_eq!(
|
||||
view.depends_on,
|
||||
Some(vec![500, 501]),
|
||||
view.depends_on(),
|
||||
&[500, 501],
|
||||
"CRDT must hold [500, 501]: {view:?}"
|
||||
);
|
||||
|
||||
@@ -290,8 +290,8 @@ mod tests {
|
||||
assert!(out.contains("1"), "response should mention dep 1: {out}");
|
||||
let view = crate::crdt_state::read_item("9920_story_scr").expect("CRDT must have story");
|
||||
assert_eq!(
|
||||
view.depends_on,
|
||||
Some(vec![1, 2, 3]),
|
||||
view.depends_on(),
|
||||
&[1, 2, 3],
|
||||
"CRDT should hold [1,2,3]: {view:?}"
|
||||
);
|
||||
|
||||
@@ -299,9 +299,9 @@ mod tests {
|
||||
let out = depends_cmd_with_root(tmp.path(), "9920").unwrap();
|
||||
assert!(out.contains("Cleared"), "clear should confirm: {out}");
|
||||
let view = crate::crdt_state::read_item("9920_story_scr").expect("CRDT must have story");
|
||||
assert_eq!(
|
||||
view.depends_on, None,
|
||||
"CRDT should be None after clear: {view:?}"
|
||||
assert!(
|
||||
view.depends_on().is_empty(),
|
||||
"CRDT should be empty after clear: {view:?}"
|
||||
);
|
||||
|
||||
// Replace with [4, 5] — must not append to old list.
|
||||
@@ -309,8 +309,8 @@ mod tests {
|
||||
assert!(out.contains("4"), "response should mention dep 4: {out}");
|
||||
let view = crate::crdt_state::read_item("9920_story_scr").expect("CRDT must have story");
|
||||
assert_eq!(
|
||||
view.depends_on,
|
||||
Some(vec![4, 5]),
|
||||
view.depends_on(),
|
||||
&[4, 5],
|
||||
"CRDT should hold exactly [4,5] after replace: {view:?}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ fn unblock_by_story_id(story_id: &str) -> String {
|
||||
let crdt_item = crate::crdt_state::read_item(story_id);
|
||||
let story_name = crdt_item
|
||||
.as_ref()
|
||||
.and_then(|i| i.name.clone())
|
||||
.and_then(|i| i.name().map(str::to_string))
|
||||
.unwrap_or_else(|| story_id.to_string());
|
||||
|
||||
// Canonical "is this story blocked?" comes from the typed pipeline state.
|
||||
@@ -69,7 +69,7 @@ fn unblock_by_story_id(story_id: &str) -> String {
|
||||
Some(crate::pipeline_state::Stage::MergeFailure { .. })
|
||||
);
|
||||
// CRDT register fallback for items not yet projected into typed state.
|
||||
let crdt_blocked = crdt_item.as_ref().and_then(|i| i.blocked).unwrap_or(false);
|
||||
let crdt_blocked = crdt_item.as_ref().is_some_and(|i| i.blocked());
|
||||
|
||||
if !typed_blocked && !crdt_blocked {
|
||||
return format!("**{story_name}** ({story_id}) is not blocked. Nothing to unblock.");
|
||||
@@ -271,8 +271,8 @@ mod tests {
|
||||
let item = crate::crdt_state::read_item("9903_story_stuck")
|
||||
.expect("story should be in CRDT after unblock");
|
||||
assert_eq!(
|
||||
item.retry_count,
|
||||
Some(0),
|
||||
item.retry_count(),
|
||||
0,
|
||||
"retry_count should be reset to 0 in CRDT after unblock"
|
||||
);
|
||||
}
|
||||
@@ -334,14 +334,13 @@ mod tests {
|
||||
let item = crate::crdt_state::read_item(story_id)
|
||||
.expect("story should still be in CRDT after unblock");
|
||||
assert_eq!(
|
||||
item.retry_count,
|
||||
Some(0),
|
||||
item.retry_count(),
|
||||
0,
|
||||
"retry_count must be reset to 0 in CRDT after unblock"
|
||||
);
|
||||
assert!(
|
||||
!item.blocked.unwrap_or(false),
|
||||
"blocked flag must be cleared in CRDT after unblock: {:?}",
|
||||
item.blocked
|
||||
!item.blocked(),
|
||||
"blocked flag must be cleared in CRDT after unblock"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user