Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialRevision.php
| Show First 20 Lines • Show All 715 Lines • ▼ Show 20 Lines | $buildables = id(new HarbormasterBuildableQuery()) | ||||
| ->withContainerPHIDs(array($this->getPHID())) | ->withContainerPHIDs(array($this->getPHID())) | ||||
| ->withBuildablePHIDs(array($diff->getPHID())) | ->withBuildablePHIDs(array($diff->getPHID())) | ||||
| ->withManualBuildables(false) | ->withManualBuildables(false) | ||||
| ->execute(); | ->execute(); | ||||
| if (!$buildables) { | if (!$buildables) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| $builds = id(new HarbormasterBuildQuery()) | return id(new HarbormasterBuildQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withBuildablePHIDs(mpull($buildables, 'getPHID')) | ->withBuildablePHIDs(mpull($buildables, 'getPHID')) | ||||
| ->withAutobuilds(false) | |||||
| ->withBuildStatuses( | ->withBuildStatuses( | ||||
| array( | array( | ||||
| HarbormasterBuildStatus::STATUS_INACTIVE, | HarbormasterBuildStatus::STATUS_INACTIVE, | ||||
| HarbormasterBuildStatus::STATUS_PENDING, | HarbormasterBuildStatus::STATUS_PENDING, | ||||
| HarbormasterBuildStatus::STATUS_BUILDING, | HarbormasterBuildStatus::STATUS_BUILDING, | ||||
| HarbormasterBuildStatus::STATUS_FAILED, | HarbormasterBuildStatus::STATUS_FAILED, | ||||
| HarbormasterBuildStatus::STATUS_ABORTED, | HarbormasterBuildStatus::STATUS_ABORTED, | ||||
| HarbormasterBuildStatus::STATUS_ERROR, | HarbormasterBuildStatus::STATUS_ERROR, | ||||
| HarbormasterBuildStatus::STATUS_PAUSED, | HarbormasterBuildStatus::STATUS_PAUSED, | ||||
| HarbormasterBuildStatus::STATUS_DEADLOCKED, | HarbormasterBuildStatus::STATUS_DEADLOCKED, | ||||
| )) | )) | ||||
| ->needBuildTargets(true) | |||||
| ->execute(); | ->execute(); | ||||
| if (!$builds) { | |||||
| return array(); | |||||
| } | |||||
| $active = array(); | |||||
| foreach ($builds as $key => $build) { | |||||
| foreach ($build->getBuildTargets() as $target) { | |||||
| if ($target->isAutotarget()) { | |||||
| // Ignore autotargets when looking for active of failed builds. If | |||||
| // local tests fail and you continue anyway, you don't need to | |||||
| // double-confirm them. | |||||
| continue; | |||||
| } | |||||
| // This build has at least one real target that's doing something. | |||||
| $active[$key] = $build; | |||||
| break; | |||||
| } | |||||
| } | |||||
| return $active; | |||||
| } | } | ||||
| /* -( HarbormasterBuildableInterface )------------------------------------- */ | /* -( HarbormasterBuildableInterface )------------------------------------- */ | ||||
| public function getHarbormasterBuildableDisplayPHID() { | public function getHarbormasterBuildableDisplayPHID() { | ||||
| return $this->getHarbormasterContainerPHID(); | return $this->getHarbormasterContainerPHID(); | ||||
| ▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines | |||||