1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Sketch out unit/lint displaying on builds

Summary: Ref T8096. Show basic lint/unit info on builds. This is still pretty rough.

Test Plan: {F524839}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8096

Differential Revision: https://secure.phabricator.com/D13383
This commit is contained in:
epriestley 2015-06-21 14:37:34 -07:00
parent c31e25d5ce
commit c4eef3dfcb
3 changed files with 59 additions and 2 deletions

View file

@ -25,6 +25,8 @@ final class HarbormasterBuildableViewController
->needBuildTargets(true)
->execute();
list($lint, $unit) = $this->renderLintAndUnit($builds);
$buildable->attachBuilds($builds);
$object = $buildable->getBuildableObject();
@ -55,6 +57,8 @@ final class HarbormasterBuildableViewController
array(
$crumbs,
$box,
$lint,
$unit,
$build_list,
$timeline,
),
@ -251,4 +255,57 @@ final class HarbormasterBuildableViewController
return $box;
}
private function renderLintAndUnit(array $builds) {
$viewer = $this->getViewer();
$targets = array();
foreach ($builds as $build) {
foreach ($build->getBuildTargets() as $target) {
$targets[] = $target;
}
}
if (!$targets) {
return;
}
$target_phids = mpull($targets, 'getPHID');
$lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere(
'buildTargetPHID IN (%Ls) LIMIT 25',
$target_phids);
$unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere(
'buildTargetPHID IN (%Ls) LIMIT 25',
$target_phids);
if ($lint_data) {
$lint_table = id(new HarbormasterLintPropertyView())
->setUser($viewer)
->setLintMessages($lint_data);
$lint = id(new PHUIObjectBoxView())
->setHeaderText(pht('Lint Messages'))
->appendChild($lint_table);
} else {
$lint = null;
}
if ($unit_data) {
$unit_table = id(new HarbormasterUnitPropertyView())
->setUser($viewer)
->setUnitMessages($unit_data);
$unit = id(new PHUIObjectBoxView())
->setHeaderText(pht('Unit Tests'))
->appendChild($unit_table);
} else {
$unit = null;
}
return array($lint, $unit);
}
}

View file

@ -2,7 +2,7 @@
final class HarbormasterLintPropertyView extends AphrontView {
private $pathURIMap;
private $pathURIMap = array();
private $lintMessages = array();
public function setPathURIMap(array $map) {

View file

@ -2,7 +2,7 @@
final class HarbormasterUnitPropertyView extends AphrontView {
private $pathURIMap;
private $pathURIMap = array();
private $unitMessages = array();
public function setPathURIMap(array $map) {