huskies: merge 629_refactor_migrate_commanddispatch_and_commandcontext_to_services_bundle
This commit is contained in:
@@ -10,7 +10,7 @@ use super::CommandContext;
|
||||
/// that tag and HEAD on master. Each entry shows the story number and name.
|
||||
/// Returns a clear message when there are no unreleased stories or no tags.
|
||||
pub(super) fn handle_unreleased(ctx: &CommandContext) -> Option<String> {
|
||||
let root = ctx.project_root;
|
||||
let root = ctx.effective_root();
|
||||
let tag = find_last_release_tag(root);
|
||||
|
||||
let commits = list_merge_commits_since(root, tag.as_deref());
|
||||
@@ -201,22 +201,16 @@ fn find_story_name(root: &std::path::Path, num_str: &str) -> Option<String> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::agents::AgentPool;
|
||||
use std::collections::HashSet;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use super::super::{CommandDispatch, try_handle_command};
|
||||
|
||||
fn unreleased_cmd_with_root(root: &std::path::Path) -> Option<String> {
|
||||
let agents = Arc::new(AgentPool::new_test(3000));
|
||||
let ambient_rooms = Arc::new(Mutex::new(HashSet::new()));
|
||||
let services = crate::services::Services::new_test(root.to_path_buf(), "Timmy".to_string());
|
||||
let room_id = "!test:example.com".to_string();
|
||||
let dispatch = CommandDispatch {
|
||||
bot_name: "Timmy",
|
||||
services: &services,
|
||||
project_root: &services.project_root,
|
||||
bot_user_id: "@timmy:homeserver.local",
|
||||
project_root: root,
|
||||
agents: &agents,
|
||||
ambient_rooms: &ambient_rooms,
|
||||
room_id: &room_id,
|
||||
};
|
||||
try_handle_command(&dispatch, "@timmy unreleased")
|
||||
|
||||
Reference in New Issue
Block a user