From 4dd707b1898da527ca92de3492af98544e9f1cb5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 23 Jul 2012 09:24:02 -0700 Subject: [PATCH] Include explicit "Auditors:" in initial Diffusion email Summary: See https://groups.google.com/forum/?hl=en_US&fromgroups#!topic/phabricator-dev/ZonbTN-0TGw When a commit's author explicitly specifies users as "Auditors", send them an email about the commit. Test Plan: Made a commit with "Auditors: turtle", ran "reparse.php --herald" on it, verified user "turtle" got included in the intial email. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran, MarkChuCarroll Differential Revision: https://secure.phabricator.com/D3032 --- .../PhabricatorRepositoryCommitHeraldWorker.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php index b73bab67e8..8e0a93bc10 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php @@ -50,7 +50,7 @@ final class PhabricatorRepositoryCommitHeraldWorker $this->createAudits($commit, $audit_phids, $rules); } - $this->createAuditsFromCommitMessage($commit, $data); + $explicit_auditors = $this->createAuditsFromCommitMessage($commit, $data); if ($repository->getDetail('herald-disabled')) { // This just means "disable email"; audits are (mostly) idempotent. @@ -59,7 +59,12 @@ final class PhabricatorRepositoryCommitHeraldWorker $this->publishFeedStory($repository, $commit, $data); - $email_phids = $adapter->getEmailPHIDs(); + $herald_targets = $adapter->getEmailPHIDs(); + + $email_phids = array_unique( + array_merge( + $explicit_auditors, + $herald_targets)); if (!$email_phids) { return; } @@ -255,6 +260,8 @@ final class PhabricatorRepositoryCommitHeraldWorker $commit->updateAuditStatus($requests); $commit->save(); + + return $phids; } private function publishFeedStory(