id = $data['id']; } public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $task = id(new PhabricatorWorkerTask())->load($this->id); if (!$task) { $error_view = new AphrontErrorView(); $error_view->setTitle('No Such Task'); $error_view->appendChild( '

This task may have recently completed.

'); $error_view->setSeverity(AphrontErrorView::SEVERITY_WARNING); return $this->buildStandardPageResponse( $error_view, array( 'title' => 'Task Does Not Exist', )); } $data = id(new PhabricatorWorkerTaskData())->loadOneWhere( 'id = %d', $task->getDataID()); $extra = null; switch ($task->getTaskClass()) { case 'PhabricatorRepositorySvnCommitChangeParserWorker': case 'PhabricatorRepositoryGitCommitChangeParserWorker': $commit_id = idx($data->getData(), 'commitID'); if ($commit_id) { $commit = id(new PhabricatorRepositoryCommit())->load($commit_id); if ($commit) { $repository = id(new PhabricatorRepository())->load( $commit->getRepositoryID()); if ($repository) { $extra = "NOTE: ". "You can manually retry this task by running this script:". "
".
                  "phabricator/\$ ./scripts/repository/reparse.php ".
                  "r".
                  phutil_escape_html($repository->getCallsign()).
                  phutil_escape_html($commit->getCommitIdentifier()).
                  " ".
                  "--change".
                "
"; } } } break; default: break; } if ($data) { $data = json_encode($data->getData()); } $form = id(new AphrontFormView()) ->setUser($user) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('ID') ->setValue($task->getID())) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Type') ->setValue($task->getTaskClass())) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Lease Owner') ->setValue($task->getLeaseOwner())) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Lease Expires') ->setValue($task->getLeaseExpires() - time())) ->appendChild( id(new AphrontFormStaticControl()) ->setLabel('Failure Count') ->setValue($task->getFailureCount())) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel('Data') ->setValue($data)); if ($extra) { $form->appendChild( id(new AphrontFormMarkupControl()) ->setLabel('More') ->setValue($extra)); } $form ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton('/daemon/', 'Back')); $panel = new AphrontPanelView(); $panel->setHeader('Task Detail'); $panel->setWidth(AphrontPanelView::WIDTH_WIDE); $panel->appendChild($form); $panel->addButton( javelin_render_tag( 'a', array( 'href' => '/daemon/task/'.$task->getID().'/delete/', 'class' => 'button grey', 'sigil' => 'workflow', ), 'Delete Task')); $panel->addButton( javelin_render_tag( 'a', array( 'href' => '/daemon/task/'.$task->getID().'/release/', 'class' => 'button grey', 'sigil' => 'workflow', ), 'Free Lease')); return $this->buildStandardPageResponse( $panel, array( 'title' => 'Task', )); } }