Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/plan/HarbormasterBuildPlanBehavior.php
Show All 16 Lines | final class HarbormasterBuildPlanBehavior | ||||
const RESTARTABLE_ALWAYS = 'always'; | const RESTARTABLE_ALWAYS = 'always'; | ||||
const RESTARTABLE_NEVER = 'never'; | const RESTARTABLE_NEVER = 'never'; | ||||
const BEHAVIOR_DRAFTS = 'hold-drafts'; | const BEHAVIOR_DRAFTS = 'hold-drafts'; | ||||
const DRAFTS_ALWAYS = 'always'; | const DRAFTS_ALWAYS = 'always'; | ||||
const DRAFTS_IF_BUILDING = 'building'; | const DRAFTS_IF_BUILDING = 'building'; | ||||
const DRAFTS_NEVER = 'never'; | const DRAFTS_NEVER = 'never'; | ||||
const BEHAVIOR_BUILDABLE = 'buildable'; | |||||
const BUILDABLE_ALWAYS = 'always'; | |||||
const BUILDABLE_IF_BUILDING = 'building'; | |||||
const BUILDABLE_NEVER = 'never'; | |||||
public function setKey($key) { | public function setKey($key) { | ||||
$this->key = $key; | $this->key = $key; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getKey() { | public function getKey() { | ||||
return $this->key; | return $this->key; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | $land_options = array( | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'"arc land" never warns that the build is still running or '. | '"arc land" never warns that the build is still running or '. | ||||
'has failed.')), | 'has failed.')), | ||||
); | ); | ||||
$aggregate_options = array( | $aggregate_options = array( | ||||
id(new HarbormasterBuildPlanBehaviorOption()) | id(new HarbormasterBuildPlanBehaviorOption()) | ||||
->setKey('always') | ->setKey(self::BUILDABLE_ALWAYS) | ||||
->setIcon('fa-check-circle-o green') | ->setIcon('fa-check-circle-o green') | ||||
->setName(pht('Always')) | ->setName(pht('Always')) | ||||
->setIsDefault(true) | ->setIsDefault(true) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'The buildable waits for the build, and fails if the '. | 'The buildable waits for the build, and fails if the '. | ||||
'build fails.')), | 'build fails.')), | ||||
id(new HarbormasterBuildPlanBehaviorOption()) | id(new HarbormasterBuildPlanBehaviorOption()) | ||||
->setKey('building') | ->setKey(self::BUILDABLE_IF_BUILDING) | ||||
->setIcon('fa-pause-circle-o yellow') | ->setIcon('fa-pause-circle-o yellow') | ||||
->setName(pht('If Building')) | ->setName(pht('If Building')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'The buildable waits for the build, but does not fail '. | 'The buildable waits for the build, but does not fail '. | ||||
'if the build fails.')), | 'if the build fails.')), | ||||
id(new HarbormasterBuildPlanBehaviorOption()) | id(new HarbormasterBuildPlanBehaviorOption()) | ||||
->setKey('never') | ->setKey(self::BUILDABLE_NEVER) | ||||
->setIcon('fa-circle-o red') | ->setIcon('fa-circle-o red') | ||||
->setName(pht('Never')) | ->setName(pht('Never')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'The buildable does not wait for the build.')), | 'The buildable does not wait for the build.')), | ||||
); | ); | ||||
$restart_options = array( | $restart_options = array( | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | $behaviors = array( | ||||
'change the warning behavior. This may be useful if the build '. | 'change the warning behavior. This may be useful if the build '. | ||||
'takes a long time to run (so you do not expect users to wait '. | 'takes a long time to run (so you do not expect users to wait '. | ||||
'for it) or the outcome is not important.'. | 'for it) or the outcome is not important.'. | ||||
"\n\n". | "\n\n". | ||||
'This warning is only advisory. Users may always elect to ignore '. | 'This warning is only advisory. Users may always elect to ignore '. | ||||
'this warning and continue, even if builds have failed.')) | 'this warning and continue, even if builds have failed.')) | ||||
->setOptions($land_options), | ->setOptions($land_options), | ||||
id(new self()) | id(new self()) | ||||
->setKey('buildable') | ->setKey(self::BEHAVIOR_BUILDABLE) | ||||
->setEditInstructions( | ->setEditInstructions( | ||||
pht( | pht( | ||||
'The overall state of a buildable (like a commit or revision) is '. | 'The overall state of a buildable (like a commit or revision) is '. | ||||
'normally the aggregation of the individual states of all builds '. | 'normally the aggregation of the individual states of all builds '. | ||||
'that have run against it.'. | 'that have run against it.'. | ||||
"\n\n". | "\n\n". | ||||
'Buildables are "building" until all builds pass (which changes '. | 'Buildables are "building" until all builds pass (which changes '. | ||||
'them to "pass"), or any build fails (which changes them to '. | 'them to "pass"), or any build fails (which changes them to '. | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |