Paul Campbell
601e400300
Some checks failed
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
Rust / build (push) Has been cancelled
59 lines
1.5 KiB
Rust
59 lines
1.5 KiB
Rust
//
|
|
#![cfg(not(tarpaulin_include))]
|
|
|
|
use derive_more::Constructor;
|
|
use git_next_config as config;
|
|
use git_next_git as git;
|
|
|
|
#[derive(Clone, Debug, Constructor)]
|
|
pub struct MockForge;
|
|
|
|
#[async_trait::async_trait]
|
|
impl git::ForgeLike for MockForge {
|
|
fn name(&self) -> String {
|
|
"mock".to_string()
|
|
}
|
|
|
|
fn is_message_authorised(
|
|
&self,
|
|
_msg: &config::WebhookMessage,
|
|
_expected: &config::WebhookAuth,
|
|
) -> bool {
|
|
todo!("MockForge::is_message_authorised")
|
|
}
|
|
|
|
fn parse_webhook_body(
|
|
&self,
|
|
_body: &config::webhook::message::Body,
|
|
) -> git::forge::webhook::Result<config::webhook::push::Push> {
|
|
todo!("MockForge::parse_webhook_body")
|
|
}
|
|
|
|
async fn commit_status(&self, _commit: &git::Commit) -> git::forge::commit::Status {
|
|
todo!("MockForge::commit_status")
|
|
}
|
|
|
|
async fn list_webhooks(
|
|
&self,
|
|
_webhook_url: &config::server::WebhookUrl,
|
|
) -> git::forge::webhook::Result<Vec<config::WebhookId>> {
|
|
todo!("MockForge::list_webhooks")
|
|
}
|
|
|
|
async fn unregister_webhook(
|
|
&self,
|
|
_webhook_id: &config::WebhookId,
|
|
) -> git::forge::webhook::Result<()> {
|
|
todo!("MockForge::unregister_webhook")
|
|
}
|
|
|
|
async fn register_webhook(
|
|
&self,
|
|
_webhook_url: &config::server::WebhookUrl,
|
|
) -> git::forge::webhook::Result<config::RegisteredWebhook> {
|
|
Ok(config::RegisteredWebhook::new(
|
|
config::WebhookId::new(""),
|
|
config::WebhookAuth::new(ulid::Ulid::new()),
|
|
))
|
|
}
|
|
}
|