1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +01:00

Add "Revision test plan" as a Herald field; remove test plan from the "Revision summary" field

Summary:
See PHI844. Ref T13189.

Add "Revision test plan" as an available field for Herald. This is a little niche -- and a little odd because it sticks around even if you fully disable test plans -- but probably broadly reasonable.

The existing "Revision summary" field counterintuitively included the test plan. Separate this out since it's now a separate field and the behavior was weird historic nonsense. I'll note this in the changelog.

Test Plan: Wrote a rule using both fields, verified they generated the expected values.

Reviewers: amckinley

Maniphest Tasks: T13189

Differential Revision: https://secure.phabricator.com/D19623
This commit is contained in:
epriestley 2018-08-29 14:11:35 -07:00
parent 876638e428
commit 75a0455152
3 changed files with 23 additions and 4 deletions

View file

@ -644,6 +644,7 @@ phutil_register_library_map(array(
'DifferentialRevisionStatusTransaction' => 'applications/differential/xaction/DifferentialRevisionStatusTransaction.php',
'DifferentialRevisionSummaryHeraldField' => 'applications/differential/herald/DifferentialRevisionSummaryHeraldField.php',
'DifferentialRevisionSummaryTransaction' => 'applications/differential/xaction/DifferentialRevisionSummaryTransaction.php',
'DifferentialRevisionTestPlanHeraldField' => 'applications/differential/herald/DifferentialRevisionTestPlanHeraldField.php',
'DifferentialRevisionTestPlanTransaction' => 'applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php',
'DifferentialRevisionTitleHeraldField' => 'applications/differential/herald/DifferentialRevisionTitleHeraldField.php',
'DifferentialRevisionTitleTransaction' => 'applications/differential/xaction/DifferentialRevisionTitleTransaction.php',
@ -6004,6 +6005,7 @@ phutil_register_library_map(array(
'DifferentialRevisionStatusTransaction' => 'DifferentialRevisionTransactionType',
'DifferentialRevisionSummaryHeraldField' => 'DifferentialRevisionHeraldField',
'DifferentialRevisionSummaryTransaction' => 'DifferentialRevisionTransactionType',
'DifferentialRevisionTestPlanHeraldField' => 'DifferentialRevisionHeraldField',
'DifferentialRevisionTestPlanTransaction' => 'DifferentialRevisionTransactionType',
'DifferentialRevisionTitleHeraldField' => 'DifferentialRevisionHeraldField',
'DifferentialRevisionTitleTransaction' => 'DifferentialRevisionTransactionType',

View file

@ -10,10 +10,7 @@ final class DifferentialRevisionSummaryHeraldField
}
public function getHeraldFieldValue($object) {
// NOTE: For historical reasons, this field includes the test plan. We
// could maybe try to fix this some day, but it probably aligns reasonably
// well with user expectation without harming anything.
return $object->getSummary()."\n\n".$object->getTestPlan();
return $object->getSummary();
}
protected function getHeraldFieldStandardType() {

View file

@ -0,0 +1,20 @@
<?php
final class DifferentialRevisionTestPlanHeraldField
extends DifferentialRevisionHeraldField {
const FIELDCONST = 'differential.revision.test-plan';
public function getHeraldFieldName() {
return pht('Revision test plan');
}
public function getHeraldFieldValue($object) {
return $object->getTestPlan();
}
protected function getHeraldFieldStandardType() {
return self::STANDARD_TEXT;
}
}