From d54ef5f265c064312bcd77745ffc06d536d1934e Mon Sep 17 00:00:00 2001 From: xmppftw Date: Tue, 23 Jun 2026 17:13:42 +0200 Subject: [PATCH] feat: gitlab feature --- Cargo.toml | 3 ++- src/hooks/mod.rs | 3 ++- src/web.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 429b19e..bb9548b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "AGPL-3.0+" [dependencies] clap = { version = "4.5", features = [ "cargo" ] } forgejo-hooks = "*" -gitlab = "0.1706" +gitlab = { version = "0.1706", optional = true } hyper = { version = "1.6", default-features = false, features = [ "http1", "server" ] } hyper-util = { version = "0.1", features = [ "tokio" ] } http-body-util = "0.1" @@ -34,4 +34,5 @@ git2 = "0.20" forgejo-hooks = { path = "forgejo-hooks" } [features] +gitlab = [ "dep:gitlab" ] syntax-highlighting = ["xmpp/syntax-highlighting"] diff --git a/src/hooks/mod.rs b/src/hooks/mod.rs index 8fcd544..68bf6c1 100644 --- a/src/hooks/mod.rs +++ b/src/hooks/mod.rs @@ -14,11 +14,12 @@ // along with this program. If not, see . mod forgejo; +#[cfg(feature = "gitlab")] mod gitlab; mod types; pub use crate::hooks::forgejo::ForgejoHook; -#[allow(deprecated)] +#[cfg(feature = "gitlab")] pub use crate::hooks::gitlab::GitlabHook; pub use crate::hooks::types::Hook; pub use crate::hooks::types::{IssueAction, MergeRequestAction, WikiAction}; diff --git a/src/web.rs b/src/web.rs index 83e0de8..3dc01f2 100644 --- a/src/web.rs +++ b/src/web.rs @@ -14,7 +14,7 @@ // along with this program. If not, see . use crate::error::Error; -#[allow(deprecated)] +#[cfg(feature = "gitlab")] use crate::hooks::GitlabHook; use crate::hooks::{ForgejoHook, Hook}; @@ -62,6 +62,7 @@ async fn hooks_inner(req: Request, secret: &str) -> Result