From 74e117ae41dd537485e1e5632913535f15c3a73f Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 23 May 2016 17:24:25 -0700 Subject: [PATCH] Don't send mail to "uninteresting" auditors Summary: Fixes T11017. We add packages as "uninteresting" auditors so that we can query commits by package later. Until recently, this didn't matter because we didn't send mail to packages. But now we do, so stop mailing them when they don't actually need to do anything. Test Plan: - Made a commit to a file which was part of a package but which I owned (so it does not trigger auditing). - `var_dump()`'d mail "To:" PHIDs. - Before patch: included package. - After patch: no package. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11017 Differential Revision: https://secure.phabricator.com/D15970 --- src/applications/audit/editor/PhabricatorAuditEditor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php index 8018e5314a..d795d4b97d 100644 --- a/src/applications/audit/editor/PhabricatorAuditEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditEditor.php @@ -642,6 +642,12 @@ final class PhabricatorAuditEditor $status_resigned = PhabricatorAuditStatusConstants::RESIGNED; foreach ($object->getAudits() as $audit) { + if (!$audit->isInteresting()) { + // Don't send mail to uninteresting auditors, like packages which + // own this code but which audits have not triggered for. + continue; + } + if ($audit->getAuditStatus() != $status_resigned) { $phids[] = $audit->getAuditorPHID(); }