From beaf0ad9a6360154d5c3f79e2e7eb62b553dcf5b Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 24 Oct 2017 09:10:48 -0700 Subject: [PATCH] Attribute revision promotion from "Draft" to "Needs Review" to the author Summary: Ref T2543. When Harbormaster finishes builds and promotes a draft revision to review, we currently publish "Harbormaster requested review of...". Instead, attribute this action to the author, since that's more natural and more useful. Test Plan: Promoted a diff locally, saw it attributed to me rather than Harbormaster. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T2543 Differential Revision: https://secure.phabricator.com/D18730 --- .../differential/editor/DifferentialTransactionEditor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index 7c9bb01b07..5e013eff43 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -1537,7 +1537,13 @@ final class DifferentialTransactionEditor if ($object->isDraft() && $auto_undraft) { $active_builds = $this->hasActiveBuilds($object); if (!$active_builds) { + // When Harbormaster moves a revision out of the draft state, we + // attribute the action to the revision author since this is more + // natural and more useful. + $author_phid = $object->getAuthorPHID(); + $xaction = $object->getApplicationTransactionTemplate() + ->setAuthorPHID($author_phid) ->setTransactionType( DifferentialRevisionRequestReviewTransaction::TRANSACTIONTYPE) ->setOldValue(false)