huskies: merge 960
This commit is contained in:
@@ -42,13 +42,16 @@ pub fn is_config_file(path: &Path, git_root: &Path) -> bool {
|
||||
path == huskies.join("project.toml") || path == huskies.join("agents.toml")
|
||||
}
|
||||
|
||||
/// Map a pipeline directory name to a (action, commit-message-prefix) pair.
|
||||
/// Map a typed pipeline stage to a (action, commit-message-prefix) pair.
|
||||
///
|
||||
/// Used by the CRDT-to-watcher bridge (in `main.rs`) to derive the action and
|
||||
/// commit message for `WatcherEvent::WorkItem` events.
|
||||
pub fn stage_metadata(stage: &str, item_id: &str) -> Option<(&'static str, String)> {
|
||||
/// Used by the CRDT-to-watcher bridge to derive the action and commit message
|
||||
/// for `WatcherEvent::WorkItem` events.
|
||||
pub fn stage_metadata(
|
||||
stage: &crate::pipeline_state::Stage,
|
||||
item_id: &str,
|
||||
) -> (&'static str, String) {
|
||||
use crate::pipeline_state::Stage;
|
||||
let (action, msg) = match Stage::from_dir(stage)? {
|
||||
match stage {
|
||||
Stage::Upcoming => ("create", format!("huskies: triage {item_id}")),
|
||||
Stage::Backlog => ("create", format!("huskies: create {item_id}")),
|
||||
Stage::Coding => ("start", format!("huskies: start {item_id}")),
|
||||
@@ -66,8 +69,7 @@ pub fn stage_metadata(stage: &str, item_id: &str) -> Option<(&'static str, Strin
|
||||
Stage::ReviewHold { .. } => ("review_hold", format!("huskies: review_hold {item_id}")),
|
||||
Stage::Done { .. } => ("done", format!("huskies: done {item_id}")),
|
||||
Stage::Archived { .. } => ("accept", format!("huskies: accept {item_id}")),
|
||||
};
|
||||
Some((action, msg))
|
||||
}
|
||||
}
|
||||
|
||||
/// Start the filesystem watcher on a dedicated OS thread.
|
||||
|
||||
Reference in New Issue
Block a user