1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Show an info view warning for ongoing or failed builds in Differential

Summary:
Fixes T10136. This reinforces ongoing or failed builds in the comment action area.

We already emit a similar message for unit test failures from `arc unit`. This should probably obsolete that, eventually.

Test Plan:
{F2304809}

{F2304810}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10136

Differential Revision: https://secure.phabricator.com/D17140
This commit is contained in:
epriestley 2017-01-04 14:05:25 -08:00
parent 10171e2101
commit 2855470b31

View file

@ -32,9 +32,31 @@ final class DifferentialUnitField
}
public function getWarningsForDetailView() {
$status = $this->getObject()->getActiveDiff()->getUnitStatus();
$warnings = array();
$viewer = $this->getViewer();
$diff = $this->getObject()->getActiveDiff();
$buildable = id(new HarbormasterBuildableQuery())
->setViewer($viewer)
->withBuildablePHIDs(array($diff->getPHID()))
->withManualBuildables(false)
->executeOne();
if ($buildable) {
switch ($buildable->getBuildableStatus()) {
case HarbormasterBuildable::STATUS_BUILDING:
$warnings[] = pht(
'These changes have not finished building yet and may have build '.
'failures.');
break;
case HarbormasterBuildable::STATUS_FAILED:
$warnings[] = pht(
'These changes have failed to build.');
break;
}
}
$status = $this->getObject()->getActiveDiff()->getUnitStatus();
if ($status < DifferentialUnitStatus::UNIT_WARN) {
// Don't show any warnings.
} else if ($status == DifferentialUnitStatus::UNIT_AUTO_SKIP) {