mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
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
This commit is contained in:
parent
7c502e3e4e
commit
511485169a
1 changed files with 13 additions and 1 deletions
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue