huskies: merge 599_story_cross_project_status_notifications_in_chat
This commit is contained in:
+16
-2
@@ -7,6 +7,7 @@ pub mod bot_command;
|
||||
pub mod bot_config;
|
||||
pub mod chat;
|
||||
pub mod context;
|
||||
pub mod events;
|
||||
pub mod health;
|
||||
pub mod io;
|
||||
pub mod mcp;
|
||||
@@ -68,6 +69,7 @@ pub fn build_routes(
|
||||
whatsapp_ctx: Option<Arc<WhatsAppWebhookContext>>,
|
||||
slack_ctx: Option<Arc<SlackWebhookContext>>,
|
||||
port: u16,
|
||||
event_buffer: Option<events::EventBuffer>,
|
||||
) -> impl poem::Endpoint {
|
||||
let ctx_arc = std::sync::Arc::new(ctx);
|
||||
|
||||
@@ -103,6 +105,10 @@ pub fn build_routes(
|
||||
.at("/", get(assets::embedded_index))
|
||||
.at("/*path", get(assets::embedded_file));
|
||||
|
||||
if let Some(buf) = event_buffer {
|
||||
route = route.at("/api/events", get(events::events_handler).data(buf));
|
||||
}
|
||||
|
||||
if let Some(wa_ctx) = whatsapp_ctx {
|
||||
route = route.at(
|
||||
"/webhook/whatsapp",
|
||||
@@ -302,7 +308,7 @@ mod tests {
|
||||
fn build_routes_constructs_without_panic() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let ctx = context::AppContext::new_test(tmp.path().to_path_buf());
|
||||
let _endpoint = build_routes(ctx, None, None, 3001);
|
||||
let _endpoint = build_routes(ctx, None, None, 3001, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -311,6 +317,14 @@ mod tests {
|
||||
// ensuring the port parameter flows through to OAuthState.
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let ctx = context::AppContext::new_test(tmp.path().to_path_buf());
|
||||
let _endpoint = build_routes(ctx, None, None, 9999);
|
||||
let _endpoint = build_routes(ctx, None, None, 9999, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_routes_with_event_buffer_constructs_without_panic() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let ctx = context::AppContext::new_test(tmp.path().to_path_buf());
|
||||
let buf = events::EventBuffer::new();
|
||||
let _endpoint = build_routes(ctx, None, None, 3001, Some(buf));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user