Merge lp:~wgrant/launchpad/fix-build-breadcrumbs into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/fix-build-breadcrumbs
Merge into: lp:launchpad
Prerequisite: lp:~wgrant/launchpad/fix-soyuz-build-and-queue-titles
Diff against target: 303 lines (+60/-19)
12 files modified
lib/lp/soyuz/browser/build.py (+19/-0)
lib/lp/soyuz/browser/distributionsourcepackagerelease.py (+12/-2)
lib/lp/soyuz/configure.zcml (+10/-0)
lib/lp/soyuz/stories/packaging/package-pages-navigation.txt (+2/-2)
lib/lp/soyuz/stories/ppa/xx-copy-packages.txt (+2/-1)
lib/lp/soyuz/stories/ppa/xx-ppa-files.txt (+1/-1)
lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt (+2/-2)
lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-build-record.txt (+3/-3)
lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt (+4/-3)
lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-private-builds.txt (+2/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/fix-build-breadcrumbs
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Henning Eggers (community) code Approve
Review via email: mp+20888@code.launchpad.net

Commit message

Add breadcrumbs for Builds and DistributionSourcePackageReleases. Landed by henninge.

Description of the change

A followup to lp:~wgrant/launchpad/fix-soyuz-build-and-queue-titles (currently in pre-landing EC2), this branch adds breadcrumbs for DistributionSourcePackageReleases and Builds. The test changes should exhibit the change quite clearly. See the linked bug for discussion with noodles.

To post a comment you must log in.
Revision history for this message
Henning Eggers (henninge) wrote :

Nicely implemented, thank you. ;-) I think you should seek a UI review from noodles, which should be a no-brainer since you two already discussed it.

review: Approve (code)
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks for the improved breadcrumbs William.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/build.py'
2--- lib/lp/soyuz/browser/build.py 2010-03-09 01:55:59 +0000
3+++ lib/lp/soyuz/browser/build.py 2010-03-09 20:46:32 +0000
4@@ -6,6 +6,7 @@
5 __metaclass__ = type
6
7 __all__ = [
8+ 'BuildBreadcrumb',
9 'BuildContextMenu',
10 'BuildNavigation',
11 'BuildRecordsView',
12@@ -28,6 +29,7 @@
13 StandardLaunchpadFacets)
14 from canonical.launchpad.webapp.authorization import check_permission
15 from canonical.launchpad.webapp.batching import BatchNavigator
16+from canonical.launchpad.webapp.breadcrumb import Breadcrumb
17 from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
18 from canonical.lazr.utils import safe_hasattr
19 from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet
20@@ -121,6 +123,23 @@
21 enabled=self.context.can_be_rescored)
22
23
24+class BuildBreadcrumb(Breadcrumb):
25+ """Builds a breadcrumb for an `IBuild`."""
26+
27+ @property
28+ def text(self):
29+ # If this is a PPA or copy archive build, include the source
30+ # name and version. But for distro archives there are already
31+ # breadcrumbs for both, so we omit them.
32+ if self.context.archive.is_ppa or self.context.archive.is_copy:
33+ return '%s build of %s %s' % (
34+ self.context.arch_tag,
35+ self.context.sourcepackagerelease.sourcepackagename.name,
36+ self.context.sourcepackagerelease.version)
37+ else:
38+ return '%s build' % self.context.arch_tag
39+
40+
41 class BuildView(LaunchpadView):
42 """Auxiliary view class for IBuild"""
43 __used_for__ = IBuild
44
45=== modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py'
46--- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-22 13:11:13 +0000
47+++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-03-09 20:46:32 +0000
48@@ -4,9 +4,10 @@
49 __metaclass__ = type
50
51 __all__ = [
52+ 'DistributionSourcePackageReleaseBreadcrumb',
53 'DistributionSourcePackageReleaseNavigation',
54+ 'DistributionSourcePackageReleasePublishingHistoryView',
55 'DistributionSourcePackageReleaseView',
56- 'DistributionSourcePackageReleasePublishingHistoryView',
57 ]
58
59 import operator
60@@ -15,9 +16,10 @@
61
62 from canonical.cachedproperty import cachedproperty
63 from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias
64-from canonical.launchpad.webapp.interfaces import NotFoundError
65 from canonical.launchpad.webapp import (
66 LaunchpadView, Navigation, stepthrough)
67+from canonical.launchpad.webapp.breadcrumb import Breadcrumb
68+from canonical.launchpad.webapp.interfaces import NotFoundError
69 from lp.archivepublisher.debversion import Version
70 from lp.soyuz.interfaces.build import IBuildSet
71 from lp.soyuz.interfaces.distributionsourcepackagerelease import (
72@@ -27,6 +29,14 @@
73 from canonical.lazr.utils import smartquote
74
75
76+class DistributionSourcePackageReleaseBreadcrumb(Breadcrumb):
77+ """A breadcrumb for `IDistributionSourcePackageRelease`."""
78+
79+ @property
80+ def text(self):
81+ return self.context.version
82+
83+
84 class DistributionSourcePackageReleaseNavigation(Navigation):
85 usedfor = IDistributionSourcePackageRelease
86
87
88=== modified file 'lib/lp/soyuz/configure.zcml'
89--- lib/lp/soyuz/configure.zcml 2010-03-05 13:52:32 +0000
90+++ lib/lp/soyuz/configure.zcml 2010-03-09 20:46:32 +0000
91@@ -508,6 +508,11 @@
92 permission="launchpad.Edit"
93 set_attributes="buildlog datebuilt buildduration builder buildstate dependencies upload_log"/>
94 </class>
95+ <adapter
96+ provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
97+ for="lp.soyuz.interfaces.build.IBuild"
98+ factory="lp.soyuz.browser.build.BuildBreadcrumb"
99+ permission="zope.Public"/>
100
101 <!-- BuildSet -->
102
103@@ -610,6 +615,11 @@
104 <allow
105 interface="lp.soyuz.interfaces.distributionsourcepackagerelease.IDistributionSourcePackageRelease"/>
106 </class>
107+ <adapter
108+ provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
109+ for="lp.soyuz.interfaces.distributionsourcepackagerelease.IDistributionSourcePackageRelease"
110+ factory="lp.soyuz.browser.distributionsourcepackagerelease.DistributionSourcePackageReleaseBreadcrumb"
111+ permission="zope.Public"/>
112
113 <!-- DistroSeriesBinaryPackage -->
114
115
116=== modified file 'lib/lp/soyuz/stories/packaging/package-pages-navigation.txt'
117--- lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2009-11-09 17:08:21 +0000
118+++ lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2010-03-09 20:46:32 +0000
119@@ -52,7 +52,7 @@
120 >>> anon_browser.open(
121 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1')
122 >>> print_location(anon_browser.contents)
123- Hierarchy: Ubuntu > ?alsa-utils? package
124+ Hierarchy: Ubuntu > ?alsa-utils? package > 1.0.9a-4ubuntu1
125 Tabs:
126 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils
127 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils
128@@ -74,7 +74,7 @@
129 >>> anon_browser.open(
130 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1/+build/11')
131 >>> print_location(anon_browser.contents)
132- Hierarchy: Ubuntu > ?alsa-utils? package
133+ Hierarchy: Ubuntu > ?alsa-utils? package > 1.0.9a-4ubuntu1 > i386 build
134 Tabs:
135 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils
136 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils
137
138=== modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt'
139--- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2010-01-31 19:36:27 +0000
140+++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2010-03-09 20:46:32 +0000
141@@ -292,12 +292,13 @@
142
143 >>> jblack_browser.getLink('i386').click()
144 >>> print jblack_browser.title
145- PPA for James Blackwell : James Blackwell
146+ i386 build of pmount 0.1-1 : PPA for James Blackwell : James Blackwell
147
148 >>> print extract_text(find_main_content(jblack_browser.contents))
149 i386 build of pmount 0.1-1 in ubuntu hoary RELEASE
150 James Blackwell
151 PPA for James Blackwell
152+ i386 build of pmount 0.1-1
153 Build status Needs building
154 Start (2505) What's this?
155 Build details
156
157=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-files.txt'
158--- lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2010-02-23 12:05:49 +0000
159+++ lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2010-03-09 20:46:32 +0000
160@@ -205,7 +205,7 @@
161
162 >>> no_priv_browser.getLink('i386').click()
163 >>> print no_priv_browser.title
164- PPA named p3a for No Privileges Person : No Privileges Person
165+ i386 build of test-pkg 1.0 : PPA named p3a for No Privileges Person : No Privileges Person
166
167 >>> check_urls(no_priv_browser, build_links,
168 ... 'http://launchpad.dev/~no-priv/+archive/p3a/+build/31')
169
170=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt'
171--- lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt 2010-03-08 09:19:45 +0000
172+++ lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt 2010-03-09 20:46:32 +0000
173@@ -111,10 +111,10 @@
174 >>> anon_browser.getControl('Filter').click()
175 >>> anon_browser.getLink('i386 build of iceweasel').click()
176 >>> print anon_browser.title
177- Default PPA : Celso Providelo
178+ i386 build of iceweasel 1.0 : Default PPA : Celso Providelo
179
180 >>> print_location(anon_browser.contents)
181- Hierarchy: Celso Providelo > Default PPA
182+ Hierarchy: Celso Providelo > Default PPA > i386 build of iceweasel 1.0
183 Tabs:
184 * Overview (selected) - http://launchpad.dev/~cprov
185 * Branches - http://code.launchpad.dev/~cprov
186
187=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt'
188--- lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-03-08 09:19:45 +0000
189+++ lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-03-09 20:46:32 +0000
190@@ -437,7 +437,7 @@
191 >>> anon_browser.getLink('i386').click()
192
193 >>> print anon_browser.title
194- PPA for Celso Providelo : Celso Providelo
195+ i386 build of cdrkit 1.0 : PPA for Celso Providelo : Celso Providelo
196
197 This feature is also useful from the PPA owner perspective. When Celso
198 sees that there was a failure while building 'cdrkit' on i386 he can
199@@ -466,4 +466,4 @@
200
201 >>> anon_browser.getLink('i386').click()
202 >>> print anon_browser.title
203- PPA for Celso Providelo : Celso Providelo
204+ i386 build of cdrkit 1.0 : PPA for Celso Providelo : Celso Providelo
205
206=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
207--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-02-24 14:23:31 +0000
208+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-03-09 20:46:32 +0000
209@@ -45,7 +45,7 @@
210
211 >>> from canonical.launchpad.helpers import backslashreplace
212 >>> print backslashreplace(anon_browser.title)
213- \u201ctesting\u201d package : ubuntutest
214+ i386 build : 1.0 : \u201ctesting\u201d package : ubuntutest
215
216 In the page body readers can see 2 sections, 'Build status' and 'Build
217 details'.
218@@ -446,7 +446,7 @@
219 >>> anon_browser.open(ppa_build_url)
220
221 >>> print anon_browser.title
222- PPA for Celso Providelo : Celso Providelo
223+ i386 build of ppa-test 1.0 : PPA for Celso Providelo : Celso Providelo
224
225 The 'Build status' section is identical for PPAs.
226
227@@ -542,7 +542,7 @@
228 >>> anon_browser.open(imported_build_url)
229
230 >>> print backslashreplace(anon_browser.title)
231- \u201cimported\u201d package : ubuntutest
232+ i386 build : 666 : \u201cimported\u201d package : ubuntutest
233
234 >>> print extract_text(
235 ... find_tag_by_id(anon_browser.contents, 'binaries'))
236
237=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt'
238--- lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2010-01-11 05:01:32 +0000
239+++ lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2010-03-09 20:46:32 +0000
240@@ -39,13 +39,13 @@
241 Its title describes exactly what it is about.
242
243 >>> anon_browser.title
244- '\xe2\x80\x9ctesting-dspr\xe2\x80\x9d package : ubuntutest'
245+ '1.0 : \xe2\x80\x9ctesting-dspr\xe2\x80\x9d package : ubuntutest'
246
247 Its application bar has enabled entries for Code, Bugs and Answers, and
248 they all point to the `DistributionSourcePackage` (parent) url.
249
250 >>> print_location(anon_browser.contents)
251- Hierarchy: ubuntutest > ?testing-dspr? package
252+ Hierarchy: ubuntutest > ?testing-dspr? package > 1.0
253 Tabs:
254 * Overview (selected) - http://launchpad.dev/ubuntutest/+source/testing-dspr
255 * Branches - http://code.launchpad.dev/ubuntutest/+source/testing-dspr
256@@ -164,12 +164,13 @@
257
258 >>> from canonical.launchpad.helpers import backslashreplace
259 >>> print backslashreplace(anon_browser.title)
260- Publishing history : \u201ctesting-dspr\u201d package : ubuntutest
261+ Publishing history : 1.0 : \u201ctesting-dspr\u201d package : ubuntutest
262
263 >>> print extract_text(find_main_content(anon_browser.contents))
264 Publishing history of “testing-dspr” 1.0 source package in ubuntutest
265 ubuntutest
266 “testing-dspr” package
267+ 1.0
268 Publishing history
269 Date Status Target Pocket Component Section Version
270 ... Published Breezy... release main base 1.0
271
272=== modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt'
273--- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-03-08 11:22:05 +0000
274+++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-03-09 20:46:32 +0000
275@@ -81,7 +81,7 @@
276 <Link text='cr.g7-37' url='http://launchpad.dev/ubuntu/+source/cnews/cr.g7-37'>
277 >>> link.click()
278 >>> browser.title
279- '\xe2\x80\x9ccnews\xe2\x80\x9d package : Ubuntu'
280+ 'cr.g7-37 : \xe2\x80\x9ccnews\xe2\x80\x9d package : Ubuntu'
281
282
283 == Batched listing pages ==
284
285=== modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt'
286--- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2010-02-26 13:26:53 +0000
287+++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2010-03-09 20:46:32 +0000
288@@ -321,13 +321,13 @@
289 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %
290 ... private_build.id)
291 >>> print anon_browser.title
292- PPA named p3a for Celso Providelo : Celso Providelo
293+ i386 build of privacy-test 666 : PPA named p3a for Celso Providelo : Celso Providelo
294
295 >>> browser.open(
296 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %
297 ... private_build.id)
298 >>> print browser.title
299- PPA named p3a for Celso Providelo : Celso Providelo
300+ i386 build of privacy-test 666 : PPA named p3a for Celso Providelo : Celso Providelo
301
302 When accessing the distroseries source package release page, the builds
303 portlet will display a link to the newly unembargoed build: