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

Return commit information for Revision "close" and "update" transactions over the Conduit API

Summary: Depends on D19175. Ref T13099. This fills in "close" and "update" transactions so that they show which commit(s) caused the action.

Test Plan: Used `transaction.search` to query some revisions, saw commit PHID information.

Maniphest Tasks: T13099

Differential Revision: https://secure.phabricator.com/D19176
This commit is contained in:
epriestley 2018-03-06 08:40:34 -08:00
parent 743d1ac426
commit f392896209
3 changed files with 35 additions and 1 deletions

View file

@ -284,7 +284,8 @@ final class DifferentialDiffExtractionEngine extends Phobject {
->setTransactionType($type_update)
->setIgnoreOnNoEffect(true)
->setNewValue($new_diff->getPHID())
->setMetadataValue('isCommitUpdate', true);
->setMetadataValue('isCommitUpdate', true)
->setMetadataValue('commitPHIDs', array($commit->getPHID()));
foreach ($more_xactions as $more_xaction) {
$xactions[] = $more_xaction;

View file

@ -136,4 +136,23 @@ final class DifferentialRevisionCloseTransaction
$this->renderObject());
}
public function getTransactionTypeForConduit($xaction) {
return 'close';
}
public function getFieldValuesForConduit($object, $data) {
$commit_phid = $object->getMetadataValue('commitPHID');
if ($commit_phid) {
$commit_phids = array($commit_phid);
} else {
$commit_phids = array();
}
return array(
'commitPHIDs' => $commit_phids,
);
}
}

View file

@ -182,4 +182,18 @@ final class DifferentialRevisionUpdateTransaction
}
}
public function getTransactionTypeForConduit($xaction) {
return 'update';
}
public function getFieldValuesForConduit($object, $data) {
$commit_phids = $object->getMetadataValue('commitPHIDs', array());
return array(
'old' => $object->getOldValue(),
'new' => $object->getNewValue(),
'commitPHIDs' => $commit_phids,
);
}
}