From 511485169aa223f72ea1c586fc1b78a93f3aaf59 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 10 May 2013 10:17:03 -0700 Subject: [PATCH] Add 'dependsOn' array to `ConduitApi_maniphest_Method::buildTaskInfoDictionaries()` return Summary: Adds the PHIDs of the tasks that the current task depends on. Test Plan: Use conduit to query a task with and without tasks it depends on. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5892 --- .../conduit/ConduitAPI_maniphest_Method.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php index ce40e62d74..a4551668ce 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php @@ -207,16 +207,27 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod { return array(); } + $task_phids = mpull($tasks, 'getPHID'); + $all_aux = id(new ManiphestTaskAuxiliaryStorage())->loadAllWhere( 'taskPHID in (%Ls)', - mpull($tasks, 'getPHID')); + $task_phids); $all_aux = mgroup($all_aux, 'getTaskPHID'); + $all_deps = id(new PhabricatorEdgeQuery()) + ->withSourcePHIDs($task_phids) + ->withEdgeTypes(array(PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK)); + $all_deps->execute(); + $result = array(); foreach ($tasks as $task) { $auxiliary = idx($all_aux, $task->getPHID(), array()); $auxiliary = mpull($auxiliary, 'getValue', 'getName'); + $task_deps = $all_deps->getDestinationPHIDs( + array($task->getPHID()), + array(PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK)); + $result[$task->getPHID()] = array( 'id' => $task->getID(), 'phid' => $task->getPHID(), @@ -235,6 +246,7 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod { 'objectName' => 'T'.$task->getID(), 'dateCreated' => $task->getDateCreated(), 'dateModified' => $task->getDateModified(), + 'dependsOnTaskPHIDs' => $task_deps, ); }