1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Expose Build Plan behaviors via "harbormaster.buildplan.search"

Summary: Ref T13258. This will support changing behaviors in "arc land".

Test Plan: Called "harbormaster.buildplan.search", saw behavior information in results.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13258

Differential Revision: https://secure.phabricator.com/D20228
This commit is contained in:
epriestley 2019-02-28 11:00:20 -08:00
parent d36d0efc35
commit 983cf885e7

View file

@ -233,15 +233,31 @@ final class HarbormasterBuildPlan extends HarbormasterDAO
->setKey('status')
->setType('map<string, wild>')
->setDescription(pht('The current status of this build plan.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('behaviors')
->setType('map<string, string>')
->setDescription(pht('Behavior configuration for the build plan.')),
);
}
public function getFieldValuesForConduit() {
$behavior_map = array();
$behaviors = HarbormasterBuildPlanBehavior::newPlanBehaviors();
foreach ($behaviors as $behavior) {
$option = $behavior->getPlanOption($this);
$behavior_map[$behavior->getKey()] = array(
'value' => $option->getKey(),
);
}
return array(
'name' => $this->getName(),
'status' => array(
'value' => $this->getPlanStatus(),
),
'behaviors' => $behavior_map,
);
}