Allow deprecated elements from gitlab crate

We know they exist. There's no obvious replacement for the moment, so
they'll just stop working when they stop working.

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2025-03-11 12:31:39 +01:00
commit 5b5de13db0
3 changed files with 7 additions and 1 deletions

View file

@ -13,6 +13,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#![allow(deprecated)]
use crate::hooks::types::{
Commit, Hook, Issue, IssueAction, IssueAttrs, MergeRequest, MergeRequestAction,
MergeRequestAttrs, Note, Push, Repository, User, Wiki, WikiAction,

View file

@ -18,6 +18,7 @@ mod gitlab;
mod types;
pub use crate::hooks::forgejo::ForgejoHook;
#[allow(deprecated)]
pub use crate::hooks::gitlab::GitlabHook;
pub use crate::hooks::types::Hook;
use crate::hooks::types::{IssueAction, MergeRequestAction, WikiAction};

View file

@ -14,7 +14,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::error::Error;
use crate::hooks::{ForgejoHook, GitlabHook, Hook};
#[allow(deprecated)]
use crate::hooks::GitlabHook;
use crate::hooks::{ForgejoHook, Hook};
use std::convert::Infallible;
use std::io::Read;
@ -66,6 +68,7 @@ async fn hooks_inner(req: Request<Incoming>, secret: &str) -> Result<Hook, Error
}
trace!("Payload: {:?}", std::str::from_utf8(&payload));
#[allow(deprecated)]
let hook: GitlabHook = serde_json::from_slice(&payload[..])?;
debug!("Found Gitlab payload");
return Ok(Hook::try_from(hook)?);