Merge lp:~julian-edwards/launchpad/trivial-ui into lp:launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: not available
Proposed branch: lp:~julian-edwards/launchpad/trivial-ui
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~julian-edwards/launchpad/trivial-ui
Reviewer Review Type Date Requested Status
Barry Warsaw (community) ui* Approve
Guilherme Salgado (community) Approve
Review via email: mp+12063@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Fix a bunch of trivial ui issues

== Proposed fix ==
 * https://bugs.edge.launchpad.net/bugs/328402 - show the ppa's signing key
fingerprint
 * https://bugs.edge.launchpad.net/soyuz/+bug/57559 - everything's already
fixed apart from the last item which is to change a heading
 * https://bugs.edge.launchpad.net/bugs/131515 - Fix inconsistent titles on
some package-related pages
 * https://bugs.edge.launchpad.net/bugs/237263 - add (pending) at the end of a
diff title's text if it's not ready to download yet

== Implementation details ==
Pretty trivial changes, I even removed some template code that was filling
heading slots!

== Tests ==
Loads involved. I already tested with -t stories -t pagetests -t doc and
everything passes.

== Demo and Q/A ==
Run this in "psql launchpad_dev" so cprov's PPA gets a signing key:
update archive set signing_key=1 where id=9;

https://launchpad.dev/ubuntu/warty/+source/mozilla-firefox/0.9
https://launchpad.dev/ubuntu/+source/mozilla-firefox/0.9
https://dogfood.launchpad.net/~cprov/+archive/ppa
https://dogfood.launchpad.net/~cprov/+archive/ppa/+packages

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/soyuz/model/distributionsourcepackagerelease.py
  lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
  lib/lp/soyuz/browser/distroseriessourcepackagerelease.py
  lib/lp/registry/browser/sourcepackage.py
  lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt
  lib/lp/soyuz/stories/soyuz/xx-package-diff.txt
  lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt
  lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt
  lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-
extra.pt
  lib/lp/soyuz/templates/archive-index.pt
  lib/lp/soyuz/browser/distributionsourcepackagerelease.py
  lib/lp/soyuz/model/distroseriessourcepackagerelease.py
  lib/lp/soyuz/doc/package-meta-classes.txt
  lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt

== Pylint notices ==

lib/lp/soyuz/model/distributionsourcepackagerelease.py
    39: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

lib/lp/soyuz/model/distroseriessourcepackagerelease.py
    27: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

Revision history for this message
Guilherme Salgado (salgado) wrote :

The code looks good

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

This page has incorrect headers:

https://launchpad.dev/~cprov/+archive/ppa/+packages

all the others look fine. It should be easy to fix that one, so conditional on that I'll approve the ui.

review: Approve (ui*)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/sourcepackage.py'
--- lib/lp/registry/browser/sourcepackage.py 2009-09-15 05:26:07 +0000
+++ lib/lp/registry/browser/sourcepackage.py 2009-09-18 12:18:51 +0000
@@ -72,7 +72,7 @@
72 """Builds a breadcrumb for an `ISourcePackage`."""72 """Builds a breadcrumb for an `ISourcePackage`."""
73 @property73 @property
74 def text(self):74 def text(self):
75 return smartquote('"%s" package') % (self.context.name)75 return smartquote('"%s" source package') % (self.context.name)
7676
7777
78class SourcePackageFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets):78class SourcePackageFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets):
@@ -161,7 +161,8 @@
161 @property161 @property
162 def page_title(self):162 def page_title(self):
163 """The HTML page title."""163 """The HTML page title."""
164 return '%s package' % self.context.name164 return smartquote('"%s" source package in %s') % (
165 self.context.name, self.context.distroseries.title)
165166
166 @property167 @property
167 def cancel_url(self):168 def cancel_url(self):
168169
=== modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-09 14:35:04 +0000
+++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000
@@ -23,6 +23,8 @@
23 IDistributionSourcePackageRelease)23 IDistributionSourcePackageRelease)
24from lp.soyuz.interfaces.publishing import PackagePublishingStatus24from lp.soyuz.interfaces.publishing import PackagePublishingStatus
2525
26from canonical.lazr.utils import smartquote
27
2628
27class DistributionSourcePackageReleaseNavigation(Navigation):29class DistributionSourcePackageReleaseNavigation(Navigation):
28 usedfor = IDistributionSourcePackageRelease30 usedfor = IDistributionSourcePackageRelease
@@ -45,8 +47,8 @@
45 usedfor = IDistributionSourcePackageRelease47 usedfor = IDistributionSourcePackageRelease
4648
47 @property49 @property
48 def page_title(self):50 def label(self):
49 return self.context.title51 return smartquote(self.context.title)
5052
51 @cachedproperty53 @cachedproperty
52 def _cached_publishing_history(self):54 def _cached_publishing_history(self):
5355
=== modified file 'lib/lp/soyuz/browser/distroseriessourcepackagerelease.py'
--- lib/lp/soyuz/browser/distroseriessourcepackagerelease.py 2009-06-25 04:06:00 +0000
+++ lib/lp/soyuz/browser/distroseriessourcepackagerelease.py 2009-09-18 12:18:51 +0000
@@ -12,6 +12,7 @@
12 IDistroSeriesSourcePackageRelease)12 IDistroSeriesSourcePackageRelease)
13from canonical.launchpad.webapp import (13from canonical.launchpad.webapp import (
14 ApplicationMenu, Navigation, stepthrough)14 ApplicationMenu, Navigation, stepthrough)
15from canonical.lazr.utils import smartquote
1516
1617
17class DistroSeriesSourcePackageReleaseOverviewMenu(ApplicationMenu):18class DistroSeriesSourcePackageReleaseOverviewMenu(ApplicationMenu):
@@ -50,3 +51,6 @@
50 self.context = context51 self.context = context
51 self.request = request52 self.request = request
5253
54 @property
55 def label(self):
56 return smartquote(self.context.title)
5357
=== modified file 'lib/lp/soyuz/doc/package-meta-classes.txt'
--- lib/lp/soyuz/doc/package-meta-classes.txt 2009-07-23 17:49:31 +0000
+++ lib/lp/soyuz/doc/package-meta-classes.txt 2009-09-18 12:18:51 +0000
@@ -52,9 +52,11 @@
52 >>> verifyObject(IDistroSeriesSourcePackageRelease, drspr)52 >>> verifyObject(IDistroSeriesSourcePackageRelease, drspr)
53 True53 True
5454
55 >>> drspr.displayname55 >>> print drspr.displayname
56 u'pmount 0.1-1'56 pmount 0.1-1
5757
58 >>> print drspr.title
59 "pmount" 0.1-1 source package in The Hoary Hedgehog Release
5860
59== Querying builds for DistributionSPR and DistroSeriesSPR ==61== Querying builds for DistributionSPR and DistroSeriesSPR ==
6062
6163
=== modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-03 11:56:54 +0000
+++ lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000
@@ -67,7 +67,7 @@
67 @property67 @property
68 def title(self):68 def title(self):
69 """See IDistributionSourcePackageRelease."""69 """See IDistributionSourcePackageRelease."""
70 return '%s %s (source) in %s' % (70 return '"%s" %s source package in %s' % (
71 self.name, self.version, self.distribution.displayname)71 self.name, self.version, self.distribution.displayname)
7272
73 @property73 @property
7474
=== modified file 'lib/lp/soyuz/model/distroseriessourcepackagerelease.py'
--- lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2009-06-25 04:06:00 +0000
+++ lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2009-09-18 12:18:51 +0000
@@ -58,9 +58,8 @@
58 @property58 @property
59 def title(self):59 def title(self):
60 """See `IDistroSeriesSourcePackageRelease`."""60 """See `IDistroSeriesSourcePackageRelease`."""
61 return '%s %s (source) in %s %s' % (61 return '"%s" %s source package in %s' % (
62 self.name, self.version, self.distribution.name,62 self.name, self.version, self.distroseries.title)
63 self.distroseries.name)
6463
65 @property64 @property
66 def version(self):65 def version(self):
6766
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt'
--- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-09-15 08:06:17 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-09-18 15:06:26 +0000
@@ -540,6 +540,7 @@
540540
541 >>> print extract_text(signing_key_section)541 >>> print extract_text(signing_key_section)
542 Signing key: 1024D/12345678 (What is this?)542 Signing key: 1024D/12345678 (What is this?)
543 Fingerprint: ABCDEF0123456789ABCDDCBA0000111112345678
543544
544The key fingerprint links to the actual key available in the ubuntu545The key fingerprint links to the actual key available in the ubuntu
545keyserver.546keyserver.
546547
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2009-09-10 22:08:36 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2009-09-18 10:18:17 +0000
@@ -231,8 +231,9 @@
231`DistroSeriesBinaryPackage` page.231`DistroSeriesBinaryPackage` page.
232232
233 >>> print extract_text(233 >>> print extract_text(
234 ... find_portlet(anon_browser.contents, 'Binary packages'))234 ... find_portlet(anon_browser.contents,
235 Binary packages235 ... 'Binary packages built by this source'))
236 Binary packages built by this source
236 foo-bin:237 foo-bin:
237 No summary available for foo-bin in ubuntutest breezy-autotest.238 No summary available for foo-bin in ubuntutest breezy-autotest.
238 No description available for foo-bin in ubuntutest breezy-autotest.239 No description available for foo-bin in ubuntutest breezy-autotest.
@@ -263,7 +264,8 @@
263264
264 >>> anon_browser.reload()265 >>> anon_browser.reload()
265 >>> print extract_text(266 >>> print extract_text(
266 ... find_portlet(anon_browser.contents, 'Binary packages'))267 ... find_portlet(anon_browser.contents,
267 Binary packages268 ... 'Binary packages built by this source'))
269 Binary packages built by this source
268 foo-bin: Foo app is great270 foo-bin: Foo app is great
269 Well ... it does nothing, though271 Well ... it does nothing, though
270272
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-package-diff.txt'
--- lib/lp/soyuz/stories/soyuz/xx-package-diff.txt 2009-09-10 08:07:46 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-package-diff.txt 2009-09-18 11:12:22 +0000
@@ -139,7 +139,7 @@
139 Pending in hoary-release139 Pending in hoary-release
140 ...140 ...
141 Available diffs141 Available diffs
142 1.0-2 to 1.0-3142 1.0-2 to 1.0-3 (pending)
143 ==============================143 ==============================
144 1.0-2144 1.0-2
145 Pending in hoary-release145 Pending in hoary-release
@@ -156,7 +156,9 @@
156 >>> print anon_browser.getLink('1.0-1 to 1.0-2').url156 >>> print anon_browser.getLink('1.0-1 to 1.0-2').url
157 http://.../biscuit_1.0-1_1.0-2.diff.gz157 http://.../biscuit_1.0-1_1.0-2.diff.gz
158158
159On the other hand, diffs not yet performed are rendered as plain text.159On the other hand, diffs not yet performed are rendered as plain text,
160and "(pending)" is appended to the text as a further hint that it's not
161ready yet.
160162
161 >>> anon_browser.getLink('1.0-2 to 1.0-3')163 >>> anon_browser.getLink('1.0-2 to 1.0-3')
162 Traceback (most recent call last):164 Traceback (most recent call last):
@@ -203,8 +205,12 @@
203 >>> login('foo.bar@canonical.com')205 >>> login('foo.bar@canonical.com')
204 >>> biscuit_ppa = name16.archive.getPublishedSources()[0]206 >>> biscuit_ppa = name16.archive.getPublishedSources()[0]
205 >>> biscuit_ppa_id = biscuit_ppa.id207 >>> biscuit_ppa_id = biscuit_ppa.id
208 >>> diff_three.date_fulfilled = None
209 >>> diff_three.status = PackageDiffStatus.PENDING
206 >>> logout()210 >>> logout()
207211
212The diff starts out as pending:
213
208 >>> expander_url = anon_browser.getLink(214 >>> expander_url = anon_browser.getLink(
209 ... id='pub%s-expander' % biscuit_ppa_id).url215 ... id='pub%s-expander' % biscuit_ppa_id).url
210 >>> anon_browser.open(expander_url)216 >>> anon_browser.open(expander_url)
@@ -212,10 +218,25 @@
212 Publishing details218 Publishing details
213 ...219 ...
214 Available diffs220 Available diffs
221 1.0-3 (in Ubuntu) to 1.0-4 (pending)
222 ...
223
224If we complete the diff, the text changes.
225
226 >>> login('foo.bar@canonical.com')
227 >>> perform_fake_diff(diff_three, 'biscuit_1.0-3_1.0-4.diff.gz')
228 >>> transaction.commit()
229 >>> logout()
230
231 >>> anon_browser.open(expander_url)
232 >>> print extract_text(anon_browser.contents)
233 Publishing details
234 ...
235 Available diffs
215 1.0-3 (in Ubuntu) to 1.0-4 (3 bytes)236 1.0-3 (in Ubuntu) to 1.0-4 (3 bytes)
216 ...237 ...
217238
218The text also link to the librarian file containing the diff.239The text also links to the librarian file containing the diff.
219240
220 >>> print anon_browser.getLink(241 >>> print anon_browser.getLink(
221 ... '1.0-3 (in Ubuntu) to 1.0-4').url242 ... '1.0-3 (in Ubuntu) to 1.0-4').url
222243
=== modified file 'lib/lp/soyuz/templates/archive-index.pt'
--- lib/lp/soyuz/templates/archive-index.pt 2009-09-17 11:35:39 +0000
+++ lib/lp/soyuz/templates/archive-index.pt 2009-09-18 15:06:26 +0000
@@ -113,6 +113,8 @@
113 (<a href="/+help/soyuz/ppa-sources-list.html"113 (<a href="/+help/soyuz/ppa-sources-list.html"
114 target="help">What is this?</a>)114 target="help">What is this?</a>)
115 </dd>115 </dd>
116 <dt>Fingerprint:</dt>
117 <dd tal:content="signing_key/fingerprint"/>
116 </dl>118 </dl>
117 <div id="archive-dependencies"119 <div id="archive-dependencies"
118 tal:condition="context/dependencies">120 tal:condition="context/dependencies">
119121
=== modified file 'lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt'
--- lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2009-09-09 21:17:10 +0000
+++ lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2009-09-18 12:18:51 +0000
@@ -9,10 +9,6 @@
99
10<body>10<body>
1111
12<div metal:fill-slot="heading">
13 <h1 tal:content="view/page_title">foo-bar 1.0 (source) in ubuntu</h1>
14</div>
15
16<div metal:fill-slot="main">12<div metal:fill-slot="main">
1713
18 <div id="source-changelog" class="top-portlet">14 <div id="source-changelog" class="top-portlet">
@@ -170,7 +166,7 @@
170 </div> <!-- source-files -->166 </div> <!-- source-files -->
171167
172 <div id="source-binaries" class="portlet">168 <div id="source-binaries" class="portlet">
173 <h2>Binary packages</h2>169 <h2>Binary packages built by this source</h2>
174 <div class="two-column-list">170 <div class="two-column-list">
175 <dl tal:repeat="binary context/sample_binary_packages">171 <dl tal:repeat="binary context/sample_binary_packages">
176 <dt>172 <dt>
177173
=== modified file 'lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt'
--- lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-09-07 11:40:40 +0000
+++ lib/lp/soyuz/templates/distroseriessourcepackagerelease-index.pt 2009-09-18 12:18:51 +0000
@@ -8,10 +8,6 @@
8>8>
9 <body>9 <body>
1010
11<div metal:fill-slot="heading">
12 <h1 tal:content="context/title"/>
13</div>
14
15<div metal:fill-slot="main">11<div metal:fill-slot="main">
1612
17 <div class="top-portlet">13 <div class="top-portlet">
1814
=== modified file 'lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt'
--- lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt 2009-09-18 11:12:22 +0000
@@ -26,7 +26,7 @@
26 <tal:pending condition="not: diff/date_fulfilled">26 <tal:pending condition="not: diff/date_fulfilled">
27 <tal:pending-diff replace="diff/title">27 <tal:pending-diff replace="diff/title">
28 1.0 (in Ubuntu) to 1.128 1.0 (in Ubuntu) to 1.1
29 </tal:pending-diff>29 </tal:pending-diff> (pending)
30 </tal:pending>30 </tal:pending>
31 <tal:fulfilled condition="diff/date_fulfilled">31 <tal:fulfilled condition="diff/date_fulfilled">
32 <a tal:attributes="href diff/diff_content/http_url"32 <a tal:attributes="href diff/diff_content/http_url"
3333
=== modified file 'lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt'
--- lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/soyuz/templates/sourcepackagerelease-diffs.pt 2009-09-18 11:12:22 +0000
@@ -15,7 +15,7 @@
15 <tal:pending condition="not: diff/date_fulfilled">15 <tal:pending condition="not: diff/date_fulfilled">
16 <tal:pending-diff replace="diff/title">16 <tal:pending-diff replace="diff/title">
17 1.0 (in Ubuntu) to 1.117 1.0 (in Ubuntu) to 1.1
18 </tal:pending-diff>18 </tal:pending-diff> (pending)
19 </tal:pending>19 </tal:pending>
20 <tal:fulfilled condition="diff/date_fulfilled">20 <tal:fulfilled condition="diff/date_fulfilled">
21 <a tal:attributes="href diff/diff_content/http_url"21 <a tal:attributes="href diff/diff_content/http_url"