From a9cbbf3e5e151d345318a66d6b0dd0de804fb64c Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 20 Mar 2017 09:13:07 -0700 Subject: [PATCH] Apply Owners reviewers using ModularTransactions Summary: Ref T10967. See that task for some discussion. This lets us do double writes on this pathway. Test Plan: Set an Owners package to auto-review. Created revisions which triggered it: one with no reviewers (autoreview added); one with the package as a blocking reviewer explicitly (no automatic stuff happened, as expected). Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17512 --- .../editor/DifferentialTransactionEditor.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index 85a44669c8..19c2de8ec0 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -1687,22 +1687,21 @@ final class DifferentialTransactionEditor $value = array(); foreach ($phids as $phid) { - $value[$phid] = array( - 'data' => array( - 'status' => $new_status, - ), - ); + if ($is_blocking) { + $value[] = 'blocking('.$phid.')'; + } else { + $value[] = $phid; + } } - $edgetype_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST; - $owners_phid = id(new PhabricatorOwnersApplication()) ->getPHID(); + $reviewers_type = DifferentialRevisionReviewersTransaction::TRANSACTIONTYPE; + return $object->getApplicationTransactionTemplate() ->setAuthorPHID($owners_phid) - ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) - ->setMetadataValue('edge:type', $edgetype_reviewer) + ->setTransactionType($reviewers_type) ->setNewValue( array( '+' => $value,