Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/engine/HarbormasterBuildEngine.php
Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | $buildable = id(new HarbormasterBuildableQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($buildable->getID())) | ->withIDs(array($buildable->getID())) | ||||
->needBuilds(true) | ->needBuilds(true) | ||||
->executeOne(); | ->executeOne(); | ||||
$all_pass = true; | $all_pass = true; | ||||
$any_fail = false; | $any_fail = false; | ||||
foreach ($buildable->getBuilds() as $build) { | foreach ($buildable->getBuilds() as $build) { | ||||
if ($build->getBuildStatus() != HarbormasterBuildStatus::STATUS_PASSED) { | if (!$build->isPassed()) { | ||||
$all_pass = false; | $all_pass = false; | ||||
} | } | ||||
if (in_array($build->getBuildStatus(), array( | |||||
HarbormasterBuildStatus::STATUS_FAILED, | |||||
HarbormasterBuildStatus::STATUS_ERROR, | |||||
HarbormasterBuildStatus::STATUS_DEADLOCKED, | |||||
))) { | |||||
if ($build->isComplete() && !$build->isPassed()) { | |||||
$any_fail = true; | $any_fail = true; | ||||
} | } | ||||
} | } | ||||
if ($any_fail) { | if ($any_fail) { | ||||
$new_status = HarbormasterBuildable::STATUS_FAILED; | $new_status = HarbormasterBuildable::STATUS_FAILED; | ||||
} else if ($all_pass) { | } else if ($all_pass) { | ||||
$new_status = HarbormasterBuildable::STATUS_PASSED; | $new_status = HarbormasterBuildable::STATUS_PASSED; | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |