huskies: merge 1169 story Gateway pulls signed artifacts from a release channel into its local store
This commit is contained in:
@@ -548,6 +548,33 @@ pub(in crate::chat::transport::matrix::bot) async fn on_room_message(
|
||||
return;
|
||||
}
|
||||
|
||||
// In gateway mode, handle the `pull <channel>` command: fetch, verify, and
|
||||
// install a signed release-channel artifact into the artifact store.
|
||||
if ctx.is_gateway()
|
||||
&& let Some(channel) = super::super::super::pull::extract_pull_command(
|
||||
&user_message,
|
||||
&ctx.services.bot_name,
|
||||
ctx.matrix_user_id.as_str(),
|
||||
)
|
||||
{
|
||||
slog!("[matrix-bot] Handling 'pull {channel}' from {sender}");
|
||||
let response = if let Some(ref store) = ctx.gateway_channels_store {
|
||||
super::super::super::pull::handle_pull(&channel, store).await
|
||||
} else {
|
||||
"Gateway release channels unavailable — cannot pull.".to_string()
|
||||
};
|
||||
let html = markdown_to_html(&response);
|
||||
if let Ok(msg_id) = ctx
|
||||
.transport
|
||||
.send_message(&room_id_str, &response, &html)
|
||||
.await
|
||||
&& let Ok(event_id) = msg_id.parse()
|
||||
{
|
||||
ctx.bot_sent_event_ids.lock().await.insert(event_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// In gateway mode, handle the `upgrade [<project>]` command to upgrade a
|
||||
// sled's binary in-container, streaming phase markers to the room.
|
||||
if ctx.is_gateway()
|
||||
|
||||
Reference in New Issue
Block a user