@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+59 -2
+57
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
··· 25 25 ->needBuildTargets(true) 26 26 ->execute(); 27 27 28 + list($lint, $unit) = $this->renderLintAndUnit($builds); 29 + 28 30 $buildable->attachBuilds($builds); 29 31 $object = $buildable->getBuildableObject(); 30 32 ··· 55 57 array( 56 58 $crumbs, 57 59 $box, 60 + $lint, 61 + $unit, 58 62 $build_list, 59 63 $timeline, 60 64 ), ··· 250 254 251 255 return $box; 252 256 } 257 + 258 + private function renderLintAndUnit(array $builds) { 259 + $viewer = $this->getViewer(); 260 + 261 + $targets = array(); 262 + foreach ($builds as $build) { 263 + foreach ($build->getBuildTargets() as $target) { 264 + $targets[] = $target; 265 + } 266 + } 267 + 268 + if (!$targets) { 269 + return; 270 + } 271 + 272 + $target_phids = mpull($targets, 'getPHID'); 273 + 274 + $lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere( 275 + 'buildTargetPHID IN (%Ls) LIMIT 25', 276 + $target_phids); 277 + 278 + $unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere( 279 + 'buildTargetPHID IN (%Ls) LIMIT 25', 280 + $target_phids); 281 + 282 + if ($lint_data) { 283 + $lint_table = id(new HarbormasterLintPropertyView()) 284 + ->setUser($viewer) 285 + ->setLintMessages($lint_data); 286 + 287 + $lint = id(new PHUIObjectBoxView()) 288 + ->setHeaderText(pht('Lint Messages')) 289 + ->appendChild($lint_table); 290 + } else { 291 + $lint = null; 292 + } 293 + 294 + if ($unit_data) { 295 + $unit_table = id(new HarbormasterUnitPropertyView()) 296 + ->setUser($viewer) 297 + ->setUnitMessages($unit_data); 298 + 299 + $unit = id(new PHUIObjectBoxView()) 300 + ->setHeaderText(pht('Unit Tests')) 301 + ->appendChild($unit_table); 302 + } else { 303 + $unit = null; 304 + } 305 + 306 + return array($lint, $unit); 307 + } 308 + 309 + 253 310 254 311 }
+1 -1
src/applications/harbormaster/view/HarbormasterLintPropertyView.php
··· 2 2 3 3 final class HarbormasterLintPropertyView extends AphrontView { 4 4 5 - private $pathURIMap; 5 + private $pathURIMap = array(); 6 6 private $lintMessages = array(); 7 7 8 8 public function setPathURIMap(array $map) {
+1 -1
src/applications/harbormaster/view/HarbormasterUnitPropertyView.php
··· 2 2 3 3 final class HarbormasterUnitPropertyView extends AphrontView { 4 4 5 - private $pathURIMap; 5 + private $pathURIMap = array(); 6 6 private $unitMessages = array(); 7 7 8 8 public function setPathURIMap(array $map) {