Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/build/HarbormasterBuild.php
<?php | <?php | ||||
final class HarbormasterBuild extends HarbormasterDAO | final class HarbormasterBuild extends HarbormasterDAO | ||||
implements PhabricatorPolicyInterface { | implements PhabricatorPolicyInterface { | ||||
protected $buildablePHID; | protected $buildablePHID; | ||||
protected $buildPlanPHID; | protected $buildPlanPHID; | ||||
protected $buildStatus; | protected $buildStatus; | ||||
private $buildable = self::ATTACHABLE; | private $buildable = self::ATTACHABLE; | ||||
private $buildPlan = self::ATTACHABLE; | private $buildPlan = self::ATTACHABLE; | ||||
/** | |||||
* Not currently being built. | |||||
*/ | |||||
const STATUS_INACTIVE = 'inactive'; | |||||
/** | |||||
* Pending pick up by the Harbormaster daemon. | |||||
*/ | |||||
const STATUS_PENDING = 'pending'; | |||||
/** | |||||
* Waiting for a resource to be allocated (not yet relevant). | |||||
*/ | |||||
const STATUS_WAITING = 'waiting'; | |||||
/** | |||||
* Current building the buildable. | |||||
*/ | |||||
const STATUS_BUILDING = 'building'; | |||||
/** | |||||
* The build has passed. | |||||
*/ | |||||
const STATUS_PASSED = 'passed'; | |||||
/** | |||||
* The build has failed. | |||||
*/ | |||||
const STATUS_FAILED = 'failed'; | |||||
epriestley: These seem reasonable to me. Some other states we might need eventually:
- Error: we tried… | |||||
public static function initializeNewBuild(PhabricatorUser $actor) { | public static function initializeNewBuild(PhabricatorUser $actor) { | ||||
return id(new HarbormasterBuild()) | return id(new HarbormasterBuild()) | ||||
->setBuildStatus('building'); // TODO: Sort this. | ->setBuildStatus(self::STATUS_INACTIVE); | ||||
} | } | ||||
public function getConfiguration() { | public function getConfiguration() { | ||||
return array( | return array( | ||||
self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |
These seem reasonable to me. Some other states we might need eventually: