From 216052baf982bfe3cca22d992fdf59efcf4ef424 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 20 Mar 2017 08:33:43 -0700 Subject: [PATCH] Apply reviewer changes from Herald via ModularTransactions Summary: Ref T10967. This converts the reviewer update action in Herald from an older edge write to a newer ModularTransactions write. The major value from this is that we get a double-write to the new reviewers table. Test Plan: - Wrote a Herald rule to add a reviewer and a blocking reviewer. - Saw them added properly to a revision with: no reviewers; both as blocking; A as blocking, B as nonblocking; A as nonblocking, B as blocking. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17511 --- .../herald/DifferentialReviewersHeraldAction.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/applications/differential/herald/DifferentialReviewersHeraldAction.php b/src/applications/differential/herald/DifferentialReviewersHeraldAction.php index 3e98fdd92f..6574455465 100644 --- a/src/applications/differential/herald/DifferentialReviewersHeraldAction.php +++ b/src/applications/differential/herald/DifferentialReviewersHeraldAction.php @@ -81,18 +81,17 @@ abstract class DifferentialReviewersHeraldAction $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; + $reviewers_type = DifferentialRevisionReviewersTransaction::TRANSACTIONTYPE; $xaction = $adapter->newTransaction() - ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) - ->setMetadataValue('edge:type', $edgetype_reviewer) + ->setTransactionType($reviewers_type) ->setNewValue( array( '+' => $value,