mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-08 12:58:31 +01:00
716bd4e4b4
Summary: Ref T8096. Various tweaks here: - Sort result lists by importance (even lint -- "errors first" seems better than "alphabetical by file", I think?). - Do sane stuff with display limits. - Add a "view all" view. - Don't show a huge table of passing tests in Differential. - Link to full results. Test Plan: See screenshots. Reviewers: chad, btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8096 Differential Revision: https://secure.phabricator.com/D13407
64 lines
1.5 KiB
PHP
64 lines
1.5 KiB
PHP
<?php
|
|
|
|
final class HarbormasterLintMessagesController
|
|
extends HarbormasterController {
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $this->getViewer();
|
|
|
|
$buildable = id(new HarbormasterBuildableQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($request->getURIData('id')))
|
|
->needBuilds(true)
|
|
->needTargets(true)
|
|
->executeOne();
|
|
if (!$buildable) {
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
$id = $buildable->getID();
|
|
|
|
$target_phids = array();
|
|
foreach ($buildable->getBuilds() as $build) {
|
|
foreach ($build->getBuildTargets() as $target) {
|
|
$target_phids[] = $target->getPHID();
|
|
}
|
|
}
|
|
|
|
$lint_data = array();
|
|
if ($target_phids) {
|
|
$lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere(
|
|
'buildTargetPHID IN (%Ls)',
|
|
$target_phids);
|
|
} else {
|
|
$lint_data = array();
|
|
}
|
|
|
|
$lint_table = id(new HarbormasterLintPropertyView())
|
|
->setUser($viewer)
|
|
->setLintMessages($lint_data);
|
|
|
|
$lint = id(new PHUIObjectBoxView())
|
|
->setHeaderText(pht('Lint Messages'))
|
|
->appendChild($lint_table);
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
$this->addBuildableCrumb($crumbs, $buildable);
|
|
$crumbs->addTextCrumb(pht('Lint'));
|
|
|
|
$title = array(
|
|
$buildable->getMonogram(),
|
|
pht('Lint'),
|
|
);
|
|
|
|
return $this->buildApplicationPage(
|
|
array(
|
|
$crumbs,
|
|
$lint,
|
|
),
|
|
array(
|
|
'title' => $title,
|
|
));
|
|
}
|
|
|
|
}
|