huskies: merge 1009

This commit is contained in:
dave
2026-05-13 22:50:13 +00:00
parent a5cd3a2152
commit 4e007bb770
56 changed files with 453 additions and 384 deletions
+1 -3
View File
@@ -142,7 +142,7 @@ pub fn get_work_item_content(
let stages = [
("1_backlog", Stage::Backlog),
("2_current", Stage::Coding),
("2_current", Stage::Coding { claim: None }),
("3_qa", Stage::Qa),
(
"4_merge",
@@ -317,8 +317,6 @@ max_budget_usd = 5.0
None,
None,
None,
None,
None,
);
let item = get_work_item_content(tmp.path(), "42_story_foo").unwrap();
assert!(item.content.contains("Some content."));
+25 -10
View File
@@ -12,7 +12,7 @@ pub fn stage_display_name(stage: &Stage) -> &'static str {
match stage {
Stage::Upcoming => "Upcoming",
Stage::Backlog => "Backlog",
Stage::Coding => "Current",
Stage::Coding { .. } => "Current",
Stage::Blocked { .. } => "Blocked",
Stage::Qa => "QA",
Stage::Merge { .. } => "Merge",
@@ -253,7 +253,10 @@ mod tests {
#[test]
fn stage_display_name_maps_all_known_stages() {
assert_eq!(stage_display_name(&Stage::Backlog), "Backlog");
assert_eq!(stage_display_name(&Stage::Coding), "Current");
assert_eq!(
stage_display_name(&Stage::Coding { claim: None }),
"Current"
);
assert_eq!(stage_display_name(&Stage::Qa), "QA");
assert_eq!(stage_display_name(&merge_stage()), "Merge");
assert_eq!(stage_display_name(&done_stage()), "Done");
@@ -290,7 +293,7 @@ mod tests {
"42_story_thing",
"Some Story",
&Stage::Backlog,
&Stage::Coding,
&Stage::Coding { claim: None },
);
assert!(!plain.contains("\u{1f389}"));
}
@@ -301,7 +304,7 @@ mod tests {
"261_story_bot_notifications",
"Bot notifications",
&Stage::Upcoming,
&Stage::Coding,
&Stage::Coding { claim: None },
);
assert_eq!(
plain,
@@ -315,8 +318,12 @@ mod tests {
#[test]
fn format_stage_notification_without_story_name_falls_back_to_number() {
let (plain, html) =
format_stage_notification("42_bug_fix_thing", "", &Stage::Coding, &Stage::Qa);
let (plain, html) = format_stage_notification(
"42_bug_fix_thing",
"",
&Stage::Coding { claim: None },
&Stage::Qa,
);
assert_eq!(plain, "#42 \u{2014} Current \u{2192} QA");
assert_eq!(html, "<strong>#42</strong> \u{2014} Current \u{2192} QA");
}
@@ -334,15 +341,23 @@ mod tests {
#[test]
fn format_stage_notification_long_name_is_preserved() {
let long_name = "A".repeat(300);
let (plain, _html) =
format_stage_notification("1_story_long", &long_name, &Stage::Coding, &Stage::Qa);
let (plain, _html) = format_stage_notification(
"1_story_long",
&long_name,
&Stage::Coding { claim: None },
&Stage::Qa,
);
assert!(plain.contains(&long_name));
}
#[test]
fn format_stage_notification_empty_story_name_falls_back_to_number() {
let (plain, html) =
format_stage_notification("42_story_empty", "", &Stage::Coding, &Stage::Qa);
let (plain, html) = format_stage_notification(
"42_story_empty",
"",
&Stage::Coding { claim: None },
&Stage::Qa,
);
assert_eq!(plain, "#42 \u{2014} Current \u{2192} QA");
assert_eq!(html, "<strong>#42</strong> \u{2014} Current \u{2192} QA");
}
+1 -1
View File
@@ -130,7 +130,7 @@ pub async fn handle_timer_command(
let in_valid_stage =
if let Ok(Some(item)) = crate::pipeline_state::read_typed(&story_id) {
use crate::pipeline_state::Stage;
matches!(item.stage, Stage::Backlog | Stage::Coding)
matches!(item.stage, Stage::Backlog | Stage::Coding { .. })
} else {
let work_dir = project_root.join(".huskies").join("work");
work_dir
-4
View File
@@ -67,8 +67,6 @@ mod tests {
None,
None,
None,
None,
None,
);
let tmp = tempfile::tempdir().unwrap();
@@ -108,8 +106,6 @@ mod tests {
None,
None,
None,
None,
None,
);
}
-2
View File
@@ -204,8 +204,6 @@ mod tests {
None,
None,
None,
None,
None,
);
// Seed content store.