huskies: merge 671_refactor_migrate_pipeline_state_consumers_from_string_comparisons_to_typed_pipelinestage_enum
This commit is contained in:
@@ -335,15 +335,12 @@ pub(super) fn extract_item_view(item: &PipelineItemCrdt) -> Option<PipelineItemV
|
||||
/// Returns `true` if the dependency is satisfied (item found in a done stage).
|
||||
/// See `dep_is_archived_crdt` to distinguish archive-satisfied from cleanly-done.
|
||||
pub fn dep_is_done_crdt(dep_number: u32) -> bool {
|
||||
use crate::pipeline_state::{Stage, read_all_typed};
|
||||
let prefix = format!("{dep_number}_");
|
||||
if let Some(items) = read_all_items() {
|
||||
items.iter().any(|item| {
|
||||
item.story_id.starts_with(&prefix)
|
||||
&& matches!(item.stage.as_str(), "5_done" | "6_archived")
|
||||
})
|
||||
} else {
|
||||
false
|
||||
}
|
||||
read_all_typed().into_iter().any(|item| {
|
||||
item.story_id.0.starts_with(&prefix)
|
||||
&& matches!(item.stage, Stage::Done { .. } | Stage::Archived { .. })
|
||||
})
|
||||
}
|
||||
|
||||
/// Check whether a dependency (by numeric ID prefix) is specifically in `6_archived`
|
||||
@@ -352,14 +349,11 @@ pub fn dep_is_done_crdt(dep_number: u32) -> bool {
|
||||
/// Used to detect when a dependency is satisfied via archive rather than via a clean
|
||||
/// completion through `5_done`. Returns `false` when the CRDT layer is not initialised.
|
||||
pub fn dep_is_archived_crdt(dep_number: u32) -> bool {
|
||||
use crate::pipeline_state::{Stage, read_all_typed};
|
||||
let prefix = format!("{dep_number}_");
|
||||
if let Some(items) = read_all_items() {
|
||||
items
|
||||
.iter()
|
||||
.any(|item| item.story_id.starts_with(&prefix) && item.stage == "6_archived")
|
||||
} else {
|
||||
false
|
||||
}
|
||||
read_all_typed().into_iter().any(|item| {
|
||||
item.story_id.0.starts_with(&prefix) && matches!(item.stage, Stage::Archived { .. })
|
||||
})
|
||||
}
|
||||
|
||||
/// Check unmet dependencies for a story by reading its `depends_on` from the
|
||||
|
||||
Reference in New Issue
Block a user