use crate as git;
use git_next_config as config;
#[mockall::automock]
#[async_trait::async_trait]
pub trait ForgeLike: std::fmt::Debug + Send + Sync {
fn duplicate(&self) -> Box<dyn ForgeLike>;
fn name(&self) -> String;
fn is_message_authorised(
&self,
message: &config::ForgeNotification,
expected: &config::WebhookAuth,
) -> bool;
fn should_ignore_message(&self, _message: &config::ForgeNotification) -> bool {
false
}
fn parse_webhook_body(
&self,
body: &config::webhook::forge_notification::Body,
) -> git::forge::webhook::Result<config::webhook::push::Push>;
async fn commit_status(&self, commit: &git::Commit) -> git::forge::commit::Status;
async fn list_webhooks(
&self,
url: &config::server::WebhookUrl,
) -> git::forge::webhook::Result<Vec<config::WebhookId>>;
async fn unregister_webhook(
&self,
webhook: &config::WebhookId,
) -> git::forge::webhook::Result<()>;
async fn register_webhook(
&self,
webhook_url: &config::server::WebhookUrl,
) -> git::forge::webhook::Result<config::RegisteredWebhook>;
}