@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Mike Riley and committed by
yelirekim
33fca128 42b81a80

+45 -10
+24
src/applications/harbormaster/constants/HarbormasterBuildStatus.php
··· 118 118 } 119 119 } 120 120 121 + public static function getWaitingStatusConstants() { 122 + return array( 123 + self::STATUS_INACTIVE, 124 + self::STATUS_PENDING, 125 + ); 126 + } 127 + 128 + public static function getActiveStatusConstants() { 129 + return array( 130 + self::STATUS_BUILDING, 131 + self::STATUS_PAUSED, 132 + ); 133 + } 134 + 135 + public static function getCompletedStatusConstants() { 136 + return array( 137 + self::STATUS_PASSED, 138 + self::STATUS_FAILED, 139 + self::STATUS_ABORTED, 140 + self::STATUS_ERROR, 141 + self::STATUS_DEADLOCKED, 142 + ); 143 + } 144 + 121 145 }
+18
src/applications/harbormaster/query/HarbormasterBuildSearchEngine.php
··· 55 55 protected function getBuiltinQueryNames() { 56 56 return array( 57 57 'all' => pht('All Builds'), 58 + 'waiting' => pht('Waiting'), 59 + 'active' => pht('Active'), 60 + 'completed' => pht('Completed'), 58 61 ); 59 62 } 60 63 ··· 65 68 switch ($query_key) { 66 69 case 'all': 67 70 return $query; 71 + case 'waiting': 72 + return $query 73 + ->setParameter( 74 + 'statuses', 75 + HarbormasterBuildStatus::getWaitingStatusConstants()); 76 + case 'active': 77 + return $query 78 + ->setParameter( 79 + 'statuses', 80 + HarbormasterBuildStatus::getActiveStatusConstants()); 81 + case 'completed': 82 + return $query 83 + ->setParameter( 84 + 'statuses', 85 + HarbormasterBuildStatus::getCompletedStatusConstants()); 68 86 } 69 87 70 88 return parent::buildSavedQueryFromBuiltin($query_key);
+3 -10
src/applications/harbormaster/storage/build/HarbormasterBuild.php
··· 169 169 } 170 170 171 171 public function isComplete() { 172 - switch ($this->getBuildStatus()) { 173 - case HarbormasterBuildStatus::STATUS_PASSED: 174 - case HarbormasterBuildStatus::STATUS_FAILED: 175 - case HarbormasterBuildStatus::STATUS_ABORTED: 176 - case HarbormasterBuildStatus::STATUS_ERROR: 177 - case HarbormasterBuildStatus::STATUS_PAUSED: 178 - return true; 179 - } 180 - 181 - return false; 172 + return in_array( 173 + $this->getBuildStatus(), 174 + HarbormasterBuildStatus::getCompletedStatusConstants()); 182 175 } 183 176 184 177 public function isPaused() {