Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialUnitField.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public function renderDiffPropertyViewValue(DifferentialDiff $diff) { | ||||
foreach ($keys as $key) { | foreach ($keys as $key) { | ||||
$diff->attachProperty($key, idx($properties, $key)); | $diff->attachProperty($key, idx($properties, $key)); | ||||
} | } | ||||
$status = $this->renderUnitStatus($diff); | $status = $this->renderUnitStatus($diff); | ||||
$unit = array(); | $unit = array(); | ||||
// TODO: Look for Harbormaster results here. | $buildable = $diff->getBuildable(); | ||||
if ($buildable) { | |||||
$target_phids = array(); | |||||
foreach ($buildable->getBuilds() as $build) { | |||||
foreach ($build->getBuildTargets() as $target) { | |||||
$target_phids[] = $target->getPHID(); | |||||
} | |||||
} | |||||
$unit = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | |||||
'buildTargetPHID IN (%Ls) LIMIT 25', | |||||
$target_phids); | |||||
} | |||||
if (!$unit) { | if (!$unit) { | ||||
$legacy_unit = $diff->getProperty('arc:unit'); | $legacy_unit = $diff->getProperty('arc:unit'); | ||||
if ($legacy_unit) { | if ($legacy_unit) { | ||||
// Show the top 100 legacy unit messages. | // Show the top 100 legacy unit messages. | ||||
$legacy_unit = array_slice($legacy_unit, 0, 100); | $legacy_unit = array_slice($legacy_unit, 0, 100); | ||||
$target = new HarbormasterBuildTarget(); | $target = new HarbormasterBuildTarget(); | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |