diff --git a/tooling/compliance/src/checks.rs b/tooling/compliance/src/checks.rs index cda37a84d2ae70de5fa5891c2dcd1d15fc2a9080..421daab202d972230a20de65a8c5ace9e737d276 100644 --- a/tooling/compliance/src/checks.rs +++ b/tooling/compliance/src/checks.rs @@ -6,7 +6,7 @@ use crate::{ git::{CommitDetails, CommitList}, github::{ CommitAuthor, GithubClient, GithubLogin, PullRequestComment, PullRequestData, - PullRequestReview, Repository, ReviewState, + PullRequestReview, Repository, ReviewState, ZED_ZIPPY_AUTHOR, }, report::Report, }; @@ -106,6 +106,10 @@ impl<'a> Reporter<'a> { commit: &CommitDetails, ) -> Result { let Some(pr_number) = commit.pr_number() else { + if commit.author().name().contains("Zed Zippy") && commit.title().starts_with("Bump to") + { + return Ok(ReviewSuccess::CoAuthored(vec![ZED_ZIPPY_AUTHOR.clone()])); + } return Err(ReviewFailure::NoPullRequestFound); }; diff --git a/tooling/compliance/src/git.rs b/tooling/compliance/src/git.rs index e2581b1c7fa79ae43ad3b01d3f755df2a7bbc508..1527f09209b3f452c615840a2899357247622fa1 100644 --- a/tooling/compliance/src/git.rs +++ b/tooling/compliance/src/git.rs @@ -151,6 +151,10 @@ impl Committer { email: email.to_owned(), } } + + pub fn name(&self) -> &str { + &self.name + } } impl fmt::Display for Committer { diff --git a/tooling/compliance/src/github.rs b/tooling/compliance/src/github.rs index 29e22c92fc831a7eb1f0e5cda9c3f93ef3a681b2..c175690b19e9ab07b6a52de9f6677911d8777131 100644 --- a/tooling/compliance/src/github.rs +++ b/tooling/compliance/src/github.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, collections::HashMap, fmt, ops::Not, rc::Rc}; +use std::{borrow::Cow, collections::HashMap, fmt, ops::Not, rc::Rc, sync::LazyLock}; use anyhow::Result; use derive_more::Deref; @@ -73,6 +73,14 @@ pub struct CommitAuthor { user: Option, } +pub(crate) static ZED_ZIPPY_AUTHOR: LazyLock = LazyLock::new(|| CommitAuthor { + name: "Zed Zippy".to_string(), + email: "234243425+zed-zippy[bot]@users.noreply.github.com".to_string(), + user: Some(GithubLogin { + login: "zed-zippy[bot]".to_string(), + }), +}); + impl CommitAuthor { pub(crate) fn user(&self) -> Option<&GithubLogin> { self.user.as_ref()