From c63768044559aee8c236064d8cf4ef1cc3067a9c Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 19 Jan 2018 16:02:53 -0800 Subject: [PATCH] Show related objects on daemon worker task queue detail pages Summary: See PHI287. Currently, you can't get very much information about a task in the worker queue from the web UI. This is largely intentional (e.g., it's bad if we let you inspect the content of a "send an administrator's password reset email" task), and a lot of the data is task-class specific so it would be a lot of work to expose it, but we can add one useful piece of information pretty easily: for tasks with an `objectPHID` that points at a valid object that's visible to the user, tell the user which object the task is associated with. Test Plan: {F5386562} Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18890 --- .../PhabricatorWorkerTaskDetailController.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php index 85c2f2f87e..e18c2d725e 100644 --- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php +++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php @@ -79,13 +79,20 @@ final class PhabricatorWorkerTaskDetailController ->appendChild($view); } - private function buildPropertyListView( - PhabricatorWorkerTask $task) { - - $viewer = $this->getRequest()->getUser(); + private function buildPropertyListView(PhabricatorWorkerTask $task) { + $viewer = $this->getViewer(); $view = new PHUIPropertyListView(); + $object_phid = $task->getObjectPHID(); + if ($object_phid) { + $handles = $viewer->loadHandles(array($object_phid)); + $handle = $handles[$object_phid]; + if ($handle->isComplete()) { + $view->addProperty(pht('Object'), $handle->renderLink()); + } + } + if ($task->isArchived()) { switch ($task->getResult()) { case PhabricatorWorkerArchiveTask::RESULT_SUCCESS: