diff --git a/tooling/compliance/src/git.rs b/tooling/compliance/src/git.rs index ed2ff137f3..aeea0b2f26 100644 --- a/tooling/compliance/src/git.rs +++ b/tooling/compliance/src/git.rs @@ -273,7 +273,7 @@ impl CommitDetails { &self.title } - pub(crate) fn sha(&self) -> &CommitSha { + pub fn sha(&self) -> &CommitSha { &self.sha } diff --git a/tooling/compliance/src/report.rs b/tooling/compliance/src/report.rs index 7d11567202..4de67a0010 100644 --- a/tooling/compliance/src/report.rs +++ b/tooling/compliance/src/report.rs @@ -53,6 +53,12 @@ impl ReportEntry { } } +impl ReportEntry { + pub fn is_unknown_error(&self) -> bool { + matches!(self.reason, Err(ReviewFailure::Other(_))) + } +} + impl ReportEntry { fn issue_kind(&self) -> IssueKind { match self.reason { @@ -115,7 +121,7 @@ impl ReportSummary { .count(), errors: entries .iter() - .filter(|entry| matches!(entry.reason, Err(ReviewFailure::Other(_)))) + .filter(|entry| entry.is_unknown_error()) .count(), } } diff --git a/tooling/xtask/src/tasks/compliance.rs b/tooling/xtask/src/tasks/compliance.rs index 5a4b03a961..f4ae8593e3 100644 --- a/tooling/xtask/src/tasks/compliance.rs +++ b/tooling/xtask/src/tasks/compliance.rs @@ -18,6 +18,10 @@ pub(crate) struct ComplianceArgs { mode: ComplianceMode, } +const IGNORE_LIST: &[&str] = &[ + "75fa566511e3ae7d03cfd76008512080291bd81d", // GitHub nuked this PR out of orbit +]; + #[derive(Subcommand)] pub(crate) enum ComplianceMode { // Check compliance for all commits between two version tags @@ -133,6 +137,10 @@ async fn check_compliance_impl(args: ComplianceArgs) -> Result<()> { summary.prs_with_errors() ); + let all_errors_known = report.errors().all(|error| { + error.is_unknown_error() && IGNORE_LIST.contains(&error.commit.sha().as_str()) + }); + for report in report.errors() { if let Some(pr_number) = report.commit.pr_number() && let Ok(pull_request) = client.get_pull_request(&Repository::ZED, pr_number).await @@ -163,6 +171,14 @@ async fn check_compliance_impl(args: ComplianceArgs) -> Result<()> { "Compliance check failed, found {} commits not reviewed", summary.not_reviewed )), + ReportReviewSummary::MissingReviewsWithErrors if all_errors_known => { + println!( + "Compliance check failed with {} unreviewed commits, but all errors are known.", + summary.not_reviewed + ); + + Ok(()) + } ReportReviewSummary::MissingReviewsWithErrors => Err(anyhow::anyhow!( "Compliance check failed with {} unreviewed commits and {} other issues", summary.not_reviewed,