Differential D11870 Diff 34163 src/applications/harbormaster/controller/HarbormasterBuildableActionController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildableActionController.php
Show All 33 Lines | public function processRequest() { | ||||
foreach ($buildable->getBuilds() as $build) { | foreach ($buildable->getBuilds() as $build) { | ||||
switch ($command) { | switch ($command) { | ||||
case HarbormasterBuildCommand::COMMAND_RESTART: | case HarbormasterBuildCommand::COMMAND_RESTART: | ||||
if ($build->canRestartBuild()) { | if ($build->canRestartBuild()) { | ||||
$issuable[] = $build; | $issuable[] = $build; | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_STOP: | case HarbormasterBuildCommand::COMMAND_PAUSE: | ||||
if ($build->canStopBuild()) { | if ($build->canPauseBuild()) { | ||||
$issuable[] = $build; | $issuable[] = $build; | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildCommand::COMMAND_RESUME: | ||||
if ($build->canResumeBuild()) { | if ($build->canResumeBuild()) { | ||||
$issuable[] = $build; | $issuable[] = $build; | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_ABORT: | |||||
if ($build->canAbortBuild()) { | |||||
$issuable[] = $build; | |||||
} | |||||
break; | |||||
default: | default: | ||||
return new Aphront400Response(); | return new Aphront400Response(); | ||||
} | } | ||||
} | } | ||||
$return_uri = '/'.$buildable->getMonogram(); | $return_uri = '/'.$buildable->getMonogram(); | ||||
if ($request->isDialogFormPost() && $issuable) { | if ($request->isDialogFormPost() && $issuable) { | ||||
$editor = id(new HarbormasterBuildableTransactionEditor()) | $editor = id(new HarbormasterBuildableTransactionEditor()) | ||||
Show All 29 Lines | switch ($command) { | ||||
if ($issuable) { | if ($issuable) { | ||||
$title = pht('Really restart all builds?'); | $title = pht('Really restart all builds?'); | ||||
$body = pht( | $body = pht( | ||||
'Progress on all builds will be discarded, and all builds will '. | 'Progress on all builds will be discarded, and all builds will '. | ||||
'restart. Side effects of the builds will occur again. Really '. | 'restart. Side effects of the builds will occur again. Really '. | ||||
'restart all builds?'); | 'restart all builds?'); | ||||
$submit = pht('Restart All Builds'); | $submit = pht('Restart All Builds'); | ||||
} else { | } else { | ||||
$title = pht('Unable to Restart Build'); | $title = pht('Unable to Restart Builds'); | ||||
$body = pht('No builds can be restarted.'); | $body = pht('No builds can be restarted.'); | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_STOP: | case HarbormasterBuildCommand::COMMAND_PAUSE: | ||||
if ($issuable) { | if ($issuable) { | ||||
$title = pht('Really stop all builds?'); | $title = pht('Really pause all builds?'); | ||||
$body = pht( | $body = pht( | ||||
'If you stop all build, work will halt once the current steps '. | 'If you pause all builds, work will halt once the current steps '. | ||||
'complete. You can resume the builds later.'); | 'complete. You can resume the builds later.'); | ||||
$submit = pht('Stop All Builds'); | $submit = pht('Pause All Builds'); | ||||
} else { | |||||
$title = pht('Unable to Pause Builds'); | |||||
$body = pht('No builds can be paused.'); | |||||
} | |||||
break; | |||||
case HarbormasterBuildCommand::COMMAND_ABORT: | |||||
if ($issuable) { | |||||
$title = pht('Really abort all builds?'); | |||||
$body = pht( | |||||
'If you abort all builds, work will halt immediately. Work '. | |||||
'will be discarded, and builds must be completely restarted.'); | |||||
$submit = pht('Abort All Builds'); | |||||
} else { | } else { | ||||
$title = pht('Unable to Stop Build'); | $title = pht('Unable to Abort Builds'); | ||||
$body = pht('No builds can be stopped.'); | $body = pht('No builds can be aborted.'); | ||||
} | } | ||||
break; | break; | ||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildCommand::COMMAND_RESUME: | ||||
if ($issuable) { | if ($issuable) { | ||||
$title = pht('Really resume all builds?'); | $title = pht('Really resume all builds?'); | ||||
$body = pht('Work will continue on all builds. Really resume?'); | $body = pht('Work will continue on all builds. Really resume?'); | ||||
$submit = pht('Resume All Builds'); | $submit = pht('Resume All Builds'); | ||||
epriestley: and work will be discarded and builds can not be resumed and must be completely restarted | |||||
} else { | } else { | ||||
$title = pht('Unable to Resume Build'); | $title = pht('Unable to Resume Builds'); | ||||
$body = pht('No builds can be resumed.'); | $body = pht('No builds can be resumed.'); | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
$dialog = id(new AphrontDialogView()) | $dialog = id(new AphrontDialogView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setTitle($title) | ->setTitle($title) | ||||
Show All 11 Lines |
and work will be discarded and builds can not be resumed and must be completely restarted