mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
Pick some preset build statuses
Summary: We're picking three useful groups of build statuses to provide as default queries: - Stuff not yet building - Stuff building - Stuff which has finished building These are reasonable buckets for builds since (unlike most objects in phabricatorland) users are generally waiting impatiently for the machine to do something for them, rather than being responsible for doing something with the machine. Test Plan: clicked around the search engine and enjoyed my defaults Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D16349
This commit is contained in:
parent
42b81a8090
commit
33fca12816
3 changed files with 45 additions and 10 deletions
|
@ -118,4 +118,28 @@ final class HarbormasterBuildStatus extends Phobject {
|
|||
}
|
||||
}
|
||||
|
||||
public static function getWaitingStatusConstants() {
|
||||
return array(
|
||||
self::STATUS_INACTIVE,
|
||||
self::STATUS_PENDING,
|
||||
);
|
||||
}
|
||||
|
||||
public static function getActiveStatusConstants() {
|
||||
return array(
|
||||
self::STATUS_BUILDING,
|
||||
self::STATUS_PAUSED,
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCompletedStatusConstants() {
|
||||
return array(
|
||||
self::STATUS_PASSED,
|
||||
self::STATUS_FAILED,
|
||||
self::STATUS_ABORTED,
|
||||
self::STATUS_ERROR,
|
||||
self::STATUS_DEADLOCKED,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,6 +55,9 @@ final class HarbormasterBuildSearchEngine
|
|||
protected function getBuiltinQueryNames() {
|
||||
return array(
|
||||
'all' => pht('All Builds'),
|
||||
'waiting' => pht('Waiting'),
|
||||
'active' => pht('Active'),
|
||||
'completed' => pht('Completed'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -65,6 +68,21 @@ final class HarbormasterBuildSearchEngine
|
|||
switch ($query_key) {
|
||||
case 'all':
|
||||
return $query;
|
||||
case 'waiting':
|
||||
return $query
|
||||
->setParameter(
|
||||
'statuses',
|
||||
HarbormasterBuildStatus::getWaitingStatusConstants());
|
||||
case 'active':
|
||||
return $query
|
||||
->setParameter(
|
||||
'statuses',
|
||||
HarbormasterBuildStatus::getActiveStatusConstants());
|
||||
case 'completed':
|
||||
return $query
|
||||
->setParameter(
|
||||
'statuses',
|
||||
HarbormasterBuildStatus::getCompletedStatusConstants());
|
||||
}
|
||||
|
||||
return parent::buildSavedQueryFromBuiltin($query_key);
|
||||
|
|
|
@ -169,16 +169,9 @@ final class HarbormasterBuild extends HarbormasterDAO
|
|||
}
|
||||
|
||||
public function isComplete() {
|
||||
switch ($this->getBuildStatus()) {
|
||||
case HarbormasterBuildStatus::STATUS_PASSED:
|
||||
case HarbormasterBuildStatus::STATUS_FAILED:
|
||||
case HarbormasterBuildStatus::STATUS_ABORTED:
|
||||
case HarbormasterBuildStatus::STATUS_ERROR:
|
||||
case HarbormasterBuildStatus::STATUS_PAUSED:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return in_array(
|
||||
$this->getBuildStatus(),
|
||||
HarbormasterBuildStatus::getCompletedStatusConstants());
|
||||
}
|
||||
|
||||
public function isPaused() {
|
||||
|
|
Loading…
Reference in a new issue