huskies: merge 946
This commit is contained in:
@@ -35,10 +35,11 @@ pub(crate) fn item_type_from_id(item_id: &str) -> &'static str {
|
||||
&& let Some(view) = crate::crdt_state::read_item(item_id)
|
||||
&& let Some(t) = view.item_type()
|
||||
{
|
||||
use crate::io::story_metadata::ItemType;
|
||||
return match t {
|
||||
"bug" => "bug",
|
||||
"spike" => "spike",
|
||||
"refactor" => "refactor",
|
||||
ItemType::Bug => "bug",
|
||||
ItemType::Spike => "spike",
|
||||
ItemType::Refactor => "refactor",
|
||||
_ => "story",
|
||||
};
|
||||
}
|
||||
@@ -527,7 +528,7 @@ mod tests {
|
||||
&format!("# Test {t}\n"),
|
||||
crate::db::ItemMeta::named(format!("Test {t}")),
|
||||
);
|
||||
crate::crdt_state::set_item_type(id, Some(t));
|
||||
crate::crdt_state::set_item_type(id, crate::io::story_metadata::ItemType::from_str(t));
|
||||
}
|
||||
|
||||
assert_eq!(item_type_from_id("9999"), "bug");
|
||||
|
||||
@@ -60,9 +60,7 @@ pub(super) fn resolve_qa_mode_from_store(
|
||||
default: crate::io::story_metadata::QaMode,
|
||||
) -> crate::io::story_metadata::QaMode {
|
||||
crate::crdt_state::read_item(story_id)
|
||||
.and_then(|view| view.qa_mode().map(str::to_string))
|
||||
.as_deref()
|
||||
.and_then(crate::io::story_metadata::QaMode::from_str)
|
||||
.and_then(|view| view.qa_mode())
|
||||
.unwrap_or(default)
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ pub(super) async fn run_agent_spawn(
|
||||
// Story 933: epic linkage is now a typed CRDT register on PipelineItemCrdt.
|
||||
if let Some(view) = crate::crdt_state::read_item(&sid)
|
||||
&& let Some(epic_id) = view.epic()
|
||||
&& let Some(epic_content) = crate::db::read_content(epic_id)
|
||||
&& let Some(epic_content) = crate::db::read_content(&epic_id.to_string())
|
||||
{
|
||||
let block = format!(
|
||||
"# Epic Context\n\nThis work item belongs to epic `{epic_id}`.\
|
||||
|
||||
@@ -147,7 +147,7 @@ mod tests {
|
||||
"60_story_cleanup",
|
||||
"2_current",
|
||||
story_content,
|
||||
crate::db::ItemMeta::default(),
|
||||
crate::db::ItemMeta::named("Cleanup"),
|
||||
);
|
||||
|
||||
let pool = AgentPool::new_test(3001);
|
||||
|
||||
Reference in New Issue
Block a user