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
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2010-03-09 01:55:59 +0000
+++ lib/lp/soyuz/browser/build.py 2010-03-09 20:46:32 +0000
@@ -6,6 +6,7 @@
6__metaclass__ = type6__metaclass__ = type
77
8__all__ = [8__all__ = [
9 'BuildBreadcrumb',
9 'BuildContextMenu',10 'BuildContextMenu',
10 'BuildNavigation',11 'BuildNavigation',
11 'BuildRecordsView',12 'BuildRecordsView',
@@ -28,6 +29,7 @@
28 StandardLaunchpadFacets)29 StandardLaunchpadFacets)
29from canonical.launchpad.webapp.authorization import check_permission30from canonical.launchpad.webapp.authorization import check_permission
30from canonical.launchpad.webapp.batching import BatchNavigator31from canonical.launchpad.webapp.batching import BatchNavigator
32from canonical.launchpad.webapp.breadcrumb import Breadcrumb
31from canonical.launchpad.webapp.interfaces import ICanonicalUrlData33from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
32from canonical.lazr.utils import safe_hasattr34from canonical.lazr.utils import safe_hasattr
33from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet35from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet
@@ -121,6 +123,23 @@
121 enabled=self.context.can_be_rescored)123 enabled=self.context.can_be_rescored)
122124
123125
126class BuildBreadcrumb(Breadcrumb):
127 """Builds a breadcrumb for an `IBuild`."""
128
129 @property
130 def text(self):
131 # If this is a PPA or copy archive build, include the source
132 # name and version. But for distro archives there are already
133 # breadcrumbs for both, so we omit them.
134 if self.context.archive.is_ppa or self.context.archive.is_copy:
135 return '%s build of %s %s' % (
136 self.context.arch_tag,
137 self.context.sourcepackagerelease.sourcepackagename.name,
138 self.context.sourcepackagerelease.version)
139 else:
140 return '%s build' % self.context.arch_tag
141
142
124class BuildView(LaunchpadView):143class BuildView(LaunchpadView):
125 """Auxiliary view class for IBuild"""144 """Auxiliary view class for IBuild"""
126 __used_for__ = IBuild145 __used_for__ = IBuild
127146
=== modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-22 13:11:13 +0000
+++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-03-09 20:46:32 +0000
@@ -4,9 +4,10 @@
4__metaclass__ = type4__metaclass__ = type
55
6__all__ = [6__all__ = [
7 'DistributionSourcePackageReleaseBreadcrumb',
7 'DistributionSourcePackageReleaseNavigation',8 'DistributionSourcePackageReleaseNavigation',
9 'DistributionSourcePackageReleasePublishingHistoryView',
8 'DistributionSourcePackageReleaseView',10 'DistributionSourcePackageReleaseView',
9 'DistributionSourcePackageReleasePublishingHistoryView',
10 ]11 ]
1112
12import operator13import operator
@@ -15,9 +16,10 @@
1516
16from canonical.cachedproperty import cachedproperty17from canonical.cachedproperty import cachedproperty
17from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias18from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias
18from canonical.launchpad.webapp.interfaces import NotFoundError
19from canonical.launchpad.webapp import (19from canonical.launchpad.webapp import (
20 LaunchpadView, Navigation, stepthrough)20 LaunchpadView, Navigation, stepthrough)
21from canonical.launchpad.webapp.breadcrumb import Breadcrumb
22from canonical.launchpad.webapp.interfaces import NotFoundError
21from lp.archivepublisher.debversion import Version23from lp.archivepublisher.debversion import Version
22from lp.soyuz.interfaces.build import IBuildSet24from lp.soyuz.interfaces.build import IBuildSet
23from lp.soyuz.interfaces.distributionsourcepackagerelease import (25from lp.soyuz.interfaces.distributionsourcepackagerelease import (
@@ -27,6 +29,14 @@
27from canonical.lazr.utils import smartquote29from canonical.lazr.utils import smartquote
2830
2931
32class DistributionSourcePackageReleaseBreadcrumb(Breadcrumb):
33 """A breadcrumb for `IDistributionSourcePackageRelease`."""
34
35 @property
36 def text(self):
37 return self.context.version
38
39
30class DistributionSourcePackageReleaseNavigation(Navigation):40class DistributionSourcePackageReleaseNavigation(Navigation):
31 usedfor = IDistributionSourcePackageRelease41 usedfor = IDistributionSourcePackageRelease
3242
3343
=== modified file 'lib/lp/soyuz/configure.zcml'
--- lib/lp/soyuz/configure.zcml 2010-03-05 13:52:32 +0000
+++ lib/lp/soyuz/configure.zcml 2010-03-09 20:46:32 +0000
@@ -508,6 +508,11 @@
508 permission="launchpad.Edit"508 permission="launchpad.Edit"
509 set_attributes="buildlog datebuilt buildduration builder buildstate dependencies upload_log"/>509 set_attributes="buildlog datebuilt buildduration builder buildstate dependencies upload_log"/>
510 </class>510 </class>
511 <adapter
512 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
513 for="lp.soyuz.interfaces.build.IBuild"
514 factory="lp.soyuz.browser.build.BuildBreadcrumb"
515 permission="zope.Public"/>
511516
512 <!-- BuildSet -->517 <!-- BuildSet -->
513518
@@ -610,6 +615,11 @@
610 <allow615 <allow
611 interface="lp.soyuz.interfaces.distributionsourcepackagerelease.IDistributionSourcePackageRelease"/>616 interface="lp.soyuz.interfaces.distributionsourcepackagerelease.IDistributionSourcePackageRelease"/>
612 </class>617 </class>
618 <adapter
619 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
620 for="lp.soyuz.interfaces.distributionsourcepackagerelease.IDistributionSourcePackageRelease"
621 factory="lp.soyuz.browser.distributionsourcepackagerelease.DistributionSourcePackageReleaseBreadcrumb"
622 permission="zope.Public"/>
613623
614 <!-- DistroSeriesBinaryPackage -->624 <!-- DistroSeriesBinaryPackage -->
615625
616626
=== modified file 'lib/lp/soyuz/stories/packaging/package-pages-navigation.txt'
--- lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2009-11-09 17:08:21 +0000
+++ lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2010-03-09 20:46:32 +0000
@@ -52,7 +52,7 @@
52 >>> anon_browser.open(52 >>> anon_browser.open(
53 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1')53 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1')
54 >>> print_location(anon_browser.contents)54 >>> print_location(anon_browser.contents)
55 Hierarchy: Ubuntu > ?alsa-utils? package55 Hierarchy: Ubuntu > ?alsa-utils? package > 1.0.9a-4ubuntu1
56 Tabs:56 Tabs:
57 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils57 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils
58 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils58 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils
@@ -74,7 +74,7 @@
74 >>> anon_browser.open(74 >>> anon_browser.open(
75 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1/+build/11')75 ... 'http://launchpad.dev/ubuntu/+source/alsa-utils/1.0.9a-4ubuntu1/+build/11')
76 >>> print_location(anon_browser.contents)76 >>> print_location(anon_browser.contents)
77 Hierarchy: Ubuntu > ?alsa-utils? package77 Hierarchy: Ubuntu > ?alsa-utils? package > 1.0.9a-4ubuntu1 > i386 build
78 Tabs:78 Tabs:
79 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils79 * Overview (selected) - http://launchpad.dev/ubuntu/+source/alsa-utils
80 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils80 * Branches - http://code.launchpad.dev/ubuntu/+source/alsa-utils
8181
=== modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt'
--- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2010-01-31 19:36:27 +0000
+++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2010-03-09 20:46:32 +0000
@@ -292,12 +292,13 @@
292292
293 >>> jblack_browser.getLink('i386').click()293 >>> jblack_browser.getLink('i386').click()
294 >>> print jblack_browser.title294 >>> print jblack_browser.title
295 PPA for James Blackwell : James Blackwell295 i386 build of pmount 0.1-1 : PPA for James Blackwell : James Blackwell
296296
297 >>> print extract_text(find_main_content(jblack_browser.contents))297 >>> print extract_text(find_main_content(jblack_browser.contents))
298 i386 build of pmount 0.1-1 in ubuntu hoary RELEASE298 i386 build of pmount 0.1-1 in ubuntu hoary RELEASE
299 James Blackwell299 James Blackwell
300 PPA for James Blackwell300 PPA for James Blackwell
301 i386 build of pmount 0.1-1
301 Build status Needs building302 Build status Needs building
302 Start (2505) What's this?303 Start (2505) What's this?
303 Build details304 Build details
304305
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-files.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2010-02-23 12:05:49 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2010-03-09 20:46:32 +0000
@@ -205,7 +205,7 @@
205205
206 >>> no_priv_browser.getLink('i386').click()206 >>> no_priv_browser.getLink('i386').click()
207 >>> print no_priv_browser.title207 >>> print no_priv_browser.title
208 PPA named p3a for No Privileges Person : No Privileges Person208 i386 build of test-pkg 1.0 : PPA named p3a for No Privileges Person : No Privileges Person
209209
210 >>> check_urls(no_priv_browser, build_links,210 >>> check_urls(no_priv_browser, build_links,
211 ... 'http://launchpad.dev/~no-priv/+archive/p3a/+build/31')211 ... 'http://launchpad.dev/~no-priv/+archive/p3a/+build/31')
212212
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt 2010-03-08 09:19:45 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-navigation.txt 2010-03-09 20:46:32 +0000
@@ -111,10 +111,10 @@
111 >>> anon_browser.getControl('Filter').click()111 >>> anon_browser.getControl('Filter').click()
112 >>> anon_browser.getLink('i386 build of iceweasel').click()112 >>> anon_browser.getLink('i386 build of iceweasel').click()
113 >>> print anon_browser.title113 >>> print anon_browser.title
114 Default PPA : Celso Providelo114 i386 build of iceweasel 1.0 : Default PPA : Celso Providelo
115115
116 >>> print_location(anon_browser.contents)116 >>> print_location(anon_browser.contents)
117 Hierarchy: Celso Providelo > Default PPA117 Hierarchy: Celso Providelo > Default PPA > i386 build of iceweasel 1.0
118 Tabs:118 Tabs:
119 * Overview (selected) - http://launchpad.dev/~cprov119 * Overview (selected) - http://launchpad.dev/~cprov
120 * Branches - http://code.launchpad.dev/~cprov120 * Branches - http://code.launchpad.dev/~cprov
121121
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-03-08 09:19:45 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-03-09 20:46:32 +0000
@@ -437,7 +437,7 @@
437 >>> anon_browser.getLink('i386').click()437 >>> anon_browser.getLink('i386').click()
438438
439 >>> print anon_browser.title439 >>> print anon_browser.title
440 PPA for Celso Providelo : Celso Providelo440 i386 build of cdrkit 1.0 : PPA for Celso Providelo : Celso Providelo
441441
442This feature is also useful from the PPA owner perspective. When Celso442This feature is also useful from the PPA owner perspective. When Celso
443sees that there was a failure while building 'cdrkit' on i386 he can443sees that there was a failure while building 'cdrkit' on i386 he can
@@ -466,4 +466,4 @@
466466
467 >>> anon_browser.getLink('i386').click()467 >>> anon_browser.getLink('i386').click()
468 >>> print anon_browser.title468 >>> print anon_browser.title
469 PPA for Celso Providelo : Celso Providelo469 i386 build of cdrkit 1.0 : PPA for Celso Providelo : Celso Providelo
470470
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-02-24 14:23:31 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-03-09 20:46:32 +0000
@@ -45,7 +45,7 @@
4545
46 >>> from canonical.launchpad.helpers import backslashreplace46 >>> from canonical.launchpad.helpers import backslashreplace
47 >>> print backslashreplace(anon_browser.title)47 >>> print backslashreplace(anon_browser.title)
48 \u201ctesting\u201d package : ubuntutest48 i386 build : 1.0 : \u201ctesting\u201d package : ubuntutest
4949
50In the page body readers can see 2 sections, 'Build status' and 'Build50In the page body readers can see 2 sections, 'Build status' and 'Build
51details'.51details'.
@@ -446,7 +446,7 @@
446 >>> anon_browser.open(ppa_build_url)446 >>> anon_browser.open(ppa_build_url)
447447
448 >>> print anon_browser.title448 >>> print anon_browser.title
449 PPA for Celso Providelo : Celso Providelo449 i386 build of ppa-test 1.0 : PPA for Celso Providelo : Celso Providelo
450450
451The 'Build status' section is identical for PPAs.451The 'Build status' section is identical for PPAs.
452452
@@ -542,7 +542,7 @@
542 >>> anon_browser.open(imported_build_url)542 >>> anon_browser.open(imported_build_url)
543543
544 >>> print backslashreplace(anon_browser.title)544 >>> print backslashreplace(anon_browser.title)
545 \u201cimported\u201d package : ubuntutest545 i386 build : 666 : \u201cimported\u201d package : ubuntutest
546546
547 >>> print extract_text(547 >>> print extract_text(
548 ... find_tag_by_id(anon_browser.contents, 'binaries'))548 ... find_tag_by_id(anon_browser.contents, 'binaries'))
549549
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2010-01-11 05:01:32 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2010-03-09 20:46:32 +0000
@@ -39,13 +39,13 @@
39Its title describes exactly what it is about.39Its title describes exactly what it is about.
4040
41 >>> anon_browser.title41 >>> anon_browser.title
42 '\xe2\x80\x9ctesting-dspr\xe2\x80\x9d package : ubuntutest'42 '1.0 : \xe2\x80\x9ctesting-dspr\xe2\x80\x9d package : ubuntutest'
4343
44Its application bar has enabled entries for Code, Bugs and Answers, and44Its application bar has enabled entries for Code, Bugs and Answers, and
45they all point to the `DistributionSourcePackage` (parent) url.45they all point to the `DistributionSourcePackage` (parent) url.
4646
47 >>> print_location(anon_browser.contents)47 >>> print_location(anon_browser.contents)
48 Hierarchy: ubuntutest > ?testing-dspr? package48 Hierarchy: ubuntutest > ?testing-dspr? package > 1.0
49 Tabs:49 Tabs:
50 * Overview (selected) - http://launchpad.dev/ubuntutest/+source/testing-dspr50 * Overview (selected) - http://launchpad.dev/ubuntutest/+source/testing-dspr
51 * Branches - http://code.launchpad.dev/ubuntutest/+source/testing-dspr51 * Branches - http://code.launchpad.dev/ubuntutest/+source/testing-dspr
@@ -164,12 +164,13 @@
164164
165 >>> from canonical.launchpad.helpers import backslashreplace165 >>> from canonical.launchpad.helpers import backslashreplace
166 >>> print backslashreplace(anon_browser.title)166 >>> print backslashreplace(anon_browser.title)
167 Publishing history : \u201ctesting-dspr\u201d package : ubuntutest167 Publishing history : 1.0 : \u201ctesting-dspr\u201d package : ubuntutest
168168
169 >>> print extract_text(find_main_content(anon_browser.contents))169 >>> print extract_text(find_main_content(anon_browser.contents))
170 Publishing history of “testing-dspr” 1.0 source package in ubuntutest170 Publishing history of “testing-dspr” 1.0 source package in ubuntutest
171 ubuntutest171 ubuntutest
172 “testing-dspr” package172 “testing-dspr” package
173 1.0
173 Publishing history174 Publishing history
174 Date Status Target Pocket Component Section Version175 Date Status Target Pocket Component Section Version
175 ... Published Breezy... release main base 1.0176 ... Published Breezy... release main base 1.0
176177
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-03-08 11:22:05 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-03-09 20:46:32 +0000
@@ -81,7 +81,7 @@
81 <Link text='cr.g7-37' url='http://launchpad.dev/ubuntu/+source/cnews/cr.g7-37'>81 <Link text='cr.g7-37' url='http://launchpad.dev/ubuntu/+source/cnews/cr.g7-37'>
82 >>> link.click()82 >>> link.click()
83 >>> browser.title83 >>> browser.title
84 '\xe2\x80\x9ccnews\xe2\x80\x9d package : Ubuntu'84 'cr.g7-37 : \xe2\x80\x9ccnews\xe2\x80\x9d package : Ubuntu'
8585
8686
87== Batched listing pages ==87== Batched listing pages ==
8888
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt'
--- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2010-02-26 13:26:53 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2010-03-09 20:46:32 +0000
@@ -321,13 +321,13 @@
321 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %321 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %
322 ... private_build.id)322 ... private_build.id)
323 >>> print anon_browser.title323 >>> print anon_browser.title
324 PPA named p3a for Celso Providelo : Celso Providelo324 i386 build of privacy-test 666 : PPA named p3a for Celso Providelo : Celso Providelo
325325
326 >>> browser.open(326 >>> browser.open(
327 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %327 ... "http://launchpad.dev/~cprov/+archive/p3a/+build/%s" %
328 ... private_build.id)328 ... private_build.id)
329 >>> print browser.title329 >>> print browser.title
330 PPA named p3a for Celso Providelo : Celso Providelo330 i386 build of privacy-test 666 : PPA named p3a for Celso Providelo : Celso Providelo
331331
332When accessing the distroseries source package release page, the builds332When accessing the distroseries source package release page, the builds
333portlet will display a link to the newly unembargoed build:333portlet will display a link to the newly unembargoed build: