1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Remove "HarbormasterBuildCommand"

Summary: Ref T13072. Update the last few constant references to this class and remove it.

Test Plan: Grepped for "HarbormasterBuildCommand", got no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21692
This commit is contained in:
epriestley 2021-07-16 08:08:01 -07:00
parent 1212dc5fbe
commit 1a1395579f
5 changed files with 18 additions and 25 deletions

View file

@ -1387,7 +1387,6 @@ phutil_register_library_map(array(
'HarbormasterBuildArtifactPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildArtifactPHIDType.php',
'HarbormasterBuildArtifactQuery' => 'applications/harbormaster/query/HarbormasterBuildArtifactQuery.php',
'HarbormasterBuildAutoplan' => 'applications/harbormaster/autoplan/HarbormasterBuildAutoplan.php',
'HarbormasterBuildCommand' => 'applications/harbormaster/storage/HarbormasterBuildCommand.php',
'HarbormasterBuildDependencyDatasource' => 'applications/harbormaster/typeahead/HarbormasterBuildDependencyDatasource.php',
'HarbormasterBuildEngine' => 'applications/harbormaster/engine/HarbormasterBuildEngine.php',
'HarbormasterBuildFailureException' => 'applications/harbormaster/exception/HarbormasterBuildFailureException.php',
@ -7603,7 +7602,6 @@ phutil_register_library_map(array(
'HarbormasterBuildArtifactPHIDType' => 'PhabricatorPHIDType',
'HarbormasterBuildArtifactQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildAutoplan' => 'Phobject',
'HarbormasterBuildCommand' => 'Phobject',
'HarbormasterBuildDependencyDatasource' => 'PhabricatorTypeaheadDatasource',
'HarbormasterBuildEngine' => 'Phobject',
'HarbormasterBuildFailureException' => 'Exception',

View file

@ -122,7 +122,7 @@ EOTEXT
foreach ($abort_builds as $abort_build) {
$abort_build->sendMessage(
$viewer,
HarbormasterBuildCommand::COMMAND_ABORT);
HarbormasterBuildMessageAbortTransaction::MESSAGETYPE);
}
}

View file

@ -1,11 +0,0 @@
<?php
final class HarbormasterBuildCommand
extends Phobject {
const COMMAND_PAUSE = 'pause';
const COMMAND_RESUME = 'resume';
const COMMAND_RESTART = 'restart';
const COMMAND_ABORT = 'abort';
}

View file

@ -27,18 +27,22 @@ final class HarbormasterBuildableTransaction
$this->renderHandleLink($author_phid));
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildCommand::COMMAND_RESTART:
case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE:
return pht(
'%s restarted this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildCommand::COMMAND_RESUME:
case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE:
return pht(
'%s resumed this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildCommand::COMMAND_PAUSE:
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return pht(
'%s paused this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE:
return pht(
'%s aborted this buildable.',
$this->renderHandleLink($author_phid));
}
}
return parent::getTitle();
@ -55,12 +59,14 @@ final class HarbormasterBuildableTransaction
return 'fa-plus';
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildCommand::COMMAND_RESTART:
case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE:
return 'fa-backward';
case HarbormasterBuildCommand::COMMAND_RESUME:
case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE:
return 'fa-play';
case HarbormasterBuildCommand::COMMAND_PAUSE:
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return 'fa-pause';
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE:
return 'fa-exclamation-triangle';
}
}
@ -78,7 +84,7 @@ final class HarbormasterBuildableTransaction
return 'green';
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildCommand::COMMAND_PAUSE:
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return 'red';
}
}

View file

@ -272,22 +272,22 @@ final class HarbormasterBuild extends HarbormasterDAO
foreach ($this->getUnprocessedMessages() as $message_object) {
$message_type = $message_object->getType();
switch ($message_type) {
case HarbormasterBuildCommand::COMMAND_RESTART:
case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE:
$is_restarting = true;
$is_aborting = false;
$apply_messages = array($message_object);
break;
case HarbormasterBuildCommand::COMMAND_ABORT:
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE:
$is_aborting = true;
$is_restarting = false;
$apply_messages = array($message_object);
break;
case HarbormasterBuildCommand::COMMAND_PAUSE:
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
$is_pausing = true;
$is_resuming = false;
$apply_messages = array($message_object);
break;
case HarbormasterBuildCommand::COMMAND_RESUME:
case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE:
$is_resuming = true;
$is_pausing = false;
$apply_messages = array($message_object);