From 983cf885e7ce2d3765cd248c9ae43979bd074dcf Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 28 Feb 2019 11:00:20 -0800 Subject: [PATCH] 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 --- .../configuration/HarbormasterBuildPlan.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php index 8f8b0a20a8..faecb79a3a 100644 --- a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php +++ b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php @@ -233,15 +233,31 @@ final class HarbormasterBuildPlan extends HarbormasterDAO ->setKey('status') ->setType('map') ->setDescription(pht('The current status of this build plan.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('behaviors') + ->setType('map') + ->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, ); } -- 2.51.2