storkit: merge 367_story_rename_bot_whatsup_command_to_status
This commit is contained in:
@@ -89,7 +89,7 @@ pub fn commands() -> &'static [BotCommand] {
|
||||
},
|
||||
BotCommand {
|
||||
name: "status",
|
||||
description: "Show pipeline status and agent availability",
|
||||
description: "Show pipeline status and agent availability; or `status <number>` for a story triage dump",
|
||||
handler: status::handle_status,
|
||||
},
|
||||
BotCommand {
|
||||
@@ -127,11 +127,6 @@ pub fn commands() -> &'static [BotCommand] {
|
||||
description: "Show implementation summary for a merged story: `overview <number>`",
|
||||
handler: overview::handle_overview,
|
||||
},
|
||||
BotCommand {
|
||||
name: "whatsup",
|
||||
description: "Show in-progress triage dump for a story: `whatsup <number>`",
|
||||
handler: whatsup::handle_whatsup,
|
||||
},
|
||||
BotCommand {
|
||||
name: "start",
|
||||
description: "Start a coder on a story: `start <number>` or `start <number> opus`",
|
||||
|
||||
@@ -7,7 +7,11 @@ use std::collections::{HashMap, HashSet};
|
||||
use super::CommandContext;
|
||||
|
||||
pub(super) fn handle_status(ctx: &CommandContext) -> Option<String> {
|
||||
if ctx.args.trim().is_empty() {
|
||||
Some(build_pipeline_status(ctx.project_root, ctx.agents))
|
||||
} else {
|
||||
super::whatsup::handle_whatsup(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
/// Format a short display label for a work item.
|
||||
|
||||
@@ -15,13 +15,13 @@ pub(super) fn handle_whatsup(ctx: &CommandContext) -> Option<String> {
|
||||
let num_str = ctx.args.trim();
|
||||
if num_str.is_empty() {
|
||||
return Some(format!(
|
||||
"Usage: `{} whatsup <number>`\n\nShows a triage dump for a story currently in progress.",
|
||||
"Usage: `{} status <number>`\n\nShows a triage dump for a story currently in progress.",
|
||||
ctx.bot_name
|
||||
));
|
||||
}
|
||||
if !num_str.chars().all(|c| c.is_ascii_digit()) {
|
||||
return Some(format!(
|
||||
"Invalid story number: `{num_str}`. Usage: `{} whatsup <number>`",
|
||||
"Invalid story number: `{num_str}`. Usage: `{} status <number>`",
|
||||
ctx.bot_name
|
||||
));
|
||||
}
|
||||
@@ -293,7 +293,7 @@ mod tests {
|
||||
ambient_rooms: &ambient_rooms,
|
||||
room_id: &room_id,
|
||||
};
|
||||
try_handle_command(&dispatch, &format!("@timmy whatsup {args}"))
|
||||
try_handle_command(&dispatch, &format!("@timmy status {args}"))
|
||||
}
|
||||
|
||||
fn write_story_file(root: &Path, stage: &str, filename: &str, content: &str) {
|
||||
@@ -305,13 +305,13 @@ mod tests {
|
||||
// -- registration -------------------------------------------------------
|
||||
|
||||
#[test]
|
||||
fn whatsup_command_is_registered() {
|
||||
fn whatsup_command_is_not_registered() {
|
||||
let found = super::super::commands().iter().any(|c| c.name == "whatsup");
|
||||
assert!(found, "whatsup command must be in the registry");
|
||||
assert!(!found, "whatsup command must not be in the registry (renamed to status)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn whatsup_command_appears_in_help() {
|
||||
fn status_command_appears_in_help() {
|
||||
let result = super::super::tests::try_cmd_addressed(
|
||||
"Timmy",
|
||||
"@timmy:homeserver.local",
|
||||
@@ -319,8 +319,8 @@ mod tests {
|
||||
);
|
||||
let output = result.unwrap();
|
||||
assert!(
|
||||
output.contains("whatsup"),
|
||||
"help should list whatsup command: {output}"
|
||||
output.contains("status"),
|
||||
"help should list status command: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -331,8 +331,8 @@ mod tests {
|
||||
let tmp = tempfile::TempDir::new().unwrap();
|
||||
let output = whatsup_cmd(tmp.path(), "").unwrap();
|
||||
assert!(
|
||||
output.contains("Usage"),
|
||||
"no args should show usage: {output}"
|
||||
output.contains("Pipeline Status"),
|
||||
"no args should show pipeline status: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user