Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/controller/DifferentialController.php
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | protected function loadDiffProperties(array $diffs) { | ||||
foreach ($diffs as $id => $diff) { | foreach ($diffs as $id => $diff) { | ||||
$values = idx($properties, $id, array()); | $values = idx($properties, $id, array()); | ||||
$values = mpull($values, 'getData', 'getName'); | $values = mpull($values, 'getData', 'getName'); | ||||
$diff->attachDiffProperties($values); | $diff->attachDiffProperties($values); | ||||
} | } | ||||
} | } | ||||
protected function loadHarbormasterBuilds(array $diffs) { | |||||
protected function loadHarbormasterData(array $diffs) { | |||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$diffs = mpull($diffs, null, 'getPHID'); | $diffs = mpull($diffs, null, 'getPHID'); | ||||
$buildables = id(new HarbormasterBuildableQuery()) | $buildables = id(new HarbormasterBuildableQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withBuildablePHIDs(array_keys($diffs)) | ->withBuildablePHIDs(array_keys($diffs)) | ||||
->withManualBuildables(false) | ->withManualBuildables(false) | ||||
->needBuilds(true) | ->needBuilds(true) | ||||
->needTargets(true) | ->needTargets(true) | ||||
->execute(); | ->execute(); | ||||
$buildables = mpull($buildables, null, 'getBuildablePHID'); | $buildables = mpull($buildables, null, 'getBuildablePHID'); | ||||
foreach ($diffs as $phid => $diff) { | foreach ($diffs as $phid => $diff) { | ||||
$diff->attachBuildable(idx($buildables, $phid)); | $diff->attachBuildable(idx($buildables, $phid)); | ||||
} | } | ||||
} | |||||
protected function loadHarbormasterData(array $diffs) { | |||||
$diffs = mpull($diffs, null, 'getPHID'); | |||||
$target_map = array(); | $target_map = array(); | ||||
foreach ($diffs as $phid => $diff) { | foreach ($diffs as $phid => $diff) { | ||||
$target_map[$phid] = $diff->getBuildTargetPHIDs(); | $target_map[$phid] = $diff->getBuildTargetPHIDs(); | ||||
} | } | ||||
$all_target_phids = array_mergev($target_map); | $all_target_phids = array_mergev($target_map); | ||||
// T10635: most of this information is already aggregated in BuildTarget. | |||||
if ($all_target_phids) { | if ($all_target_phids) { | ||||
$unit_messages = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | $unit_messages = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | ||||
'buildTargetPHID IN (%Ls)', | 'buildTargetPHID IN (%Ls)', | ||||
$all_target_phids); | $all_target_phids); | ||||
$unit_messages = mgroup($unit_messages, 'getBuildTargetPHID'); | $unit_messages = mgroup($unit_messages, 'getBuildTargetPHID'); | ||||
} else { | } else { | ||||
$unit_messages = array(); | $unit_messages = array(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |