Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

compliance: Temporarily fix the wrong compliance reports (#54401)

Finn Evers7c1078e49cb3
diff --git a/tooling/compliance/src/checks.rs b/tooling/compliance/src/checks.rs
index 409df5394f1..8db325d75b0 100644
--- a/tooling/compliance/src/checks.rs
+++ b/tooling/compliance/src/checks.rs
@@ -6,7 +6,7 @@ use crate::{
git::{CommitDetails, CommitList},
github::{
CommitAuthor, GithubApiClient, GithubLogin, PullRequestComment, PullRequestData,
- PullRequestReview, Repository, ReviewState,
+ PullRequestReview, Repository, ReviewState, ZED_ZIPPY_AUTHOR,
},
report::Report,
};
@@ -115,6 +115,10 @@ impl Reporter {
commit: &CommitDetails,
) -> Result<ReviewSuccess, ReviewFailure> {
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 f5b1a9c3296..eb26f354061 100644
--- a/tooling/compliance/src/git.rs
+++ b/tooling/compliance/src/git.rs
@@ -163,6 +163,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 edd2e4ea2e7..42c32592d08 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};
+use std::{borrow::Cow, collections::HashMap, fmt, ops::Not, sync::LazyLock};
use anyhow::Result;
use derive_more::Deref;
@@ -73,6 +73,14 @@ pub struct CommitAuthor {
user: Option<GithubLogin>,
}
+pub(crate) static ZED_ZIPPY_AUTHOR: LazyLock<CommitAuthor> = 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()