2ae9196
ZhenYi
feat(lib/git): add HTTP handler tree with routes and errors across analysis, archives, blobs, branches, commits, conflicts, content, diffs, hooks, lfs, logs, maintenance, packs, patches, pipelines, refs, remotes, repos, signatures, submodules, tags, trees
2ae9196
use std::error::Error;
use crate::sync::event::PostReceiveTask;
#[async_trait::async_trait]
pub trait WebhookTx: Send + Sync {
async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box<dyn Error + Send + Sync>>;
}
#[derive(Debug, Default, Clone)]
pub struct NoopWebhookTx;
#[async_trait::async_trait]
impl WebhookTx for NoopWebhookTx {
async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box<dyn Error + Send + Sync>> {
tracing::warn!(
repo_id = %task.repo_id,
refs = task.refs.len(),
"webhook dispatch not configured; message dropped (NoopWebhookTx)"
);
Ok(())
}
}