From e4b1e8e6816599d2b8cce7a1bc228ed99d51c689 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 25 Jan 2014 14:23:23 -0800 Subject: [PATCH] Use `user.query`, not `user.find`, in `arc tasks` Summary: I'm going to deprecate `user.find`, `user.query` is more modern/powerful and obsoletes it. Test Plan: Ran `arc tasks --owner epriestley`. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D8070 --- src/workflow/ArcanistTasksWorkflow.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/workflow/ArcanistTasksWorkflow.php b/src/workflow/ArcanistTasksWorkflow.php index 8eaad207..a97d0689 100644 --- a/src/workflow/ArcanistTasksWorkflow.php +++ b/src/workflow/ArcanistTasksWorkflow.php @@ -228,13 +228,18 @@ EOTEXT private function findOwnerPHID($owner) { $conduit = $this->getConduit(); - $owner_phid = $conduit->callMethodSynchronous( - 'user.find', + $users = $conduit->callMethodSynchronous( + 'user.query', array( - 'aliases' => array($owner), + 'usernames' => array($owner), )); - return idx($owner_phid, $owner); + if (!$users) { + return null; + } + + $user = head($users); + return idx($user, 'phid'); } private function loadManiphestTasks($status, $owner_phid, $order, $limit) {