Skip to content

Commit ac19c55

Browse files
author
epriestley
committedDec 26, 2013
Formalize "manual" buildables in Harbormaster
Summary: Ref T1049. Generally, it's useful to separate test/trial/manual runs from production/automatic runs. For example, you don't want to email a bunch of people that the build is broken just because you messed something up when writing a new build plan. You'd rather try it first, then promote it into production once you have some good runs. Similarly, test runs generally should not affect the outside world, etc. Finally, some build steps (like "wait for other buildables") may want to behave differently when run in production/automation than when run in a testing environment (where they should probably continue immediately). So, formalize the distinction between automatic buildables (those created passively by the system in response to events) and manual buildables (those created explicitly by users). Add filtering, and stop the automated parts of the system from interacting with the manual parts (for example, we won't show manual results on revisions). This also moves the "Apply Build Plan" to a third, new home: instead of the sidebar or Buildables, it's now on plans. I think this generally makes more sense given how things have developed. Broadly, this improves isolation of test environments. Test Plan: Created some builds, browsed around, used filters, etc. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1049 Differential Revision: https://secure.phabricator.com/D7824
1 parent 4a56e26 commit ac19c55

14 files changed

+175
-235
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildable
2+
ADD isManualBuildable BOOL NOT NULL;
3+
4+
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildable
5+
ADD KEY `key_manual` (isManualBuildable);
6+

‎src/__phutil_library_map__.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,6 @@
707707
'HarbormasterBuildViewController' => 'applications/harbormaster/controller/HarbormasterBuildViewController.php',
708708
'HarbormasterBuildWorker' => 'applications/harbormaster/worker/HarbormasterBuildWorker.php',
709709
'HarbormasterBuildable' => 'applications/harbormaster/storage/HarbormasterBuildable.php',
710-
'HarbormasterBuildableApplyController' => 'applications/harbormaster/controller/HarbormasterBuildableApplyController.php',
711-
'HarbormasterBuildableEditController' => 'applications/harbormaster/controller/HarbormasterBuildableEditController.php',
712710
'HarbormasterBuildableListController' => 'applications/harbormaster/controller/HarbormasterBuildableListController.php',
713711
'HarbormasterBuildableQuery' => 'applications/harbormaster/query/HarbormasterBuildableQuery.php',
714712
'HarbormasterBuildableSearchEngine' => 'applications/harbormaster/query/HarbormasterBuildableSearchEngine.php',
@@ -730,6 +728,7 @@
730728
'HarbormasterPlanEditController' => 'applications/harbormaster/controller/HarbormasterPlanEditController.php',
731729
'HarbormasterPlanListController' => 'applications/harbormaster/controller/HarbormasterPlanListController.php',
732730
'HarbormasterPlanOrderController' => 'applications/harbormaster/controller/HarbormasterPlanOrderController.php',
731+
'HarbormasterPlanRunController' => 'applications/harbormaster/controller/HarbormasterPlanRunController.php',
733732
'HarbormasterPlanViewController' => 'applications/harbormaster/controller/HarbormasterPlanViewController.php',
734733
'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php',
735734
'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php',
@@ -3133,8 +3132,6 @@
31333132
0 => 'HarbormasterDAO',
31343133
1 => 'PhabricatorPolicyInterface',
31353134
),
3136-
'HarbormasterBuildableApplyController' => 'HarbormasterController',
3137-
'HarbormasterBuildableEditController' => 'HarbormasterController',
31383135
'HarbormasterBuildableListController' =>
31393136
array(
31403137
0 => 'HarbormasterController',
@@ -3164,6 +3161,7 @@
31643161
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
31653162
),
31663163
'HarbormasterPlanOrderController' => 'HarbormasterController',
3164+
'HarbormasterPlanRunController' => 'HarbormasterController',
31673165
'HarbormasterPlanViewController' => 'HarbormasterPlanController',
31683166
'HarbormasterRemarkupRule' => 'PhabricatorRemarkupRuleObject',
31693167
'HarbormasterScratchTable' => 'HarbormasterDAO',

‎src/applications/harbormaster/application/PhabricatorApplicationHarbormaster.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ public function getRoutes() {
4848
'/harbormaster/' => array(
4949
'(?:query/(?P<queryKey>[^/]+)/)?'
5050
=> 'HarbormasterBuildableListController',
51-
'buildable/' => array(
52-
'edit/(?:(?P<id>\d+)/)?' => 'HarbormasterBuildableEditController',
53-
'apply/(?:(?P<id>\d+)/)?' => 'HarbormasterBuildableApplyController',
54-
),
5551
'step/' => array(
5652
'add/(?:(?P<id>\d+)/)?' => 'HarbormasterStepAddController',
5753
'edit/(?:(?P<id>\d+)/)?' => 'HarbormasterStepEditController',
@@ -67,6 +63,7 @@ public function getRoutes() {
6763
'edit/(?:(?P<id>\d+)/)?' => 'HarbormasterPlanEditController',
6864
'order/(?:(?P<id>\d+)/)?' => 'HarbormasterPlanOrderController',
6965
'disable/(?P<id>\d+)/' => 'HarbormasterPlanDisableController',
66+
'run/(?P<id>\d+)/' => 'HarbormasterPlanRunController',
7067
'(?P<id>\d+)/' => 'HarbormasterPlanViewController',
7168
),
7269
),

‎src/applications/harbormaster/controller/HarbormasterBuildableApplyController.php

-74
This file was deleted.

‎src/applications/harbormaster/controller/HarbormasterBuildableEditController.php

-140
This file was deleted.

‎src/applications/harbormaster/controller/HarbormasterBuildableListController.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ public function renderResultsList(
4444
$item->setHref("/B{$id}");
4545
}
4646

47+
if ($buildable->getIsManualBuildable()) {
48+
$item->addIcon('wrench-grey', pht('Manual'));
49+
}
50+
4751
$list->addItem($item);
4852

53+
54+
4955
// TODO: This is proof-of-concept for getting meaningful status
5056
// information into this list, and should get an improvement pass
5157
// once we're a little farther along.
@@ -86,8 +92,7 @@ public function buildSideNavView($for_app = false) {
8692
$nav->addFilter('new/', pht('New Build Plan'));
8793
}
8894

89-
$nav->addLabel('Utilities');
90-
$nav->addFilter('buildable/edit/', pht('New Manual Build'));
95+
$nav->addLabel(pht('Build Plans'));
9196
$nav->addFilter('plan/', pht('Manage Build Plans'));
9297

9398
$nav->selectFilter(null);

‎src/applications/harbormaster/controller/HarbormasterBuildableViewController.php

+6-9
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,6 @@ private function buildActionList(HarbormasterBuildable $buildable) {
118118
->setObject($buildable)
119119
->setObjectURI("/B{$id}");
120120

121-
$apply_uri = $this->getApplicationURI('/buildable/apply/'.$id.'/');
122-
123-
$list->addAction(
124-
id(new PhabricatorActionView())
125-
->setName(pht('Apply Build Plan'))
126-
->setIcon('edit')
127-
->setHref($apply_uri)
128-
->setWorkflow(true));
129-
130121
return $list;
131122
}
132123

@@ -153,6 +144,12 @@ private function buildPropertyLists(
153144
$buildable->getContainerHandle()->renderLink());
154145
}
155146

147+
$properties->addProperty(
148+
pht('Origin'),
149+
$buildable->getIsManualBuildable()
150+
? pht('Manual Buildable')
151+
: pht('Automatic Buildable'));
152+
156153
}
157154

158155
}

0 commit comments

Comments
 (0)
Failed to load comments.