huskies: merge 988
This commit is contained in:
@@ -275,7 +275,7 @@ mod tests {
|
||||
Some("Frozen Story"),
|
||||
);
|
||||
let item = PipelineItem::try_from(&view).unwrap();
|
||||
assert!(item.is_frozen());
|
||||
assert!(matches!(item.stage, Stage::Frozen { .. }));
|
||||
}
|
||||
|
||||
// ── Event bus tests ─────────────────────────────────────────────────
|
||||
|
||||
@@ -562,7 +562,7 @@ fn freeze_transitions_to_frozen_variant_with_resume_to() {
|
||||
|
||||
let item = read_typed(story_id).unwrap().unwrap();
|
||||
assert!(matches!(item.stage, Stage::Coding));
|
||||
assert!(!item.is_frozen());
|
||||
assert!(!matches!(item.stage, Stage::Frozen { .. }));
|
||||
|
||||
super::apply::transition_to_frozen(story_id).expect("freeze should succeed");
|
||||
|
||||
@@ -574,7 +574,10 @@ fn freeze_transitions_to_frozen_variant_with_resume_to() {
|
||||
),
|
||||
other => panic!("stage should be Stage::Frozen after freeze; got {other:?}"),
|
||||
}
|
||||
assert!(item.is_frozen(), "is_frozen() should be true after freeze");
|
||||
assert!(
|
||||
matches!(item.stage, Stage::Frozen { .. }),
|
||||
"is_frozen() should be true after freeze"
|
||||
);
|
||||
|
||||
super::apply::transition_to_unfrozen(story_id).expect("unfreeze should succeed");
|
||||
|
||||
@@ -585,7 +588,7 @@ fn freeze_transitions_to_frozen_variant_with_resume_to() {
|
||||
item.stage
|
||||
);
|
||||
assert!(
|
||||
!item.is_frozen(),
|
||||
!matches!(item.stage, Stage::Frozen { .. }),
|
||||
"is_frozen() should be false after unfreeze"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -262,43 +262,6 @@ impl Stage {
|
||||
stage_dir_name(self)
|
||||
}
|
||||
|
||||
/// Returns true if this is the `Blocked`, `MergeFailure`, or
|
||||
/// `MergeFailureFinal` variant (or the legacy `Archived(Blocked)` for
|
||||
/// backward-compatible reads).
|
||||
pub fn is_blocked(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Stage::Blocked { .. }
|
||||
| Stage::MergeFailure { .. }
|
||||
| Stage::MergeFailureFinal { .. }
|
||||
| Stage::Archived {
|
||||
reason: ArchiveReason::Blocked { .. },
|
||||
..
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns true if this is the `Frozen` variant. Story 945: replaces
|
||||
/// the legacy `frozen: true` boolean flag. The auto-assigner skips
|
||||
/// frozen stories.
|
||||
pub fn is_frozen(&self) -> bool {
|
||||
matches!(self, Stage::Frozen { .. })
|
||||
}
|
||||
|
||||
/// Returns true if this is the `ReviewHold` variant. Story 945:
|
||||
/// replaces the legacy `review_hold: true` boolean flag. The
|
||||
/// auto-assigner skips review-held stories.
|
||||
pub fn is_review_hold(&self) -> bool {
|
||||
matches!(self, Stage::ReviewHold { .. })
|
||||
}
|
||||
|
||||
/// Returns true if mergemaster has already been auto-spawned for this
|
||||
/// story (`MergeFailureFinal`). Story 945: replaces the legacy
|
||||
/// `mergemaster_attempted: true` boolean flag.
|
||||
pub fn is_mergemaster_attempted(&self) -> bool {
|
||||
matches!(self, Stage::MergeFailureFinal { .. })
|
||||
}
|
||||
|
||||
/// Parse a stage from its filesystem directory name.
|
||||
///
|
||||
/// This is the single canonical conversion boundary for turning a loose
|
||||
@@ -401,14 +364,6 @@ pub struct PipelineItem {
|
||||
pub retry_count: u32,
|
||||
}
|
||||
|
||||
impl PipelineItem {
|
||||
/// Whether the item is frozen — story 945: `Stage::Frozen` is now the
|
||||
/// single source of truth, replacing the legacy boolean flag.
|
||||
pub fn is_frozen(&self) -> bool {
|
||||
self.stage.is_frozen()
|
||||
}
|
||||
}
|
||||
|
||||
// ── Transition errors ───────────────────────────────────────────────────────
|
||||
|
||||
/// Error returned when a pipeline event is not valid for the current stage.
|
||||
|
||||
Reference in New Issue
Block a user