From 5fd48be23d82d0aa0bbc6dc771ccb7e6348ff862 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 7 Apr 2020 13:12:49 -0700 Subject: [PATCH] tasks/eval/nixpkgs: don't request review from PR author GitHub doesn't let us, so we silently skip them. --- ofborg/src/tasks/eval/nixpkgs.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ofborg/src/tasks/eval/nixpkgs.rs b/ofborg/src/tasks/eval/nixpkgs.rs index 2cb64c2..d8b73dd 100644 --- a/ofborg/src/tasks/eval/nixpkgs.rs +++ b/ofborg/src/tasks/eval/nixpkgs.rs @@ -566,8 +566,18 @@ impl<'a> EvaluationStrategy for NixpkgsStrategy<'a> { } fn request_reviews(maint: &maintainers::ImpactedMaintainers, pull: &hubcaps::pulls::PullRequest) { + let pull_meta = pull.get(); + if maint.maintainers().len() < 10 { for maintainer in maint.maintainers() { + if let Ok(meta) = &pull_meta { + // GitHub doesn't let us request a review from the PR author, so + // we silently skip them. + if meta.user.login.to_ascii_lowercase() == maintainer.to_ascii_lowercase() { + continue; + } + } + if let Err(e) = pull.review_requests() .create(&hubcaps::review_requests::ReviewRequestOptions {