huskies: merge 988

This commit is contained in:
dave
2026-05-13 17:24:18 +00:00
parent a078d3df7c
commit caed894db9
15 changed files with 169 additions and 81 deletions
+32 -5
View File
@@ -61,9 +61,18 @@ fn unblock_by_story_id(story_id: &str) -> String {
// Story 945: `Stage::Blocked` / `Stage::MergeFailure` are the single
// source of truth — the legacy `blocked` boolean flag is gone.
let typed_item = crate::pipeline_state::read_typed(story_id).ok().flatten();
let typed_blocked = typed_item
.as_ref()
.is_some_and(|item| item.stage.is_blocked());
let typed_blocked = typed_item.as_ref().is_some_and(|item| {
matches!(
item.stage,
crate::pipeline_state::Stage::Blocked { .. }
| crate::pipeline_state::Stage::MergeFailure { .. }
| crate::pipeline_state::Stage::MergeFailureFinal { .. }
| crate::pipeline_state::Stage::Archived {
reason: crate::pipeline_state::ArchiveReason::Blocked { .. },
..
}
)
});
let typed_merge_failure = matches!(
typed_item.as_ref().map(|i| &i.stage),
Some(crate::pipeline_state::Stage::MergeFailure { .. })
@@ -239,7 +248,16 @@ mod tests {
// Story 945: `Stage::Blocked` was the source of truth; after unblock
// the stage must have transitioned out of `Blocked`.
assert!(
!item.stage().is_blocked(),
!matches!(
item.stage(),
crate::pipeline_state::Stage::Blocked { .. }
| crate::pipeline_state::Stage::MergeFailure { .. }
| crate::pipeline_state::Stage::MergeFailureFinal { .. }
| crate::pipeline_state::Stage::Archived {
reason: crate::pipeline_state::ArchiveReason::Blocked { .. },
..
}
),
"stage must no longer be Blocked after unblock"
);
}
@@ -307,7 +325,16 @@ mod tests {
// Story 945: `Stage::Blocked` was the source of truth; after unblock
// the stage must have transitioned out of `Blocked`.
assert!(
!item.stage().is_blocked(),
!matches!(
item.stage(),
crate::pipeline_state::Stage::Blocked { .. }
| crate::pipeline_state::Stage::MergeFailure { .. }
| crate::pipeline_state::Stage::MergeFailureFinal { .. }
| crate::pipeline_state::Stage::Archived {
reason: crate::pipeline_state::ArchiveReason::Blocked { .. },
..
}
),
"stage must no longer be Blocked after unblock"
);
}