huskies: merge 864
This commit is contained in:
@@ -527,6 +527,9 @@ fn merge_item_with_failure_shows_stop_sign_and_snippet() {
|
||||
"903_story_merge_fail",
|
||||
"4_merge",
|
||||
"---\nname: Failed Story\nmerge_failure: \"conflicts in src/lib.rs\"\n---\n",
|
||||
crate::db::ItemMeta::from_yaml(
|
||||
"---\nname: Failed Story\nmerge_failure: \"conflicts in src/lib.rs\"\n---\n",
|
||||
),
|
||||
);
|
||||
let items = vec![make_item(
|
||||
"903_story_merge_fail",
|
||||
@@ -552,7 +555,12 @@ fn merge_item_failure_snippet_truncated_at_120_chars() {
|
||||
crate::db::ensure_content_store();
|
||||
let long_reason = "x".repeat(200);
|
||||
let content = format!("---\nname: Long Fail\nmerge_failure: \"{long_reason}\"\n---\n");
|
||||
crate::db::write_item_with_content("904_story_long_fail", "4_merge", &content);
|
||||
crate::db::write_item_with_content(
|
||||
"904_story_long_fail",
|
||||
"4_merge",
|
||||
&content,
|
||||
crate::db::ItemMeta::from_yaml(&content),
|
||||
);
|
||||
let items = vec![make_item("904_story_long_fail", "Long Fail", merge_stage())];
|
||||
let agents = AgentPool::new_test(3000);
|
||||
let output = build_status_from_items(tmp.path(), &agents, &items);
|
||||
@@ -584,11 +592,21 @@ fn merge_item_failure_snippet_is_first_non_empty_line() {
|
||||
"---\nname: Multi Line\nmerge_failure: \"{}\" \n---\n",
|
||||
reason.replace('\n', "\\n")
|
||||
);
|
||||
crate::db::write_item_with_content("905_story_multiline", "4_merge", &content);
|
||||
crate::db::write_item_with_content(
|
||||
"905_story_multiline",
|
||||
"4_merge",
|
||||
&content,
|
||||
crate::db::ItemMeta::from_yaml(&content),
|
||||
);
|
||||
// Write with literal \n as the content (simulating stored text with newlines).
|
||||
let content2 =
|
||||
"---\nname: Multi Line\nmerge_failure: |\n \n first line of error\n second line\n---\n";
|
||||
crate::db::write_item_with_content("905_story_multiline", "4_merge", content2);
|
||||
crate::db::write_item_with_content(
|
||||
"905_story_multiline",
|
||||
"4_merge",
|
||||
content2,
|
||||
crate::db::ItemMeta::from_yaml(content2),
|
||||
);
|
||||
let items = vec![make_item(
|
||||
"905_story_multiline",
|
||||
"Multi Line",
|
||||
@@ -615,6 +633,9 @@ fn merge_item_det_merge_running_preferred_over_failure() {
|
||||
"906_story_det_over_fail",
|
||||
"4_merge",
|
||||
"---\nname: Det Over Fail\nmerge_failure: \"old failure\"\n---\n",
|
||||
crate::db::ItemMeta::from_yaml(
|
||||
"---\nname: Det Over Fail\nmerge_failure: \"old failure\"\n---\n",
|
||||
),
|
||||
);
|
||||
// Record a running deterministic merge in the CRDT.
|
||||
crate::crdt_state::write_merge_job("906_story_det_over_fail", "running", 0.0, None, None);
|
||||
|
||||
@@ -100,7 +100,12 @@ fn unblock_by_story_id(story_id: &str) -> String {
|
||||
.flatten()
|
||||
.map(|i| i.stage.dir_name().to_string())
|
||||
.unwrap_or_else(|| "2_current".to_string());
|
||||
crate::db::write_item_with_content(story_id, &stage, &updated);
|
||||
crate::db::write_item_with_content(
|
||||
story_id,
|
||||
&stage,
|
||||
&updated,
|
||||
crate::db::ItemMeta::from_yaml(&updated),
|
||||
);
|
||||
crate::crdt_state::set_retry_count(story_id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ pub(crate) fn write_story_file(root: &Path, stage: &str, filename: &str, content
|
||||
|
||||
let story_id = filename.trim_end_matches(".md");
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_item_with_content(story_id, stage, content);
|
||||
let meta = crate::db::ItemMeta::from_yaml(content);
|
||||
crate::db::write_item_with_content(story_id, stage, content, meta);
|
||||
}
|
||||
|
||||
@@ -261,6 +261,9 @@ mod tests {
|
||||
story_id,
|
||||
"1_backlog",
|
||||
"---\nname: CRDT Tombstone Check\n---\n\n# Story 9977\n",
|
||||
crate::db::ItemMeta::from_yaml(
|
||||
"---\nname: CRDT Tombstone Check\n---\n\n# Story 9977\n",
|
||||
),
|
||||
);
|
||||
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
@@ -291,6 +294,7 @@ mod tests {
|
||||
"9975_story_some_feature",
|
||||
"1_backlog",
|
||||
"---\nname: Some Feature\n---\n\n# Story 9975\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Some Feature\n---\n\n# Story 9975\n"),
|
||||
);
|
||||
|
||||
let agents = std::sync::Arc::new(crate::agents::AgentPool::new_test(3000));
|
||||
|
||||
@@ -275,6 +275,7 @@ mod tests {
|
||||
"9976_story_test",
|
||||
"1_backlog",
|
||||
"---\nname: Test Story\n---\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Test Story\n---\n"),
|
||||
);
|
||||
|
||||
let agents = Arc::new(AgentPool::new_test(3000));
|
||||
|
||||
Reference in New Issue
Block a user