1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

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
This commit is contained in:
epriestley 2017-03-20 08:33:43 -07:00
parent e69f8f717b
commit 216052baf9

View file

@ -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,