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

Enrich "draft", "summary", and "testPlan" transactions from Differential in "transaction.search"

Summary:
See PHI1232, which describes a reasonable use case for wanting information about the "draft" ("Hold as Draft / Do Not Auto-Promote") flag.

Also, flesh out "testPlan" and "summary". It's possible these "blob of remarkup" fields might have metadata some day (e.g., a rendered version or a list of PHIDs or something), but we could add more keys, and we already have some other transactions which work like this.

Test Plan: Used "transaction.search" to fetch these transaction types, saw type information and metadata.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20507
This commit is contained in:
epriestley 2019-05-09 09:04:45 -07:00
parent 18f0f8b029
commit 4a3481a493
5 changed files with 40 additions and 7 deletions

View file

@ -55,4 +55,15 @@ final class DifferentialRevisionHoldDraftTransaction
}
}
public function getTransactionTypeForConduit($xaction) {
return 'draft';
}
public function getFieldValuesForConduit($xaction, $data) {
return array(
'old' => $xaction->getOldValue(),
'new' => $xaction->getNewValue(),
);
}
}

View file

@ -61,4 +61,15 @@ final class DifferentialRevisionSummaryTransaction
pht('Summary'));
}
public function getTransactionTypeForConduit($xaction) {
return 'summary';
}
public function getFieldValuesForConduit($xaction, $data) {
return array(
'old' => $xaction->getOldValue(),
'new' => $xaction->getNewValue(),
);
}
}

View file

@ -75,4 +75,15 @@ final class DifferentialRevisionTestPlanTransaction
return $errors;
}
public function getTransactionTypeForConduit($xaction) {
return 'testPlan';
}
public function getFieldValuesForConduit($xaction, $data) {
return array(
'old' => $xaction->getOldValue(),
'new' => $xaction->getNewValue(),
);
}
}

View file

@ -59,10 +59,10 @@ final class DifferentialRevisionTitleTransaction
return 'title';
}
public function getFieldValuesForConduit($object, $data) {
public function getFieldValuesForConduit($xaction, $data) {
return array(
'old' => $object->getOldValue(),
'new' => $object->getNewValue(),
'old' => $xaction->getOldValue(),
'new' => $xaction->getNewValue(),
);
}

View file

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