Merge lp:~michael.nelson/launchpad/430459-link-build-failures-updates-portlet into lp:launchpad

Proposed by Michael Nelson
Status: Merged
Merged at revision: not available
Proposed branch: lp:~michael.nelson/launchpad/430459-link-build-failures-updates-portlet
Merge into: lp:launchpad
Diff against target: 123 lines
5 files modified
lib/canonical/launchpad/icing/style-3-0.css (+1/-1)
lib/lp/soyuz/browser/archive.py (+11/-3)
lib/lp/soyuz/browser/tests/archive-views.txt (+7/-5)
lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt (+1/-1)
lib/lp/soyuz/templates/archive-macros.pt (+6/-0)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/430459-link-build-failures-updates-portlet
Reviewer Review Type Date Requested Status
Eleanor Berger (community) ui* Approve
Abel Deuring (community) Approve
Review via email: mp+13463@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

= Summary =

This branch fixes bug 430459 by ensuring that if the Latest updates
portlet on the PPA page displays a failure, that the relevant failed
builds are listed and linked (unobtrusively).

See:
http://people.canonical.com/~michaeln/tmp/linked_failed_build.png

== Proposed fix ==

== Pre-implementation notes ==

See bug 430459.

== Implementation details ==

== Tests ==
bin/test -vv -t archive-views.txt -t xx-ubuntu-ppas.txt

== Demo and Q/A ==

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

QA: check a ppa with a recent failed build on edge.

= 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/stories/ppa/xx-ubuntu-ppas.txt
  lib/lp/soyuz/browser/tests/archive-views.txt
  lib/lp/soyuz/templates/archive-macros.pt
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/soyuz/browser/archive.py

--
Michael

Revision history for this message
Abel Deuring (adeuring) wrote :

nice branch!

review: Approve
Revision history for this message
Eleanor Berger (intellectronica) wrote :

ui=me*

The change looks really great. We've discussed on IRC how the failed build icon reuses the same metaphor the remove icon uses and agreed to talk to Martin about it - maybe it's worth trying to adress that in a later branch.

review: Approve (ui*)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
2--- lib/canonical/launchpad/icing/style-3-0.css 2009-10-15 12:39:00 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2009-10-16 12:00:32 +0000
4@@ -697,7 +697,7 @@
5
6 /* For the Latest updates portlet
7 * at https://launchpad.dev/~cprov/+archive/ppa */
8-ul.latest-ppa-updates .duration {
9+ul.latest-ppa-updates .duration, ul.latest-ppa-updates .build-details {
10 font-size: 75%;
11 }
12 ul.latest-ppa-updates li {
13
14=== modified file 'lib/lp/soyuz/browser/archive.py'
15--- lib/lp/soyuz/browser/archive.py 2009-10-12 17:10:54 +0000
16+++ lib/lp/soyuz/browser/archive.py 2009-10-16 12:00:32 +0000
17@@ -62,7 +62,7 @@
18 from lp.soyuz.interfaces.archivesubscriber import (
19 IArchiveSubscriberSet)
20 from lp.soyuz.interfaces.build import (
21- BuildStatus, IBuildSet)
22+ BuildStatus, BuildSetStatus, IBuildSet)
23 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
24 from lp.soyuz.interfaces.component import IComponentSet
25 from lp.registry.interfaces.distroseries import DistroSeriesStatus
26@@ -817,21 +817,29 @@
27 'FULLYBUILT': 'Successfully built',
28 'FULLYBUILT_PENDING': 'Successfully built',
29 'NEEDSBUILD': 'Waiting to build',
30- 'FAILEDTOBUILD': 'Failed to build',
31+ 'FAILEDTOBUILD': 'Failed to build:',
32 'BUILDING': 'Currently building',
33 }
34
35 now = datetime.now(tz=pytz.UTC)
36 for result_tuple in result_tuples:
37 source_pub = result_tuple[0]
38- current_status = source_pub.getStatusSummaryForBuilds()['status']
39+ status_summary = source_pub.getStatusSummaryForBuilds()
40+ current_status = status_summary['status']
41 duration = now - source_pub.datepublished
42
43+ # We'd like to include the builds in the latest updates
44+ # iff the build failed.
45+ builds = []
46+ if current_status == BuildSetStatus.FAILEDTOBUILD:
47+ builds = status_summary['builds']
48+
49 latest_updates_list.append({
50 'title': source_pub.source_package_name,
51 'status': status_names[current_status.title],
52 'status_class': current_status.title,
53 'duration': duration,
54+ 'builds': builds
55 })
56
57 return latest_updates_list
58
59=== modified file 'lib/lp/soyuz/browser/tests/archive-views.txt'
60--- lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-05 18:29:12 +0000
61+++ lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-16 12:00:32 +0000
62@@ -304,16 +304,18 @@
63 >>> login(ANONYMOUS)
64
65 The ArchiveView also provides the latest updates ordered by the date
66-they were published:
67+they were published. We include any relevant builds for failures.
68
69 >>> def print_latest_updates(latest_updates):
70 ... for update in latest_updates:
71- ... print "%s - %s" % (
72+ ... arch_tags = [build.arch_tag for build in update['builds']]
73+ ... print "%s - %s %s" % (
74 ... update['title'],
75- ... update['status']
76+ ... update['status'],
77+ ... " ".join(arch_tags),
78 ... )
79 >>> print_latest_updates(view.latest_updates)
80- cdrkit - Failed to build
81+ cdrkit - Failed to build: i386
82 pmount - Successfully built
83 iceweasel - Successfully built
84
85@@ -326,7 +328,7 @@
86 >>> login(ANONYMOUS)
87 >>> print_latest_updates(view.latest_updates)
88 iceweasel - Successfully built
89- cdrkit - Failed to build
90+ cdrkit - Failed to build: i386
91 pmount - Successfully built
92
93 The ArchiveView also includes a helper method to return the number of
94
95=== modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt'
96--- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-10-14 17:05:14 +0000
97+++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-10-16 12:00:32 +0000
98@@ -371,7 +371,7 @@
99 >>> print extract_text(latest_updates)
100 Latest updates
101 cdrkit ... ago
102- Failed to build
103+ Failed to build: i386
104 pmount ... ago
105 Successfully built
106 iceweasel ... ago
107
108=== modified file 'lib/lp/soyuz/templates/archive-macros.pt'
109--- lib/lp/soyuz/templates/archive-macros.pt 2009-09-21 14:45:36 +0000
110+++ lib/lp/soyuz/templates/archive-macros.pt 2009-10-16 12:00:32 +0000
111@@ -371,6 +371,12 @@
112 ago
113 </span><br />
114 <span tal:replace="update/status">Successful</span>
115+ <span tal:condition="update/builds"
116+ class="build-details">
117+ <a tal:repeat="build update/builds"
118+ tal:attributes="href build/fmt:url"
119+ tal:content="build/arch_tag">i386</a>
120+ </span>
121 </li>
122 </ul>
123 </tal:updates>