1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

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
This commit is contained in:
epriestley 2017-03-20 09:13:07 -07:00
parent 216052baf9
commit a9cbbf3e5e

View file

@ -1687,22 +1687,21 @@ final class DifferentialTransactionEditor
$value = array(); $value = array();
foreach ($phids as $phid) { foreach ($phids as $phid) {
$value[$phid] = array( if ($is_blocking) {
'data' => array( $value[] = 'blocking('.$phid.')';
'status' => $new_status, } else {
), $value[] = $phid;
); }
} }
$edgetype_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
$owners_phid = id(new PhabricatorOwnersApplication()) $owners_phid = id(new PhabricatorOwnersApplication())
->getPHID(); ->getPHID();
$reviewers_type = DifferentialRevisionReviewersTransaction::TRANSACTIONTYPE;
return $object->getApplicationTransactionTemplate() return $object->getApplicationTransactionTemplate()
->setAuthorPHID($owners_phid) ->setAuthorPHID($owners_phid)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType($reviewers_type)
->setMetadataValue('edge:type', $edgetype_reviewer)
->setNewValue( ->setNewValue(
array( array(
'+' => $value, '+' => $value,