mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +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:
parent
e69f8f717b
commit
216052baf9
1 changed files with 7 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue