Merge lp:~cprov/launchpad/bug-430336-builder-status into lp:launchpad
- bug-430336-builder-status
- Merge into devel
Proposed by
Celso Providelo
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~cprov/launchpad/bug-430336-builder-status |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~cprov/launchpad/bug-430336-builder-status |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+11980@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote : | # |
Revision history for this message
Paul Hummer (rockstar) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/pagetitles.py' | |||
2 | --- lib/canonical/launchpad/pagetitles.py 2009-09-17 10:04:26 +0000 | |||
3 | +++ lib/canonical/launchpad/pagetitles.py 2009-09-17 14:01:16 +0000 | |||
4 | @@ -269,8 +269,6 @@ | |||
5 | 269 | 269 | ||
6 | 270 | build_rescore = ContextTitle('Rescore %s') | 270 | build_rescore = ContextTitle('Rescore %s') |
7 | 271 | 271 | ||
8 | 272 | builders_index = 'Launchpad build farm' | ||
9 | 273 | |||
10 | 274 | calendar_index = ContextTitle('%s') | 272 | calendar_index = ContextTitle('%s') |
11 | 275 | 273 | ||
12 | 276 | calendar_event_addform = ContextTitle('Add event to %s') | 274 | calendar_event_addform = ContextTitle('Add event to %s') |
13 | 277 | 275 | ||
14 | === modified file 'lib/lp/soyuz/browser/builder.py' | |||
15 | --- lib/lp/soyuz/browser/builder.py 2009-09-03 15:04:13 +0000 | |||
16 | +++ lib/lp/soyuz/browser/builder.py 2009-09-17 14:45:15 +0000 | |||
17 | @@ -39,9 +39,7 @@ | |||
18 | 39 | LaunchpadFormView, LaunchpadView, Link, Navigation, | 39 | LaunchpadFormView, LaunchpadView, Link, Navigation, |
19 | 40 | StandardLaunchpadFacets, action, canonical_url, custom_widget, | 40 | StandardLaunchpadFacets, action, canonical_url, custom_widget, |
20 | 41 | enabled_with_permission, stepthrough) | 41 | enabled_with_permission, stepthrough) |
21 | 42 | from canonical.launchpad.webapp.authorization import check_permission | ||
22 | 43 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 42 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
23 | 44 | from lazr.delegates import delegates | ||
24 | 45 | from canonical.widgets import HiddenUserWidget | 43 | from canonical.widgets import HiddenUserWidget |
25 | 46 | 44 | ||
26 | 47 | 45 | ||
27 | @@ -120,41 +118,22 @@ | |||
28 | 120 | return Link('+mode', text, icon='edit') | 118 | return Link('+mode', text, icon='edit') |
29 | 121 | 119 | ||
30 | 122 | 120 | ||
55 | 123 | class CommonBuilderView(LaunchpadView): | 121 | class BuilderSetView(LaunchpadView): |
56 | 124 | """Common builder methods used in this file.""" | 122 | """Default BuilderSet view class.""" |
33 | 125 | |||
34 | 126 | def overrideHiddenBuilder(self, builder): | ||
35 | 127 | """Override the builder to HiddenBuilder as necessary. | ||
36 | 128 | |||
37 | 129 | HiddenBuilder is used if the user does not have permission to | ||
38 | 130 | see the build on the builder. | ||
39 | 131 | """ | ||
40 | 132 | current_job = builder.currentjob | ||
41 | 133 | if (current_job and | ||
42 | 134 | not check_permission('launchpad.View', current_job.build)): | ||
43 | 135 | # Cloak the builder. | ||
44 | 136 | return HiddenBuilder(builder) | ||
45 | 137 | else: | ||
46 | 138 | # The build is public, don't cloak it. | ||
47 | 139 | return builder | ||
48 | 140 | |||
49 | 141 | |||
50 | 142 | class BuilderSetView(CommonBuilderView): | ||
51 | 143 | """Default BuilderSet view class | ||
52 | 144 | |||
53 | 145 | Simply provides CommonBuilderView for the BuilderSet pagetemplate. | ||
54 | 146 | """ | ||
57 | 147 | __used_for__ = IBuilderSet | 123 | __used_for__ = IBuilderSet |
58 | 148 | 124 | ||
59 | 125 | @property | ||
60 | 126 | def label(self): | ||
61 | 127 | return self.context.title | ||
62 | 128 | |||
63 | 129 | @property | ||
64 | 130 | def page_title(self): | ||
65 | 131 | return self.label | ||
66 | 132 | |||
67 | 149 | @cachedproperty | 133 | @cachedproperty |
68 | 150 | def builders(self): | 134 | def builders(self): |
76 | 151 | """Return all active builders, with private builds cloaked. | 135 | """All active builders""" |
77 | 152 | 136 | return list(self.context.getBuilders()) | |
71 | 153 | Any builders building a private build will be cloaked and returned | ||
72 | 154 | as a HiddenBuilder. | ||
73 | 155 | """ | ||
74 | 156 | builders = self.context.getBuilders() | ||
75 | 157 | return [self.overrideHiddenBuilder(builder) for builder in builders] | ||
78 | 158 | 137 | ||
79 | 159 | @property | 138 | @property |
80 | 160 | def number_of_registered_builders(self): | 139 | def number_of_registered_builders(self): |
81 | @@ -205,6 +184,7 @@ | |||
82 | 205 | else: | 184 | else: |
83 | 206 | self.duration = duration | 185 | self.duration = duration |
84 | 207 | 186 | ||
85 | 187 | |||
86 | 208 | class BuilderCategory: | 188 | class BuilderCategory: |
87 | 209 | """A category of builders. | 189 | """A category of builders. |
88 | 210 | 190 | ||
89 | @@ -246,52 +226,13 @@ | |||
90 | 246 | self._builder_groups.append(builder_group) | 226 | self._builder_groups.append(builder_group) |
91 | 247 | 227 | ||
92 | 248 | 228 | ||
119 | 249 | class HiddenBuilder: | 229 | class BuilderView(LaunchpadView): |
94 | 250 | """Overrides a IBuilder building a private job. | ||
95 | 251 | |||
96 | 252 | This class modifies IBuilder attributes that should not be exposed | ||
97 | 253 | while building a job for private job (private PPA or Security). | ||
98 | 254 | """ | ||
99 | 255 | delegates(IBuilder) | ||
100 | 256 | |||
101 | 257 | failnotes = None | ||
102 | 258 | currentjob = None | ||
103 | 259 | builderok = False | ||
104 | 260 | status = 'Building private build' | ||
105 | 261 | |||
106 | 262 | def __init__(self, context): | ||
107 | 263 | self.context = context | ||
108 | 264 | |||
109 | 265 | # This method is required because the builder history page will have this | ||
110 | 266 | # cloaked context if the builder is currently processing a private build. | ||
111 | 267 | def getBuildRecords(self, build_state=None, name=None, arch_tag=None, | ||
112 | 268 | user=None): | ||
113 | 269 | """See `IHasBuildRecords`.""" | ||
114 | 270 | return self.context.getBuildRecords( | ||
115 | 271 | build_state, name, arch_tag, user) | ||
116 | 272 | |||
117 | 273 | |||
118 | 274 | class BuilderView(CommonBuilderView, BuildRecordsView): | ||
120 | 275 | """Default Builder view class | 230 | """Default Builder view class |
121 | 276 | 231 | ||
122 | 277 | Implements useful actions for the page template. | 232 | Implements useful actions for the page template. |
123 | 278 | """ | 233 | """ |
124 | 279 | __used_for__ = IBuilder | 234 | __used_for__ = IBuilder |
125 | 280 | 235 | ||
126 | 281 | def __init__(self, context, request): | ||
127 | 282 | context = self.overrideHiddenBuilder(context) | ||
128 | 283 | super(BuilderView, self).__init__(context, request) | ||
129 | 284 | |||
130 | 285 | @property | ||
131 | 286 | def default_build_state(self): | ||
132 | 287 | """Present all jobs by default.""" | ||
133 | 288 | return None | ||
134 | 289 | |||
135 | 290 | @property | ||
136 | 291 | def show_builder_info(self): | ||
137 | 292 | """Hide Builder info, see BuildRecordsView for further details""" | ||
138 | 293 | return False | ||
139 | 294 | |||
140 | 295 | @property | 236 | @property |
141 | 296 | def current_build_duration(self): | 237 | def current_build_duration(self): |
142 | 297 | """Return the delta representing the duration of the current job.""" | 238 | """Return the delta representing the duration of the current job.""" |
143 | @@ -318,15 +259,27 @@ | |||
144 | 318 | return "Switch to manual-mode" | 259 | return "Switch to manual-mode" |
145 | 319 | 260 | ||
146 | 320 | 261 | ||
148 | 321 | class BuilderHistoryView(BuilderView): | 262 | class BuilderHistoryView(BuildRecordsView): |
149 | 322 | """This class exists only to override the page_title.""" | 263 | """This class exists only to override the page_title.""" |
150 | 323 | 264 | ||
151 | 265 | __used_for__ = IBuilder | ||
152 | 266 | |||
153 | 324 | @property | 267 | @property |
154 | 325 | def page_title(self): | 268 | def page_title(self): |
155 | 326 | """Return a relevant page title for this view.""" | 269 | """Return a relevant page title for this view.""" |
156 | 327 | return smartquote( | 270 | return smartquote( |
157 | 328 | 'Build history for "%s"' % self.context.title) | 271 | 'Build history for "%s"' % self.context.title) |
158 | 329 | 272 | ||
159 | 273 | @property | ||
160 | 274 | def default_build_state(self): | ||
161 | 275 | """Present all jobs by default.""" | ||
162 | 276 | return None | ||
163 | 277 | |||
164 | 278 | @property | ||
165 | 279 | def show_builder_info(self): | ||
166 | 280 | """Hide Builder info, see BuildRecordsView for further details""" | ||
167 | 281 | return False | ||
168 | 282 | |||
169 | 330 | 283 | ||
170 | 331 | class BuilderSetAddView(LaunchpadFormView): | 284 | class BuilderSetAddView(LaunchpadFormView): |
171 | 332 | """View class for adding new Builders.""" | 285 | """View class for adding new Builders.""" |
172 | 333 | 286 | ||
173 | === modified file 'lib/lp/soyuz/browser/configure.zcml' | |||
174 | --- lib/lp/soyuz/browser/configure.zcml 2009-09-10 12:59:56 +0000 | |||
175 | +++ lib/lp/soyuz/browser/configure.zcml 2009-09-16 19:06:48 +0000 | |||
176 | @@ -425,22 +425,24 @@ | |||
177 | 425 | facet="overview" | 425 | facet="overview" |
178 | 426 | name="+index"/> | 426 | name="+index"/> |
179 | 427 | <browser:page | 427 | <browser:page |
180 | 428 | template="../templates/builder-portlet-details.pt" | ||
181 | 429 | name="+portlet-details" | ||
182 | 430 | facet="overview"/> | ||
183 | 431 | </browser:pages> | ||
184 | 432 | <browser:pages | ||
185 | 433 | for="lp.soyuz.interfaces.builder.IBuilder" | ||
186 | 434 | permission="zope.Public" | ||
187 | 435 | class="lp.soyuz.browser.builder.BuilderHistoryView"> | ||
188 | 436 | <browser:page | ||
189 | 437 | name="+history" | ||
190 | 438 | template="../templates/builder-history.pt" | ||
191 | 439 | facet="overview" /> | ||
192 | 440 | <browser:page | ||
193 | 428 | template="../templates/builds-list.pt" | 441 | template="../templates/builds-list.pt" |
194 | 429 | name="+builds-list" | 442 | name="+builds-list" |
195 | 430 | facet="overview"/> | 443 | facet="overview"/> |
196 | 431 | <browser:page | ||
197 | 432 | template="../templates/builder-portlet-details.pt" | ||
198 | 433 | name="+portlet-details" | ||
199 | 434 | facet="overview"/> | ||
200 | 435 | </browser:pages> | 444 | </browser:pages> |
201 | 436 | <browser:page | 445 | <browser:page |
202 | 437 | name="+history" | ||
203 | 438 | for="lp.soyuz.interfaces.builder.IBuilder" | ||
204 | 439 | permission="zope.Public" | ||
205 | 440 | template="../templates/builder-history.pt" | ||
206 | 441 | facet="overview" | ||
207 | 442 | class="lp.soyuz.browser.builder.BuilderHistoryView" /> | ||
208 | 443 | <browser:page | ||
209 | 444 | name="+edit" | 446 | name="+edit" |
210 | 445 | for="lp.soyuz.interfaces.builder.IBuilder" | 447 | for="lp.soyuz.interfaces.builder.IBuilder" |
211 | 446 | class="lp.soyuz.browser.builder.BuilderEditView" | 448 | class="lp.soyuz.browser.builder.BuilderEditView" |
212 | 447 | 449 | ||
213 | === modified file 'lib/lp/soyuz/browser/tests/builder-views.txt' | |||
214 | --- lib/lp/soyuz/browser/tests/builder-views.txt 2009-08-27 19:09:44 +0000 | |||
215 | +++ lib/lp/soyuz/browser/tests/builder-views.txt 2009-09-16 19:06:48 +0000 | |||
216 | @@ -196,9 +196,6 @@ | |||
217 | 196 | >>> empty_request = LaunchpadTestRequest(form={}) | 196 | >>> empty_request = LaunchpadTestRequest(form={}) |
218 | 197 | >>> admin_view = getMultiAdapter((frog, empty_request), name="+index") | 197 | >>> admin_view = getMultiAdapter((frog, empty_request), name="+index") |
219 | 198 | 198 | ||
220 | 199 | >>> print admin_view.context | ||
221 | 200 | <security proxied lp.soyuz.model.builder.Builder ...> | ||
222 | 201 | |||
223 | 202 | >>> print admin_view.context.builderok | 199 | >>> print admin_view.context.builderok |
224 | 203 | True | 200 | True |
225 | 204 | 201 | ||
226 | @@ -219,36 +216,6 @@ | |||
227 | 219 | >>> print admin_view.current_build_duration | 216 | >>> print admin_view.current_build_duration |
228 | 220 | 10 days... | 217 | 10 days... |
229 | 221 | 218 | ||
230 | 222 | When accessing the same view as a unprivileged user, No-Priv, the | ||
231 | 223 | sensitive information is hidden (the context class is 'cloaked', see | ||
232 | 224 | browser/builder.py for futher information on this) and the builder | ||
233 | 225 | shows up as 'Building private build'. | ||
234 | 226 | |||
235 | 227 | >>> login('no-priv@canonical.com') | ||
236 | 228 | >>> nopriv_view = getMultiAdapter((frog, empty_request), name="+index") | ||
237 | 229 | |||
238 | 230 | >>> print nopriv_view.context | ||
239 | 231 | <lp.soyuz.browser.builder.HiddenBuilder ...> | ||
240 | 232 | |||
241 | 233 | >>> print nopriv_view.context.builderok | ||
242 | 234 | False | ||
243 | 235 | |||
244 | 236 | >>> print nopriv_view.context.currentjob | ||
245 | 237 | None | ||
246 | 238 | |||
247 | 239 | >>> print nopriv_view.context.failnotes | ||
248 | 240 | None | ||
249 | 241 | |||
250 | 242 | >>> print nopriv_view.context.status | ||
251 | 243 | Building private build | ||
252 | 244 | |||
253 | 245 | >>> print nopriv_view.current_build_duration | ||
254 | 246 | None | ||
255 | 247 | |||
256 | 248 | XXX cprov 20080214: this is clearly a counterintuitive way to identify | ||
257 | 249 | builders building private jobs. We will certainly have to fine-tune it | ||
258 | 250 | before public release. | ||
259 | 251 | |||
260 | 252 | Once the private job is gone, Frog 'real' details are exposed publicly | 219 | Once the private job is gone, Frog 'real' details are exposed publicly |
261 | 253 | again. | 220 | again. |
262 | 254 | 221 | ||
263 | 255 | 222 | ||
264 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-builder-page.txt' | |||
265 | --- lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2009-09-12 06:49:56 +0000 | |||
266 | +++ lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2009-09-17 14:45:15 +0000 | |||
267 | @@ -17,7 +17,7 @@ | |||
268 | 17 | >>> print extract_text(find_portlet( | 17 | >>> print extract_text(find_portlet( |
269 | 18 | ... anon_browser.contents, 'View full history Current status')) | 18 | ... anon_browser.contents, 'View full history Current status')) |
270 | 19 | View full history Current status | 19 | View full history Current status |
272 | 20 | i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE | 20 | Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE |
273 | 21 | Started ... ago. | 21 | Started ... ago. |
274 | 22 | Buildlog | 22 | Buildlog |
275 | 23 | Dummy sampledata entry, not processing | 23 | Dummy sampledata entry, not processing |
276 | @@ -31,7 +31,7 @@ | |||
277 | 31 | >>> print extract_text(find_portlet( | 31 | >>> print extract_text(find_portlet( |
278 | 32 | ... user_browser.contents, 'View full history Current status')) | 32 | ... user_browser.contents, 'View full history Current status')) |
279 | 33 | View full history Current status | 33 | View full history Current status |
281 | 34 | i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE | 34 | Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE |
282 | 35 | Started ... ago. | 35 | Started ... ago. |
283 | 36 | Buildlog | 36 | Buildlog |
284 | 37 | Dummy sampledata entry, not processing | 37 | Dummy sampledata entry, not processing |
285 | @@ -214,6 +214,7 @@ | |||
286 | 214 | >>> cprov_browser.getLink("Build Farm").click() | 214 | >>> cprov_browser.getLink("Build Farm").click() |
287 | 215 | 215 | ||
288 | 216 | >>> print extract_text(find_main_content(cprov_browser.contents)) | 216 | >>> print extract_text(find_main_content(cprov_browser.contents)) |
289 | 217 | The Launchpad build farm | ||
290 | 217 | Register a new build machine | 218 | Register a new build machine |
291 | 218 | 0 available build machines, 1 disabled and 0 building of a total | 219 | 0 available build machines, 1 disabled and 0 building of a total |
292 | 219 | of 1 registered. | 220 | of 1 registered. |
293 | 220 | 221 | ||
294 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt' | |||
295 | --- lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2009-09-10 22:08:36 +0000 | |||
296 | +++ lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2009-09-17 14:45:15 +0000 | |||
297 | @@ -13,6 +13,7 @@ | |||
298 | 13 | containing the build queue status summary for each build domain. | 13 | containing the build queue status summary for each build domain. |
299 | 14 | 14 | ||
300 | 15 | >>> print extract_text(find_main_content(anon_browser.contents)) | 15 | >>> print extract_text(find_main_content(anon_browser.contents)) |
301 | 16 | The Launchpad build farm | ||
302 | 16 | 1 available build machine, 1 disabled and 1 building of a total of | 17 | 1 available build machine, 1 disabled and 1 building of a total of |
303 | 17 | 2 registered. | 18 | 2 registered. |
304 | 18 | Builders | 19 | Builders |
305 | @@ -26,6 +27,13 @@ | |||
306 | 26 | Processor Builders Queue | 27 | Processor Builders Queue |
307 | 27 | 386 0 empty | 28 | 386 0 empty |
308 | 28 | 29 | ||
309 | 30 | When building, the 'Status' column contains a link to the | ||
310 | 31 | corresponding 'Build' page. | ||
311 | 32 | |||
312 | 33 | >>> print anon_browser.getLink( | ||
313 | 34 | ... 'i386 build of mozilla-firefox 0.9').url | ||
314 | 35 | http://launchpad.dev/ubuntu/+source/mozilla-firefox/0.9/+build/8 | ||
315 | 36 | |||
316 | 29 | The build status portlets contain the number of builds waiting | 37 | The build status portlets contain the number of builds waiting |
317 | 30 | in queue and the sum of their 'estimated_build_duration' for each | 38 | in queue and the sum of their 'estimated_build_duration' for each |
318 | 31 | supported processor on each separated build domain, 'official' | 39 | supported processor on each separated build domain, 'official' |
319 | 32 | 40 | ||
320 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt' | |||
321 | --- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2009-09-10 22:32:06 +0000 | |||
322 | +++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2009-09-17 14:45:15 +0000 | |||
323 | @@ -58,24 +58,23 @@ | |||
324 | 58 | >>> logout() | 58 | >>> logout() |
325 | 59 | 59 | ||
326 | 60 | So now we can go to frog's builder page and see what the page shows us. | 60 | So now we can go to frog's builder page and see what the page shows us. |
329 | 61 | The status shown to an anonymous user hides the fact that it's building a | 61 | The status shown to an anonymous user hides the private source it is |
330 | 62 | private build: | 62 | building. |
331 | 63 | 63 | ||
332 | 64 | >>> anon_browser.open("http://launchpad.dev/+builds/frog") | 64 | >>> anon_browser.open("http://launchpad.dev/+builds/frog") |
333 | 65 | >>> print extract_text(find_main_content(anon_browser.contents)) | 65 | >>> print extract_text(find_main_content(anon_browser.contents)) |
334 | 66 | The frog builder... | 66 | The frog builder... |
335 | 67 | Current status | 67 | Current status |
338 | 68 | The frog builder | 68 | Building private source |
337 | 69 | is deactivated. | ||
339 | 70 | ... | 69 | ... |
340 | 71 | 70 | ||
341 | 72 | |||
342 | 73 | Launchpad Administrators are allowed to see the build: | 71 | Launchpad Administrators are allowed to see the build: |
343 | 74 | 72 | ||
344 | 75 | >>> admin_browser.open("http://launchpad.dev/+builds/frog") | 73 | >>> admin_browser.open("http://launchpad.dev/+builds/frog") |
345 | 76 | >>> print extract_text(find_main_content(admin_browser.contents)) | 74 | >>> print extract_text(find_main_content(admin_browser.contents)) |
346 | 77 | The frog builder... | 75 | The frog builder... |
347 | 78 | Current status | 76 | Current status |
348 | 77 | Building | ||
349 | 79 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE | 78 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE |
350 | 80 | ... | 79 | ... |
351 | 81 | 80 | ||
352 | @@ -86,7 +85,7 @@ | |||
353 | 86 | >>> print extract_text(find_main_content(name12_browser.contents)) | 85 | >>> print extract_text(find_main_content(name12_browser.contents)) |
354 | 87 | The frog builder... | 86 | The frog builder... |
355 | 88 | Current status | 87 | Current status |
357 | 89 | The frog builder is deactivated. | 88 | Building private source |
358 | 90 | ... | 89 | ... |
359 | 91 | 90 | ||
360 | 92 | cprov is also allowed to see his own build: | 91 | cprov is also allowed to see his own build: |
361 | @@ -97,6 +96,7 @@ | |||
362 | 97 | >>> print extract_text(find_main_content(cprov_browser.contents)) | 96 | >>> print extract_text(find_main_content(cprov_browser.contents)) |
363 | 98 | The frog builder... | 97 | The frog builder... |
364 | 99 | Current status | 98 | Current status |
365 | 99 | Building | ||
366 | 100 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE | 100 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE |
367 | 101 | ... | 101 | ... |
368 | 102 | 102 | ||
369 | @@ -229,7 +229,7 @@ | |||
370 | 229 | 229 | ||
371 | 230 | >>> admin_browser.open("http://launchpad.dev/+builds") | 230 | >>> admin_browser.open("http://launchpad.dev/+builds") |
372 | 231 | >>> print extract_text(find_main_content(admin_browser.contents)) | 231 | >>> print extract_text(find_main_content(admin_browser.contents)) |
374 | 232 | Register a new build machine | 232 | The Launchpad build farm |
375 | 233 | ... | 233 | ... |
376 | 234 | Name Processor Status | 234 | Name Processor Status |
377 | 235 | bob 386 Building i386 build of mozilla-firefox ... | 235 | bob 386 Building i386 build of mozilla-firefox ... |
378 | @@ -240,18 +240,18 @@ | |||
379 | 240 | 240 | ||
380 | 241 | >>> name12_browser.open("http://launchpad.dev/+builds") | 241 | >>> name12_browser.open("http://launchpad.dev/+builds") |
381 | 242 | >>> print extract_text(find_main_content(name12_browser.contents)) | 242 | >>> print extract_text(find_main_content(name12_browser.contents)) |
383 | 243 | Register a new build machine | 243 | The Launchpad build farm |
384 | 244 | ... | 244 | ... |
385 | 245 | Name Processor Status | 245 | Name Processor Status |
386 | 246 | bob 386 Building i386 build of mozilla-firefox ... | 246 | bob 386 Building i386 build of mozilla-firefox ... |
388 | 247 | frog 386 Building private build | 247 | frog 386 Building private source |
389 | 248 | ... | 248 | ... |
390 | 249 | 249 | ||
391 | 250 | cprov can see his own private build: | 250 | cprov can see his own private build: |
392 | 251 | 251 | ||
393 | 252 | >>> cprov_browser.open("http://launchpad.dev/+builds") | 252 | >>> cprov_browser.open("http://launchpad.dev/+builds") |
394 | 253 | >>> print extract_text(find_main_content(cprov_browser.contents)) | 253 | >>> print extract_text(find_main_content(cprov_browser.contents)) |
396 | 254 | Register a new build machine | 254 | The Launchpad build farm |
397 | 255 | ... | 255 | ... |
398 | 256 | Name Processor Status | 256 | Name Processor Status |
399 | 257 | bob 386 Building i386 build of mozilla-firefox ... | 257 | bob 386 Building i386 build of mozilla-firefox ... |
400 | @@ -262,11 +262,12 @@ | |||
401 | 262 | 262 | ||
402 | 263 | >>> anon_browser.open("http://launchpad.dev/+builds") | 263 | >>> anon_browser.open("http://launchpad.dev/+builds") |
403 | 264 | >>> print extract_text(find_main_content(anon_browser.contents)) | 264 | >>> print extract_text(find_main_content(anon_browser.contents)) |
405 | 265 | 1 available build machine, ... | 265 | The Launchpad build farm |
406 | 266 | 2 available build machines, ... | ||
407 | 266 | ... | 267 | ... |
408 | 267 | Name Processor Status | 268 | Name Processor Status |
409 | 268 | bob 386 Building i386 build of mozilla-firefox ... | 269 | bob 386 Building i386 build of mozilla-firefox ... |
411 | 269 | frog 386 Building private build | 270 | frog 386 Building private source |
412 | 270 | ... | 271 | ... |
413 | 271 | 272 | ||
414 | 272 | 273 | ||
415 | @@ -326,7 +327,7 @@ | |||
416 | 326 | >>> anon_browser = setupBrowser() | 327 | >>> anon_browser = setupBrowser() |
417 | 327 | >>> anon_browser.open("http://launchpad.dev/+builds") | 328 | >>> anon_browser.open("http://launchpad.dev/+builds") |
418 | 328 | >>> print extract_text(find_main_content(anon_browser.contents)) | 329 | >>> print extract_text(find_main_content(anon_browser.contents)) |
420 | 329 | 2 available build machines, ... | 330 | The Launchpad build farm |
421 | 330 | ... | 331 | ... |
422 | 331 | Name Processor Status | 332 | Name Processor Status |
423 | 332 | bob 386 Building i386 build of mozilla-firefox ... | 333 | bob 386 Building i386 build of mozilla-firefox ... |
424 | @@ -337,7 +338,7 @@ | |||
425 | 337 | 338 | ||
426 | 338 | >>> browser.open("http://launchpad.dev/+builds") | 339 | >>> browser.open("http://launchpad.dev/+builds") |
427 | 339 | >>> print extract_text(find_main_content(browser.contents)) | 340 | >>> print extract_text(find_main_content(browser.contents)) |
429 | 340 | 2 available build machines, ... | 341 | The Launchpad build farm |
430 | 341 | ... | 342 | ... |
431 | 342 | Name Processor Status | 343 | Name Processor Status |
432 | 343 | bob 386 Building i386 build of mozilla-firefox ... | 344 | bob 386 Building i386 build of mozilla-firefox ... |
433 | 344 | 345 | ||
434 | === modified file 'lib/lp/soyuz/templates/builder-index.pt' | |||
435 | --- lib/lp/soyuz/templates/builder-index.pt 2009-08-19 20:00:00 +0000 | |||
436 | +++ lib/lp/soyuz/templates/builder-index.pt 2009-09-16 19:06:48 +0000 | |||
437 | @@ -29,46 +29,11 @@ | |||
438 | 29 | </p> | 29 | </p> |
439 | 30 | </div> | 30 | </div> |
440 | 31 | <div class="yui-ge"> | 31 | <div class="yui-ge"> |
441 | 32 | |||
442 | 32 | <div class="first yui-u"> | 33 | <div class="first yui-u"> |
449 | 33 | <div class="portlet"> | 34 | <div metal:use-macro="template/macros/status" /> |
450 | 34 | <h2> | 35 | </div><!-- yui-u --> |
445 | 35 | <span class="see-all"><a | ||
446 | 36 | tal:replace="structure view/menu:overview/history/fmt:link" /> | ||
447 | 37 | </span> | ||
448 | 38 | Current status</h2> | ||
451 | 39 | 36 | ||
452 | 40 | <tal:no_job condition="not: job"> | ||
453 | 41 | <p><tal:builder content="context/title" /> | ||
454 | 42 | <tal:builderok condition="context/builderok" | ||
455 | 43 | >is idle.</tal:builderok> | ||
456 | 44 | <tal:buildernok condition="not: context/builderok" | ||
457 | 45 | >is deactivated.</tal:buildernok></p> | ||
458 | 46 | </tal:no_job> | ||
459 | 47 | <tal:job condition="job"> | ||
460 | 48 | <tal:icon replace="structure job/build/image:icon" /> | ||
461 | 49 | <a tal:attributes="href job/build/fmt:url"> | ||
462 | 50 | <span tal:replace="job/build/title">NAME</span> | ||
463 | 51 | </a> | ||
464 | 52 | <p class="sprite">Started | ||
465 | 53 | <span tal:attributes="title job/buildstart/fmt:datetime" | ||
466 | 54 | tal:content="view/current_build_duration/fmt:exactduration" | ||
467 | 55 | /> | ||
468 | 56 | ago. | ||
469 | 57 | </p> | ||
470 | 58 | <tal:logtail condition="job/logtail"> | ||
471 | 59 | <h3>Buildlog</h3> | ||
472 | 60 | <div tal:content="structure job/logtail/fmt:text-to-html" | ||
473 | 61 | id="buildlog-tail" class="logtail"> | ||
474 | 62 | Things are crashing and burning all over the place. | ||
475 | 63 | </div> | ||
476 | 64 | <p class="discreet" tal:condition="view/user"> | ||
477 | 65 | Updated on | ||
478 | 66 | <span tal:replace="structure view/user/fmt:local-time"/> | ||
479 | 67 | </p> | ||
480 | 68 | </tal:logtail> | ||
481 | 69 | </tal:job> | ||
482 | 70 | </div><!-- portlet --> | ||
483 | 71 | </div><!-- yui-u --> | ||
484 | 72 | <div class="yui-u"> | 37 | <div class="yui-u"> |
485 | 73 | <div class="portlet"> | 38 | <div class="portlet"> |
486 | 74 | <h2>Builder information</h2> | 39 | <h2>Builder information</h2> |
487 | @@ -111,5 +76,106 @@ | |||
488 | 111 | <tal:menu replace="structure view/@@+related-pages" /> | 76 | <tal:menu replace="structure view/@@+related-pages" /> |
489 | 112 | </div> | 77 | </div> |
490 | 113 | </div> | 78 | </div> |
491 | 79 | |||
492 | 80 | |||
493 | 81 | <metal:macros fill-slot="bogus"> | ||
494 | 82 | |||
495 | 83 | <metal:macro define-macro="status-summary"> | ||
496 | 84 | <tal:comment replace="nothing"> | ||
497 | 85 | Status summary. | ||
498 | 86 | :param builder: IBuilder, context builder. | ||
499 | 87 | :param job: IBuildQueue, job assigned to the builder. | ||
500 | 88 | </tal:comment> | ||
501 | 89 | |||
502 | 90 | <tal:no_job condition="not: job"> | ||
503 | 91 | <tal:builderok condition="builder/builderok"> | ||
504 | 92 | <tal:idle condition="not: builder/manual"> | ||
505 | 93 | <span class="sortkey" tal:content="string:0" /> | ||
506 | 94 | <span class="sprite yes green">Idle</span> | ||
507 | 95 | </tal:idle> | ||
508 | 96 | <tal:manual tal:condition="builder/manual"> | ||
509 | 97 | <span class="sortkey" tal:content="string:1" /> | ||
510 | 98 | <span class="sprite info">Manual</span> | ||
511 | 99 | </tal:manual> | ||
512 | 100 | </tal:builderok> | ||
513 | 101 | <tal:buildernok condition="not: builder/builderok"> | ||
514 | 102 | <span class="sortkey" tal:content="string:2" /> | ||
515 | 103 | <span class="sprite no red">Disabled</span> | ||
516 | 104 | </tal:buildernok> | ||
517 | 105 | </tal:no_job> | ||
518 | 106 | |||
519 | 107 | <tal:job condition="job"> | ||
520 | 108 | <span class="sortkey" tal:content="job/id" /> | ||
521 | 109 | <tal:build define="build job/build"> | ||
522 | 110 | <tal:visible condition="build/required:launchpad.View"> | ||
523 | 111 | <tal:icon replace="structure build/image:icon" /> | ||
524 | 112 | Building | ||
525 | 113 | <a tal:attributes="href build/fmt:url" | ||
526 | 114 | tal:content="build/title" | ||
527 | 115 | >i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE</a> | ||
528 | 116 | <tal:ppa condition="build/archive/is_ppa" | ||
529 | 117 | define="ppa build/archive;"> | ||
530 | 118 | <span tal:replace="string: [${ppa/owner/name}/${ppa/name}]" | ||
531 | 119 | >[cprov/ppa]</span> | ||
532 | 120 | </tal:ppa> | ||
533 | 121 | </tal:visible> | ||
534 | 122 | <tal:restricted condition="not: build/required:launchpad.View"> | ||
535 | 123 | <img src="/@@/processing" alt="[building]" /> | ||
536 | 124 | Building private source | ||
537 | 125 | </tal:restricted> | ||
538 | 126 | </tal:build> | ||
539 | 127 | </tal:job> | ||
540 | 128 | |||
541 | 129 | </metal:macro> | ||
542 | 130 | |||
543 | 131 | |||
544 | 132 | <metal:macro define-macro="status"> | ||
545 | 133 | <tal:comment replace="nothing"> | ||
546 | 134 | Status summary. | ||
547 | 135 | :param job: IBuildQueue, job assigned to the context builder. | ||
548 | 136 | </tal:comment> | ||
549 | 137 | |||
550 | 138 | <div class="portlet"> | ||
551 | 139 | <h2> | ||
552 | 140 | <span class="see-all"><a | ||
553 | 141 | tal:replace="structure view/menu:overview/history/fmt:link" /> | ||
554 | 142 | </span> | ||
555 | 143 | Current status</h2> | ||
556 | 144 | |||
557 | 145 | <p tal:define="builder context"> | ||
558 | 146 | <metal:summary use-macro="template/macros/status-summary" /> | ||
559 | 147 | </p> | ||
560 | 148 | |||
561 | 149 | <tal:buildernok condition="not: context/builderok"> | ||
562 | 150 | <div tal:content="structure | ||
563 | 151 | context/failnotes/fmt:text-to-html" /> | ||
564 | 152 | </tal:buildernok> | ||
565 | 153 | |||
566 | 154 | <tal:job condition="job"> | ||
567 | 155 | <p class="sprite">Started | ||
568 | 156 | <span tal:attributes="title job/buildstart/fmt:datetime" | ||
569 | 157 | tal:content="view/current_build_duration/fmt:exactduration" | ||
570 | 158 | /> ago.</p> | ||
571 | 159 | <tal:visible condition="job/build/required:launchpad.View"> | ||
572 | 160 | <tal:logtail condition="job/logtail"> | ||
573 | 161 | <h3>Buildlog</h3> | ||
574 | 162 | <div tal:content="structure job/logtail/fmt:text-to-html" | ||
575 | 163 | id="buildlog-tail" class="logtail"> | ||
576 | 164 | Things are crashing and burning all over the place. | ||
577 | 165 | </div> | ||
578 | 166 | <p class="discreet" tal:condition="view/user"> | ||
579 | 167 | Updated on | ||
580 | 168 | <span tal:replace="structure view/user/fmt:local-time"/> | ||
581 | 169 | </p> | ||
582 | 170 | </tal:logtail> | ||
583 | 171 | </tal:visible> | ||
584 | 172 | </tal:job> | ||
585 | 173 | </div> | ||
586 | 174 | |||
587 | 175 | </metal:macro> | ||
588 | 176 | |||
589 | 177 | </metal:macros> | ||
590 | 178 | |||
591 | 179 | |||
592 | 114 | </body> | 180 | </body> |
593 | 115 | </html> | 181 | </html> |
594 | 116 | 182 | ||
595 | === modified file 'lib/lp/soyuz/templates/builders-index.pt' | |||
596 | --- lib/lp/soyuz/templates/builders-index.pt 2009-08-29 05:15:41 +0000 | |||
597 | +++ lib/lp/soyuz/templates/builders-index.pt 2009-09-16 18:53:46 +0000 | |||
598 | @@ -75,21 +75,8 @@ | |||
599 | 75 | >386</tal:processor> | 75 | >386</tal:processor> |
600 | 76 | </td> | 76 | </td> |
601 | 77 | <td tal:define="job builder/currentjob"> | 77 | <td tal:define="job builder/currentjob"> |
617 | 78 | <tal:not-building condition="not: job"> | 78 | <metal:status-summary |
618 | 79 | <tal:idle condition="builder/builderok"> | 79 | use-macro="builder/@@+index/status-summary" /> |
604 | 80 | <span class="sortkey" tal:content="string:1" /> | ||
605 | 81 | <img src="/@@/yes" alt="[idle]" title="Idle" /> | ||
606 | 82 | </tal:idle> | ||
607 | 83 | <tal:broken condition="not: builder/builderok"> | ||
608 | 84 | <span class="sortkey" tal:content="string:0" /> | ||
609 | 85 | <img src="/@@/no" alt="[disabled]" title="Disabled" /> | ||
610 | 86 | </tal:broken> | ||
611 | 87 | </tal:not-building> | ||
612 | 88 | <tal:building condition="job"> | ||
613 | 89 | <span class="sortkey" tal:content="job/id" /> | ||
614 | 90 | <tal:icon replace="structure job/build/image:icon" /> | ||
615 | 91 | </tal:building> | ||
616 | 92 | <tal:status replace="builder/status">Buiding fooo</tal:status> | ||
619 | 93 | </td> | 80 | </td> |
620 | 94 | </tr> | 81 | </tr> |
621 | 95 | </tbody> | 82 | </tbody> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
= Summary =
This branch primarily replaces the HiddenBuilder hack used to
implicitly hides information about private sources with an more
appropriate and testable mechanism. Both BuilderSet:+index and
Builder:+index use the same template macro for rendering the builder
'status summary' now.
I could also remove `IBuilder.status` implementation entirely, since
it's not needed anymore. The dynamic form is much nicers (includes
icon and link to the building job). I thought it would be nicer to do
it in a separate branch, or at least, after the branch direction gets
approved.
I also took the opportunity to fix /bugs.edge. launchpad. net/bugs/ 430336, now IDLE builder in
https:/
manual-mode with state it clear in its 'status-summary'.
== Tests ==
./bin/test -vv -t builder-views.txt -t stories.ppa -t stories.soyuz
== Demo and Q/A ==
1. https:/ /launchpad. dev/builders (log in as foo.bar)
2. 'Register a new build machine' and play with the 'builderok' and
the 'manual' flag.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ pagetitles. py soyuz/templates /builder- index.pt soyuz/stories/ soyuz/xx- builder- page.txt soyuz/browser/ tests/builder- views.txt soyuz/stories/ soyuz/xx- private- builds. txt soyuz/templates /builders- index.pt soyuz/browser/ builder. py soyuz/browser/ configure. zcml soyuz/stories/ soyuz/xx- buildfarm- index.txt
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkq yThYACgkQ7KBXuX yZSjBt0wCfegMiS BQgWbi9nbnwoIIc 2mvC 1Kw46FUiviRJ+ Jwz7
SCoAnjXrfd2fkrF
=4ZHJ
-----END PGP SIGNATURE-----