Merge lp:~cprov/launchpad/bug-430336-builder-status into lp:launchpad

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
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+11980@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

-----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
https://bugs.edge.launchpad.net/bugs/430336, now IDLE builder in
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:
  lib/canonical/launchpad/pagetitles.py
  lib/lp/soyuz/templates/builder-index.pt
  lib/lp/soyuz/stories/soyuz/xx-builder-page.txt
  lib/lp/soyuz/browser/tests/builder-views.txt
  lib/lp/soyuz/stories/soyuz/xx-private-builds.txt
  lib/lp/soyuz/templates/builders-index.pt
  lib/lp/soyuz/browser/builder.py
  lib/lp/soyuz/browser/configure.zcml
  lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqyThYACgkQ7KBXuXyZSjBt0wCfegMiSBQgWbi9nbnwoIIc2mvC
SCoAnjXrfd2fkrF1Kw46FUiviRJ+Jwz7
=4ZHJ
-----END PGP SIGNATURE-----

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
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-17 10:04:26 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-17 14:01:16 +0000
@@ -269,8 +269,6 @@
269269
270build_rescore = ContextTitle('Rescore %s')270build_rescore = ContextTitle('Rescore %s')
271271
272builders_index = 'Launchpad build farm'
273
274calendar_index = ContextTitle('%s')272calendar_index = ContextTitle('%s')
275273
276calendar_event_addform = ContextTitle('Add event to %s')274calendar_event_addform = ContextTitle('Add event to %s')
277275
=== modified file 'lib/lp/soyuz/browser/builder.py'
--- lib/lp/soyuz/browser/builder.py 2009-09-03 15:04:13 +0000
+++ lib/lp/soyuz/browser/builder.py 2009-09-17 14:45:15 +0000
@@ -39,9 +39,7 @@
39 LaunchpadFormView, LaunchpadView, Link, Navigation,39 LaunchpadFormView, LaunchpadView, Link, Navigation,
40 StandardLaunchpadFacets, action, canonical_url, custom_widget,40 StandardLaunchpadFacets, action, canonical_url, custom_widget,
41 enabled_with_permission, stepthrough)41 enabled_with_permission, stepthrough)
42from canonical.launchpad.webapp.authorization import check_permission
43from canonical.launchpad.webapp.breadcrumb import Breadcrumb42from canonical.launchpad.webapp.breadcrumb import Breadcrumb
44from lazr.delegates import delegates
45from canonical.widgets import HiddenUserWidget43from canonical.widgets import HiddenUserWidget
4644
4745
@@ -120,41 +118,22 @@
120 return Link('+mode', text, icon='edit')118 return Link('+mode', text, icon='edit')
121119
122120
123class CommonBuilderView(LaunchpadView):121class BuilderSetView(LaunchpadView):
124 """Common builder methods used in this file."""122 """Default BuilderSet view class."""
125
126 def overrideHiddenBuilder(self, builder):
127 """Override the builder to HiddenBuilder as necessary.
128
129 HiddenBuilder is used if the user does not have permission to
130 see the build on the builder.
131 """
132 current_job = builder.currentjob
133 if (current_job and
134 not check_permission('launchpad.View', current_job.build)):
135 # Cloak the builder.
136 return HiddenBuilder(builder)
137 else:
138 # The build is public, don't cloak it.
139 return builder
140
141
142class BuilderSetView(CommonBuilderView):
143 """Default BuilderSet view class
144
145 Simply provides CommonBuilderView for the BuilderSet pagetemplate.
146 """
147 __used_for__ = IBuilderSet123 __used_for__ = IBuilderSet
148124
125 @property
126 def label(self):
127 return self.context.title
128
129 @property
130 def page_title(self):
131 return self.label
132
149 @cachedproperty133 @cachedproperty
150 def builders(self):134 def builders(self):
151 """Return all active builders, with private builds cloaked.135 """All active builders"""
152136 return list(self.context.getBuilders())
153 Any builders building a private build will be cloaked and returned
154 as a HiddenBuilder.
155 """
156 builders = self.context.getBuilders()
157 return [self.overrideHiddenBuilder(builder) for builder in builders]
158137
159 @property138 @property
160 def number_of_registered_builders(self):139 def number_of_registered_builders(self):
@@ -205,6 +184,7 @@
205 else:184 else:
206 self.duration = duration185 self.duration = duration
207186
187
208class BuilderCategory:188class BuilderCategory:
209 """A category of builders.189 """A category of builders.
210190
@@ -246,52 +226,13 @@
246 self._builder_groups.append(builder_group)226 self._builder_groups.append(builder_group)
247227
248228
249class HiddenBuilder:229class BuilderView(LaunchpadView):
250 """Overrides a IBuilder building a private job.
251
252 This class modifies IBuilder attributes that should not be exposed
253 while building a job for private job (private PPA or Security).
254 """
255 delegates(IBuilder)
256
257 failnotes = None
258 currentjob = None
259 builderok = False
260 status = 'Building private build'
261
262 def __init__(self, context):
263 self.context = context
264
265 # This method is required because the builder history page will have this
266 # cloaked context if the builder is currently processing a private build.
267 def getBuildRecords(self, build_state=None, name=None, arch_tag=None,
268 user=None):
269 """See `IHasBuildRecords`."""
270 return self.context.getBuildRecords(
271 build_state, name, arch_tag, user)
272
273
274class BuilderView(CommonBuilderView, BuildRecordsView):
275 """Default Builder view class230 """Default Builder view class
276231
277 Implements useful actions for the page template.232 Implements useful actions for the page template.
278 """233 """
279 __used_for__ = IBuilder234 __used_for__ = IBuilder
280235
281 def __init__(self, context, request):
282 context = self.overrideHiddenBuilder(context)
283 super(BuilderView, self).__init__(context, request)
284
285 @property
286 def default_build_state(self):
287 """Present all jobs by default."""
288 return None
289
290 @property
291 def show_builder_info(self):
292 """Hide Builder info, see BuildRecordsView for further details"""
293 return False
294
295 @property236 @property
296 def current_build_duration(self):237 def current_build_duration(self):
297 """Return the delta representing the duration of the current job."""238 """Return the delta representing the duration of the current job."""
@@ -318,15 +259,27 @@
318 return "Switch to manual-mode"259 return "Switch to manual-mode"
319260
320261
321class BuilderHistoryView(BuilderView):262class BuilderHistoryView(BuildRecordsView):
322 """This class exists only to override the page_title."""263 """This class exists only to override the page_title."""
323264
265 __used_for__ = IBuilder
266
324 @property267 @property
325 def page_title(self):268 def page_title(self):
326 """Return a relevant page title for this view."""269 """Return a relevant page title for this view."""
327 return smartquote(270 return smartquote(
328 'Build history for "%s"' % self.context.title)271 'Build history for "%s"' % self.context.title)
329272
273 @property
274 def default_build_state(self):
275 """Present all jobs by default."""
276 return None
277
278 @property
279 def show_builder_info(self):
280 """Hide Builder info, see BuildRecordsView for further details"""
281 return False
282
330283
331class BuilderSetAddView(LaunchpadFormView):284class BuilderSetAddView(LaunchpadFormView):
332 """View class for adding new Builders."""285 """View class for adding new Builders."""
333286
=== modified file 'lib/lp/soyuz/browser/configure.zcml'
--- lib/lp/soyuz/browser/configure.zcml 2009-09-10 12:59:56 +0000
+++ lib/lp/soyuz/browser/configure.zcml 2009-09-16 19:06:48 +0000
@@ -425,22 +425,24 @@
425 facet="overview"425 facet="overview"
426 name="+index"/>426 name="+index"/>
427 <browser:page427 <browser:page
428 template="../templates/builder-portlet-details.pt"
429 name="+portlet-details"
430 facet="overview"/>
431 </browser:pages>
432 <browser:pages
433 for="lp.soyuz.interfaces.builder.IBuilder"
434 permission="zope.Public"
435 class="lp.soyuz.browser.builder.BuilderHistoryView">
436 <browser:page
437 name="+history"
438 template="../templates/builder-history.pt"
439 facet="overview" />
440 <browser:page
428 template="../templates/builds-list.pt"441 template="../templates/builds-list.pt"
429 name="+builds-list"442 name="+builds-list"
430 facet="overview"/>443 facet="overview"/>
431 <browser:page
432 template="../templates/builder-portlet-details.pt"
433 name="+portlet-details"
434 facet="overview"/>
435 </browser:pages>444 </browser:pages>
436 <browser:page445 <browser:page
437 name="+history"
438 for="lp.soyuz.interfaces.builder.IBuilder"
439 permission="zope.Public"
440 template="../templates/builder-history.pt"
441 facet="overview"
442 class="lp.soyuz.browser.builder.BuilderHistoryView" />
443 <browser:page
444 name="+edit"446 name="+edit"
445 for="lp.soyuz.interfaces.builder.IBuilder"447 for="lp.soyuz.interfaces.builder.IBuilder"
446 class="lp.soyuz.browser.builder.BuilderEditView"448 class="lp.soyuz.browser.builder.BuilderEditView"
447449
=== modified file 'lib/lp/soyuz/browser/tests/builder-views.txt'
--- lib/lp/soyuz/browser/tests/builder-views.txt 2009-08-27 19:09:44 +0000
+++ lib/lp/soyuz/browser/tests/builder-views.txt 2009-09-16 19:06:48 +0000
@@ -196,9 +196,6 @@
196 >>> empty_request = LaunchpadTestRequest(form={})196 >>> empty_request = LaunchpadTestRequest(form={})
197 >>> admin_view = getMultiAdapter((frog, empty_request), name="+index")197 >>> admin_view = getMultiAdapter((frog, empty_request), name="+index")
198198
199 >>> print admin_view.context
200 <security proxied lp.soyuz.model.builder.Builder ...>
201
202 >>> print admin_view.context.builderok199 >>> print admin_view.context.builderok
203 True200 True
204201
@@ -219,36 +216,6 @@
219 >>> print admin_view.current_build_duration216 >>> print admin_view.current_build_duration
220 10 days...217 10 days...
221218
222When accessing the same view as a unprivileged user, No-Priv, the
223sensitive information is hidden (the context class is 'cloaked', see
224browser/builder.py for futher information on this) and the builder
225shows up as 'Building private build'.
226
227 >>> login('no-priv@canonical.com')
228 >>> nopriv_view = getMultiAdapter((frog, empty_request), name="+index")
229
230 >>> print nopriv_view.context
231 <lp.soyuz.browser.builder.HiddenBuilder ...>
232
233 >>> print nopriv_view.context.builderok
234 False
235
236 >>> print nopriv_view.context.currentjob
237 None
238
239 >>> print nopriv_view.context.failnotes
240 None
241
242 >>> print nopriv_view.context.status
243 Building private build
244
245 >>> print nopriv_view.current_build_duration
246 None
247
248XXX cprov 20080214: this is clearly a counterintuitive way to identify
249builders building private jobs. We will certainly have to fine-tune it
250before public release.
251
252Once the private job is gone, Frog 'real' details are exposed publicly219Once the private job is gone, Frog 'real' details are exposed publicly
253again.220again.
254221
255222
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-builder-page.txt'
--- lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2009-09-12 06:49:56 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2009-09-17 14:45:15 +0000
@@ -17,7 +17,7 @@
17 >>> print extract_text(find_portlet(17 >>> print extract_text(find_portlet(
18 ... anon_browser.contents, 'View full history Current status'))18 ... anon_browser.contents, 'View full history Current status'))
19 View full history Current status19 View full history Current status
20 i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE20 Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
21 Started ... ago.21 Started ... ago.
22 Buildlog22 Buildlog
23 Dummy sampledata entry, not processing23 Dummy sampledata entry, not processing
@@ -31,7 +31,7 @@
31 >>> print extract_text(find_portlet(31 >>> print extract_text(find_portlet(
32 ... user_browser.contents, 'View full history Current status'))32 ... user_browser.contents, 'View full history Current status'))
33 View full history Current status33 View full history Current status
34 i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE34 Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
35 Started ... ago.35 Started ... ago.
36 Buildlog36 Buildlog
37 Dummy sampledata entry, not processing37 Dummy sampledata entry, not processing
@@ -214,6 +214,7 @@
214 >>> cprov_browser.getLink("Build Farm").click()214 >>> cprov_browser.getLink("Build Farm").click()
215215
216 >>> print extract_text(find_main_content(cprov_browser.contents))216 >>> print extract_text(find_main_content(cprov_browser.contents))
217 The Launchpad build farm
217 Register a new build machine218 Register a new build machine
218 0 available build machines, 1 disabled and 0 building of a total219 0 available build machines, 1 disabled and 0 building of a total
219 of 1 registered.220 of 1 registered.
220221
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt'
--- lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2009-09-10 22:08:36 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2009-09-17 14:45:15 +0000
@@ -13,6 +13,7 @@
13containing the build queue status summary for each build domain.13containing the build queue status summary for each build domain.
1414
15 >>> print extract_text(find_main_content(anon_browser.contents))15 >>> print extract_text(find_main_content(anon_browser.contents))
16 The Launchpad build farm
16 1 available build machine, 1 disabled and 1 building of a total of17 1 available build machine, 1 disabled and 1 building of a total of
17 2 registered.18 2 registered.
18 Builders19 Builders
@@ -26,6 +27,13 @@
26 Processor Builders Queue27 Processor Builders Queue
27 386 0 empty28 386 0 empty
2829
30When building, the 'Status' column contains a link to the
31corresponding 'Build' page.
32
33 >>> print anon_browser.getLink(
34 ... 'i386 build of mozilla-firefox 0.9').url
35 http://launchpad.dev/ubuntu/+source/mozilla-firefox/0.9/+build/8
36
29The build status portlets contain the number of builds waiting37The build status portlets contain the number of builds waiting
30in queue and the sum of their 'estimated_build_duration' for each38in queue and the sum of their 'estimated_build_duration' for each
31supported processor on each separated build domain, 'official'39supported processor on each separated build domain, 'official'
3240
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt'
--- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2009-09-10 22:32:06 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2009-09-17 14:45:15 +0000
@@ -58,24 +58,23 @@
58 >>> logout()58 >>> logout()
5959
60So now we can go to frog's builder page and see what the page shows us.60So now we can go to frog's builder page and see what the page shows us.
61The status shown to an anonymous user hides the fact that it's building a61The status shown to an anonymous user hides the private source it is
62private build:62building.
6363
64 >>> anon_browser.open("http://launchpad.dev/+builds/frog")64 >>> anon_browser.open("http://launchpad.dev/+builds/frog")
65 >>> print extract_text(find_main_content(anon_browser.contents))65 >>> print extract_text(find_main_content(anon_browser.contents))
66 The frog builder...66 The frog builder...
67 Current status67 Current status
68 The frog builder68 Building private source
69 is deactivated.
70 ...69 ...
7170
72
73Launchpad Administrators are allowed to see the build:71Launchpad Administrators are allowed to see the build:
7472
75 >>> admin_browser.open("http://launchpad.dev/+builds/frog")73 >>> admin_browser.open("http://launchpad.dev/+builds/frog")
76 >>> print extract_text(find_main_content(admin_browser.contents))74 >>> print extract_text(find_main_content(admin_browser.contents))
77 The frog builder...75 The frog builder...
78 Current status76 Current status
77 Building
79 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE78 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE
80 ...79 ...
8180
@@ -86,7 +85,7 @@
86 >>> print extract_text(find_main_content(name12_browser.contents))85 >>> print extract_text(find_main_content(name12_browser.contents))
87 The frog builder...86 The frog builder...
88 Current status87 Current status
89 The frog builder is deactivated.88 Building private source
90 ...89 ...
9190
92cprov is also allowed to see his own build:91cprov is also allowed to see his own build:
@@ -97,6 +96,7 @@
97 >>> print extract_text(find_main_content(cprov_browser.contents))96 >>> print extract_text(find_main_content(cprov_browser.contents))
98 The frog builder...97 The frog builder...
99 Current status98 Current status
99 Building
100 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE100 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE
101 ...101 ...
102102
@@ -229,7 +229,7 @@
229229
230 >>> admin_browser.open("http://launchpad.dev/+builds")230 >>> admin_browser.open("http://launchpad.dev/+builds")
231 >>> print extract_text(find_main_content(admin_browser.contents))231 >>> print extract_text(find_main_content(admin_browser.contents))
232 Register a new build machine232 The Launchpad build farm
233 ...233 ...
234 Name Processor Status234 Name Processor Status
235 bob 386 Building i386 build of mozilla-firefox ...235 bob 386 Building i386 build of mozilla-firefox ...
@@ -240,18 +240,18 @@
240240
241 >>> name12_browser.open("http://launchpad.dev/+builds")241 >>> name12_browser.open("http://launchpad.dev/+builds")
242 >>> print extract_text(find_main_content(name12_browser.contents))242 >>> print extract_text(find_main_content(name12_browser.contents))
243 Register a new build machine243 The Launchpad build farm
244 ...244 ...
245 Name Processor Status245 Name Processor Status
246 bob 386 Building i386 build of mozilla-firefox ...246 bob 386 Building i386 build of mozilla-firefox ...
247 frog 386 Building private build247 frog 386 Building private source
248 ...248 ...
249249
250cprov can see his own private build:250cprov can see his own private build:
251251
252 >>> cprov_browser.open("http://launchpad.dev/+builds")252 >>> cprov_browser.open("http://launchpad.dev/+builds")
253 >>> print extract_text(find_main_content(cprov_browser.contents))253 >>> print extract_text(find_main_content(cprov_browser.contents))
254 Register a new build machine254 The Launchpad build farm
255 ...255 ...
256 Name Processor Status256 Name Processor Status
257 bob 386 Building i386 build of mozilla-firefox ...257 bob 386 Building i386 build of mozilla-firefox ...
@@ -262,11 +262,12 @@
262262
263 >>> anon_browser.open("http://launchpad.dev/+builds")263 >>> anon_browser.open("http://launchpad.dev/+builds")
264 >>> print extract_text(find_main_content(anon_browser.contents))264 >>> print extract_text(find_main_content(anon_browser.contents))
265 1 available build machine, ...265 The Launchpad build farm
266 2 available build machines, ...
266 ...267 ...
267 Name Processor Status268 Name Processor Status
268 bob 386 Building i386 build of mozilla-firefox ...269 bob 386 Building i386 build of mozilla-firefox ...
269 frog 386 Building private build270 frog 386 Building private source
270 ...271 ...
271272
272273
@@ -326,7 +327,7 @@
326 >>> anon_browser = setupBrowser()327 >>> anon_browser = setupBrowser()
327 >>> anon_browser.open("http://launchpad.dev/+builds")328 >>> anon_browser.open("http://launchpad.dev/+builds")
328 >>> print extract_text(find_main_content(anon_browser.contents))329 >>> print extract_text(find_main_content(anon_browser.contents))
329 2 available build machines, ...330 The Launchpad build farm
330 ...331 ...
331 Name Processor Status332 Name Processor Status
332 bob 386 Building i386 build of mozilla-firefox ...333 bob 386 Building i386 build of mozilla-firefox ...
@@ -337,7 +338,7 @@
337338
338 >>> browser.open("http://launchpad.dev/+builds")339 >>> browser.open("http://launchpad.dev/+builds")
339 >>> print extract_text(find_main_content(browser.contents))340 >>> print extract_text(find_main_content(browser.contents))
340 2 available build machines, ...341 The Launchpad build farm
341 ...342 ...
342 Name Processor Status343 Name Processor Status
343 bob 386 Building i386 build of mozilla-firefox ...344 bob 386 Building i386 build of mozilla-firefox ...
344345
=== modified file 'lib/lp/soyuz/templates/builder-index.pt'
--- lib/lp/soyuz/templates/builder-index.pt 2009-08-19 20:00:00 +0000
+++ lib/lp/soyuz/templates/builder-index.pt 2009-09-16 19:06:48 +0000
@@ -29,46 +29,11 @@
29 </p>29 </p>
30 </div>30 </div>
31 <div class="yui-ge">31 <div class="yui-ge">
32
32 <div class="first yui-u">33 <div class="first yui-u">
33 <div class="portlet">34 <div metal:use-macro="template/macros/status" />
34 <h2>35 </div><!-- yui-u -->
35 <span class="see-all"><a
36 tal:replace="structure view/menu:overview/history/fmt:link" />
37 </span>
38 Current status</h2>
3936
40 <tal:no_job condition="not: job">
41 <p><tal:builder content="context/title" />
42 <tal:builderok condition="context/builderok"
43 >is idle.</tal:builderok>
44 <tal:buildernok condition="not: context/builderok"
45 >is deactivated.</tal:buildernok></p>
46 </tal:no_job>
47 <tal:job condition="job">
48 <tal:icon replace="structure job/build/image:icon" />
49 <a tal:attributes="href job/build/fmt:url">
50 <span tal:replace="job/build/title">NAME</span>
51 </a>
52 <p class="sprite">Started
53 <span tal:attributes="title job/buildstart/fmt:datetime"
54 tal:content="view/current_build_duration/fmt:exactduration"
55 />
56 ago.
57 </p>
58 <tal:logtail condition="job/logtail">
59 <h3>Buildlog</h3>
60 <div tal:content="structure job/logtail/fmt:text-to-html"
61 id="buildlog-tail" class="logtail">
62 Things are crashing and burning all over the place.
63 </div>
64 <p class="discreet" tal:condition="view/user">
65 Updated on
66 <span tal:replace="structure view/user/fmt:local-time"/>
67 </p>
68 </tal:logtail>
69 </tal:job>
70 </div><!-- portlet -->
71 </div><!-- yui-u -->
72 <div class="yui-u">37 <div class="yui-u">
73 <div class="portlet">38 <div class="portlet">
74 <h2>Builder information</h2>39 <h2>Builder information</h2>
@@ -111,5 +76,106 @@
111 <tal:menu replace="structure view/@@+related-pages" />76 <tal:menu replace="structure view/@@+related-pages" />
112 </div>77 </div>
113 </div>78 </div>
79
80
81<metal:macros fill-slot="bogus">
82
83 <metal:macro define-macro="status-summary">
84 <tal:comment replace="nothing">
85 Status summary.
86 :param builder: IBuilder, context builder.
87 :param job: IBuildQueue, job assigned to the builder.
88 </tal:comment>
89
90 <tal:no_job condition="not: job">
91 <tal:builderok condition="builder/builderok">
92 <tal:idle condition="not: builder/manual">
93 <span class="sortkey" tal:content="string:0" />
94 <span class="sprite yes green">Idle</span>
95 </tal:idle>
96 <tal:manual tal:condition="builder/manual">
97 <span class="sortkey" tal:content="string:1" />
98 <span class="sprite info">Manual</span>
99 </tal:manual>
100 </tal:builderok>
101 <tal:buildernok condition="not: builder/builderok">
102 <span class="sortkey" tal:content="string:2" />
103 <span class="sprite no red">Disabled</span>
104 </tal:buildernok>
105 </tal:no_job>
106
107 <tal:job condition="job">
108 <span class="sortkey" tal:content="job/id" />
109 <tal:build define="build job/build">
110 <tal:visible condition="build/required:launchpad.View">
111 <tal:icon replace="structure build/image:icon" />
112 Building
113 <a tal:attributes="href build/fmt:url"
114 tal:content="build/title"
115 >i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE</a>
116 <tal:ppa condition="build/archive/is_ppa"
117 define="ppa build/archive;">
118 <span tal:replace="string: [${ppa/owner/name}/${ppa/name}]"
119 >[cprov/ppa]</span>
120 </tal:ppa>
121 </tal:visible>
122 <tal:restricted condition="not: build/required:launchpad.View">
123 <img src="/@@/processing" alt="[building]" />
124 Building private source
125 </tal:restricted>
126 </tal:build>
127 </tal:job>
128
129 </metal:macro>
130
131
132 <metal:macro define-macro="status">
133 <tal:comment replace="nothing">
134 Status summary.
135 :param job: IBuildQueue, job assigned to the context builder.
136 </tal:comment>
137
138 <div class="portlet">
139 <h2>
140 <span class="see-all"><a
141 tal:replace="structure view/menu:overview/history/fmt:link" />
142 </span>
143 Current status</h2>
144
145 <p tal:define="builder context">
146 <metal:summary use-macro="template/macros/status-summary" />
147 </p>
148
149 <tal:buildernok condition="not: context/builderok">
150 <div tal:content="structure
151 context/failnotes/fmt:text-to-html" />
152 </tal:buildernok>
153
154 <tal:job condition="job">
155 <p class="sprite">Started
156 <span tal:attributes="title job/buildstart/fmt:datetime"
157 tal:content="view/current_build_duration/fmt:exactduration"
158 /> ago.</p>
159 <tal:visible condition="job/build/required:launchpad.View">
160 <tal:logtail condition="job/logtail">
161 <h3>Buildlog</h3>
162 <div tal:content="structure job/logtail/fmt:text-to-html"
163 id="buildlog-tail" class="logtail">
164 Things are crashing and burning all over the place.
165 </div>
166 <p class="discreet" tal:condition="view/user">
167 Updated on
168 <span tal:replace="structure view/user/fmt:local-time"/>
169 </p>
170 </tal:logtail>
171 </tal:visible>
172 </tal:job>
173 </div>
174
175 </metal:macro>
176
177</metal:macros>
178
179
114</body>180</body>
115</html>181</html>
116182
=== modified file 'lib/lp/soyuz/templates/builders-index.pt'
--- lib/lp/soyuz/templates/builders-index.pt 2009-08-29 05:15:41 +0000
+++ lib/lp/soyuz/templates/builders-index.pt 2009-09-16 18:53:46 +0000
@@ -75,21 +75,8 @@
75 >386</tal:processor>75 >386</tal:processor>
76 </td>76 </td>
77 <td tal:define="job builder/currentjob">77 <td tal:define="job builder/currentjob">
78 <tal:not-building condition="not: job">78 <metal:status-summary
79 <tal:idle condition="builder/builderok">79 use-macro="builder/@@+index/status-summary" />
80 <span class="sortkey" tal:content="string:1" />
81 <img src="/@@/yes" alt="[idle]" title="Idle" />
82 </tal:idle>
83 <tal:broken condition="not: builder/builderok">
84 <span class="sortkey" tal:content="string:0" />
85 <img src="/@@/no" alt="[disabled]" title="Disabled" />
86 </tal:broken>
87 </tal:not-building>
88 <tal:building condition="job">
89 <span class="sortkey" tal:content="job/id" />
90 <tal:icon replace="structure job/build/image:icon" />
91 </tal:building>
92 <tal:status replace="builder/status">Buiding fooo</tal:status>
93 </td>80 </td>
94 </tr>81 </tr>
95 </tbody>82 </tbody>