Merge lp:~kfogel/launchpad/255868-patches-view-from-bugs-page into lp:launchpad/db-devel

Proposed by Karl Fogel
Status: Merged
Approved by: Curtis Hovey
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~kfogel/launchpad/255868-patches-view-from-bugs-page
Merge into: lp:launchpad/db-devel
Diff against target: 547 lines (+206/-48)
5 files modified
lib/lp/bugs/browser/bugtask.py (+10/-1)
lib/lp/bugs/stories/patches-view/patches-view.txt (+89/-0)
lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt (+52/-46)
lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt (+10/-0)
lib/lp/bugs/tests/bug.py (+45/-1)
To merge this branch: bzr merge lp:~kfogel/launchpad/255868-patches-view-from-bugs-page
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui and code Approve
Review via email: mp+19438@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Karl Fogel (kfogel) wrote :

Put a "bugs with patches" statistic in the upper right portlet box on the bugs page (for products, project groups, and any other foo that has a "bugs.launchpad.net/foo" page.

Revision history for this message
Karl Fogel (kfogel) wrote :

Requesting review on UI only right now, as still writing tests.

Revision history for this message
Karl Fogel (kfogel) wrote :

See the two most recent screenshots in the linked bug, for UI review.

9005. By Karl Fogel

Merge from db-devel.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Karl.

This UI change is consistent with the rest of the page, and I think it is good to land. As I said on IRC, this list is now long and I think we are committed to rethink the list if we want to add another report to this page--a problem we can solve in the future.

review: Approve (ui)
9006. By Karl Fogel

Tests for Bug #255868: link to "+patches" view from product bugs page.

* lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt:
  Extend test output to expect the new item.

9007. By Karl Fogel

Add tests for Bug #255868 (link to "+patches" view from product bugs page).

* lib/lp/bugs/tests/bug.py: Import print_table.
  (print_bugfilters_portlet_unfilled,
   print_bugfilters_portlet_filled): New functions.

* lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt:
  (print_portlet, print_portlet_contents): Remove, as these
  have now been moved to bug.py and renamed as per above.
  Use the replacements, and extend expected test output to
  include the new "bugs with patches" item.

* lib/lp/bugs/stories/patches-view/patches-view.txt:
  Add tests for the presence and accuracy of the new stats.

9008. By Karl Fogel

Merge from db-devel.

9009. By Karl Fogel

For bug #255868 (link to "+patches" view from product bugs page),
include all statuses in count of bugs with patches, and update
tests accordingly. Also, fix a missing import in one test file.

* lib/lp/bugs/browser/bugtask.py: Import RESOLVED_BUGTASK_STATUSES.
  (BugsStatsMixin.bugs_with_patches_count): Include all bugs in count.

* lib/lp/bugs/stories/patches-view/patches-view.txt: Expect
  5 bugs with patches now, instead of 4, due to above change.

* lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt: Import
  print_bugfilters_portlet_unfilled, print_bugfilters_portlet_filled.

Revision history for this message
Karl Fogel (kfogel) wrote :

I've now added tests for the feature. Also, I tweaked the behavior slightly after talking with Jorge Castro: it now shows the count of bugs-with-patches including both resolved and unresolved bugs. The reason for this is that it may be an upstream dev coming to look at patches, whereas the resolution might be set by a distro maintainer who doesn't necessarily have upstream in mind. (Also, this makes the bugfilter stats portlet count consistent with what we show on the +patches view page that the portlet links to.)

Jorge and I agree to check with users of the feature after a few weeks to see how things are working out.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thanks for providing the tests, and more thanks for refactoring them.

review: Approve (ui and code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2010-02-16 15:08:03 +0000
+++ lib/lp/bugs/browser/bugtask.py 2010-02-19 06:44:15 +0000
@@ -109,7 +109,8 @@
109 IDistroSeriesBugTask, IFrontPageBugTaskSearch,109 IDistroSeriesBugTask, IFrontPageBugTaskSearch,
110 INominationsReviewTableBatchNavigator, INullBugTask, IPersonBugTaskSearch,110 INominationsReviewTableBatchNavigator, INullBugTask, IPersonBugTaskSearch,
111 IProductSeriesBugTask, IRemoveQuestionFromBugTaskForm, IUpstreamBugTask,111 IProductSeriesBugTask, IRemoveQuestionFromBugTaskForm, IUpstreamBugTask,
112 IUpstreamProductBugTaskSearch, UNRESOLVED_BUGTASK_STATUSES)112 IUpstreamProductBugTaskSearch, UNRESOLVED_BUGTASK_STATUSES,
113 RESOLVED_BUGTASK_STATUSES)
113from lp.bugs.interfaces.bugtracker import BugTrackerType114from lp.bugs.interfaces.bugtracker import BugTrackerType
114from lp.bugs.interfaces.cve import ICveSet115from lp.bugs.interfaces.cve import ICveSet
115from lp.registry.interfaces.distribution import IDistribution116from lp.registry.interfaces.distribution import IDistribution
@@ -1848,6 +1849,14 @@
1848 params.assignee = self.user1849 params.assignee = self.user
1849 return self.context.searchTasks(params).count()1850 return self.context.searchTasks(params).count()
18501851
1852 @property
1853 def bugs_with_patches_count(self):
1854 """A count of unresolved bugs with patches."""
1855 return self.context.searchTasks(
1856 None, user=self.user,
1857 status=(UNRESOLVED_BUGTASK_STATUSES + RESOLVED_BUGTASK_STATUSES),
1858 omit_duplicates=True, has_patch=True).count()
1859
18511860
1852class BugListingPortletInfoView(LaunchpadView, BugsInfoMixin):1861class BugListingPortletInfoView(LaunchpadView, BugsInfoMixin):
1853 """Portlet containing available bug listings without stats."""1862 """Portlet containing available bug listings without stats."""
18541863
=== modified file 'lib/lp/bugs/stories/patches-view/patches-view.txt'
--- lib/lp/bugs/stories/patches-view/patches-view.txt 2010-02-03 19:54:01 +0000
+++ lib/lp/bugs/stories/patches-view/patches-view.txt 2010-02-19 06:44:15 +0000
@@ -402,3 +402,92 @@
402 Hierarchy: Patchy Person > Patch attachments for Patchy Person402 Hierarchy: Patchy Person > Patch attachments for Patchy Person
403 Tabs: ...403 Tabs: ...
404 Main heading: Patch attachments for Patchy Person404 Main heading: Patch attachments for Patchy Person
405
406Reaching the Patches View
407-------------------------
408
409The patches view is linked to from a portlet on the product bugs page.
410
411 >>> from lp.bugs.tests.bug import (
412 ... print_bugfilters_portlet_unfilled,
413 ... print_bugfilters_portlet_filled)
414 >>> print_bugfilters_portlet_unfilled(anon_browser, 'patchy-product-1')
415 Open bugs
416 Critical bugs
417 Bugs fixed elsewhere
418 New bugs
419 Open CVE bugs - CVE reports
420 Bugs need forwarding upstream
421 Bugs with patches
422 Subscribe to bug mail
423 --> http://bugs.launchpad.dev/patchy-product-1/+subscribe
424
425 >>> print_bugfilters_portlet_filled(anon_browser, 'patchy-product-1')
426 3 Open bugs
427 1 Critical bugs
428 0 Bugs fixed elsewhere
429 1 New bugs
430 0 Open CVE bugs - CVE reports
431 3 Bugs need forwarding upstream
432 3 Bugs with patches
433
434It's also linked to from a portlet on the source package bugs page:
435
436 >>> print_bugfilters_portlet_filled(anon_browser, 'ubuntu/+source/a52dec')
437 1 Open bugs
438 0 Critical bugs
439 1 Bugs fixed elsewhere
440 0 New bugs
441 0 Open CVE bugs
442 1 Bug with a patch
443
444And from a portlet on the distro series bugs page:
445
446 >>> print_bugfilters_portlet_filled(anon_browser, 'ubuntu/hoary')
447 2 Open bugs
448 0 Critical bugs
449 0 Bugs fixed elsewhere
450 2 New bugs
451 1 Open CVE bugs - CVE reports
452 0 Incomplete bugs (can expire)
453 1 Bug with a patch
454
455And from a portlet on the distro bugs page:
456
457 >>> print_bugfilters_portlet_filled(anon_browser, 'ubuntu')
458 8 Open bugs
459 0 Critical bugs
460 2 Bugs fixed elsewhere
461 6 New bugs
462 2 Open CVE bugs - CVE reports
463 0 Incomplete bugs (can expire)
464 5 Bugs with patches
465
466The number of bugs with patches shown in the bugfilter stats portlet
467might be lower than the number of bugs (bugtasks) listed on the
468corresponding patches view page, because the latter shows resolved
469bugs too.
470
471 >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/+patches')
472 >>> show_patches_view(anon_browser.contents)
473 Bug Importance Status Package Patch Age
474 Bug #18: bug_c title High Triaged a52dec ...second...
475 From: Patchy Person
476 Link: patch_f.diff
477 description of patch f
478 Bug #18: bug_c title Undecided New ubuntu ...second...
479 From: Patchy Person
480 Link: patch_f.diff
481 description of patch f
482 Bug #17: bug_b title Undecided New ubuntu ...second...
483 From: Patchy Person
484 Link: patch_c.diff
485 description of patch c
486 Bug #16: bug_a title Medium Fix Released evolution ...second...
487 From: Patchy Person
488 Link: patch_a.diff
489 description of patch a
490 Bug #16: bug_a title Undecided New ubuntu ...second...
491 From: Patchy Person
492 Link: patch_a.diff
493 description of patch a
405494
=== modified file 'lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt'
--- lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2009-11-27 17:25:33 +0000
+++ lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2010-02-19 06:44:15 +0000
@@ -6,27 +6,6 @@
6served in a separate request; the request is issued via Javascript and6served in a separate request; the request is issued via Javascript and
7inserted into the page later.7inserted into the page later.
88
9 >>> from BeautifulSoup import BeautifulSoup
10
11 >>> def print_portlet(browser, path):
12 ... browser.open(
13 ... 'http://bugs.launchpad.dev/%s/+portlet-bugfilters' % path)
14 ... table = BeautifulSoup(browser.contents).find('table', 'bug-links')
15 ... tbody_info, tbody_links = table('tbody')
16 ... print_table(tbody_info)
17 ... for link in tbody_links('a'):
18 ... text = extract_text(link)
19 ... if len(text) > 0:
20 ... print "%s\n --> %s" % (text, link['href'])
21
22 >>> def print_portlet_contents(browser, path):
23 ... browser.open(
24 ... 'http://bugs.launchpad.dev'
25 ... '/%s/+bugtarget-portlet-bugfilters-stats' % path)
26 ... table = BeautifulSoup('<table>%s</table>' % browser.contents)
27 ... print_table(table)
28
29
30== Distribution ==9== Distribution ==
3110
32 >>> path = 'debian'11 >>> path = 'debian'
@@ -34,42 +13,49 @@
34If the user is not logged-in a subscribe link is shown along with some13If the user is not logged-in a subscribe link is shown along with some
35general stats.14general stats.
3615
37 >>> print_portlet(anon_browser, path)16 >>> from lp.bugs.tests.bug import (
17 ... print_bugfilters_portlet_unfilled,
18 ... print_bugfilters_portlet_filled)
19 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
38 Open bugs20 Open bugs
39 Critical bugs21 Critical bugs
40 Bugs fixed elsewhere22 Bugs fixed elsewhere
41 New bugs23 New bugs
42 Open CVE bugs - CVE reports24 Open CVE bugs - CVE reports
25 Bugs with patches
43 Subscribe to bug mail26 Subscribe to bug mail
44 --> http://bugs.launchpad.dev/debian/+subscribe27 --> http://bugs.launchpad.dev/debian/+subscribe
4528
46 >>> print_portlet_contents(anon_browser, path)29 >>> print_bugfilters_portlet_filled(anon_browser, path)
47 3 Open bugs30 3 Open bugs
48 0 Critical bugs31 0 Critical bugs
49 0 Bugs fixed elsewhere32 0 Bugs fixed elsewhere
50 1 New bugs33 1 New bugs
51 2 Open CVE bugs - CVE reports34 2 Open CVE bugs - CVE reports
35 0 Bugs with patches
5236
53Once the user has identified him or herself, information on assigned37Once the user has identified him or herself, information on assigned
54bugs is also shown.38bugs is also shown.
5539
56 >>> print_portlet(user_browser, path)40 >>> print_bugfilters_portlet_unfilled(user_browser, path)
57 Open bugs41 Open bugs
58 Bugs assigned to me42 Bugs assigned to me
59 Critical bugs43 Critical bugs
60 Bugs fixed elsewhere44 Bugs fixed elsewhere
61 New bugs45 New bugs
62 Open CVE bugs - CVE reports46 Open CVE bugs - CVE reports
47 Bugs with patches
63 Subscribe to bug mail48 Subscribe to bug mail
64 --> http://bugs.launchpad.dev/debian/+subscribe49 --> http://bugs.launchpad.dev/debian/+subscribe
6550
66 >>> print_portlet_contents(user_browser, path)51 >>> print_bugfilters_portlet_filled(user_browser, path)
67 3 Open bugs52 3 Open bugs
68 0 Bugs assigned to me53 0 Bugs assigned to me
69 0 Critical bugs54 0 Critical bugs
70 0 Bugs fixed elsewhere55 0 Bugs fixed elsewhere
71 1 New bugs56 1 New bugs
72 2 Open CVE bugs - CVE reports57 2 Open CVE bugs - CVE reports
58 0 Bugs with patches
7359
74The content includes a link to the distribution CVE report.60The content includes a link to the distribution CVE report.
7561
@@ -84,46 +70,50 @@
84If the user is not logged-in general stats are shown. There is also a70If the user is not logged-in general stats are shown. There is also a
85link to review nominations.71link to review nominations.
8672
87 >>> print_portlet(anon_browser, path)73 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
88 Open bugs74 Open bugs
89 Critical bugs75 Critical bugs
90 Bugs fixed elsewhere76 Bugs fixed elsewhere
91 New bugs77 New bugs
92 Open CVE bugs - CVE reports78 Open CVE bugs - CVE reports
79 Bugs with patches
93 Subscribe to bug mail80 Subscribe to bug mail
94 --> http://bugs.launchpad.dev/debian/woody/+subscribe81 --> http://bugs.launchpad.dev/debian/woody/+subscribe
95 Review nominations82 Review nominations
96 --> http://bugs.launchpad.dev/debian/woody/+nominations83 --> http://bugs.launchpad.dev/debian/woody/+nominations
9784
98 >>> print_portlet_contents(anon_browser, path)85 >>> print_bugfilters_portlet_filled(anon_browser, path)
99 2 Open bugs86 2 Open bugs
100 0 Critical bugs87 0 Critical bugs
101 0 Bugs fixed elsewhere88 0 Bugs fixed elsewhere
102 2 New bugs89 2 New bugs
103 1 Open CVE bugs - CVE reports90 1 Open CVE bugs - CVE reports
91 0 Bugs with patches
10492
105Once the user has identified him or herself, information on assigned93Once the user has identified him or herself, information on assigned
106bugs is also shown.94bugs is also shown.
10795
108 >>> print_portlet(user_browser, path)96 >>> print_bugfilters_portlet_unfilled(user_browser, path)
109 Open bugs97 Open bugs
110 Bugs assigned to me98 Bugs assigned to me
111 Critical bugs99 Critical bugs
112 Bugs fixed elsewhere100 Bugs fixed elsewhere
113 New bugs101 New bugs
114 Open CVE bugs - CVE reports102 Open CVE bugs - CVE reports
103 Bugs with patches
115 Subscribe to bug mail104 Subscribe to bug mail
116 --> http://bugs.launchpad.dev/debian/woody/+subscribe105 --> http://bugs.launchpad.dev/debian/woody/+subscribe
117 Review nominations106 Review nominations
118 --> http://bugs.launchpad.dev/debian/woody/+nominations107 --> http://bugs.launchpad.dev/debian/woody/+nominations
119108
120 >>> print_portlet_contents(user_browser, path)109 >>> print_bugfilters_portlet_filled(user_browser, path)
121 2 Open bugs110 2 Open bugs
122 0 Bugs assigned to me111 0 Bugs assigned to me
123 0 Critical bugs112 0 Critical bugs
124 0 Bugs fixed elsewhere113 0 Bugs fixed elsewhere
125 2 New bugs114 2 New bugs
126 1 Open CVE bugs - CVE reports115 1 Open CVE bugs - CVE reports
116 0 Bugs with patches
127117
128The content includes a link to the distribution CVE report.118The content includes a link to the distribution CVE report.
129119
@@ -137,42 +127,46 @@
137127
138If the user is not logged-in general stats are shown.128If the user is not logged-in general stats are shown.
139129
140 >>> print_portlet(anon_browser, path)130 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
141 Open bugs131 Open bugs
142 Critical bugs132 Critical bugs
143 Bugs fixed elsewhere133 Bugs fixed elsewhere
144 New bugs134 New bugs
145 Open CVE bugs135 Open CVE bugs
136 Bugs with patches
146 Subscribe to bug mail137 Subscribe to bug mail
147 --> http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+subscribe138 --> http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+subscribe
148139
149 >>> print_portlet_contents(anon_browser, path)140 >>> print_bugfilters_portlet_filled(anon_browser, path)
150 3 Open bugs141 3 Open bugs
151 0 Critical bugs142 0 Critical bugs
152 0 Bugs fixed elsewhere143 0 Bugs fixed elsewhere
153 1 New bugs144 1 New bugs
154 2 Open CVE bugs145 2 Open CVE bugs
146 0 Bugs with patches
155147
156Once the user has identified him or herself, information on assigned148Once the user has identified him or herself, information on assigned
157bugs is also shown.149bugs is also shown.
158150
159 >>> print_portlet(user_browser, path)151 >>> print_bugfilters_portlet_unfilled(user_browser, path)
160 Open bugs152 Open bugs
161 Bugs assigned to me153 Bugs assigned to me
162 Critical bugs154 Critical bugs
163 Bugs fixed elsewhere155 Bugs fixed elsewhere
164 New bugs156 New bugs
165 Open CVE bugs157 Open CVE bugs
158 Bugs with patches
166 Subscribe to bug mail159 Subscribe to bug mail
167 --> http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+subscribe160 --> http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+subscribe
168161
169 >>> print_portlet_contents(user_browser, path)162 >>> print_bugfilters_portlet_filled(user_browser, path)
170 3 Open bugs163 3 Open bugs
171 0 Bugs assigned to me164 0 Bugs assigned to me
172 0 Critical bugs165 0 Critical bugs
173 0 Bugs fixed elsewhere166 0 Bugs fixed elsewhere
174 1 New bugs167 1 New bugs
175 2 Open CVE bugs168 2 Open CVE bugs
169 0 Bugs with patches
176170
177Note that the "CVE reports" link is not shown above; distribution171Note that the "CVE reports" link is not shown above; distribution
178source packages do not have a CVE reports page.172source packages do not have a CVE reports page.
@@ -190,38 +184,42 @@
190If the user is not logged-in general stats are shown. There is no184If the user is not logged-in general stats are shown. There is no
191option to subscribe to bug mail.185option to subscribe to bug mail.
192186
193 >>> print_portlet(anon_browser, path)187 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
194 Open bugs188 Open bugs
195 Critical bugs189 Critical bugs
196 Bugs fixed elsewhere190 Bugs fixed elsewhere
197 New bugs191 New bugs
198 Open CVE bugs192 Open CVE bugs
193 Bugs with patches
199194
200 >>> print_portlet_contents(anon_browser, path)195 >>> print_bugfilters_portlet_filled(anon_browser, path)
201 2 Open bugs196 2 Open bugs
202 0 Critical bugs197 0 Critical bugs
203 0 Bugs fixed elsewhere198 0 Bugs fixed elsewhere
204 2 New bugs199 2 New bugs
205 1 Open CVE bugs200 1 Open CVE bugs
201 0 Bugs with patches
206202
207Once the user has identified him or herself, information on assigned203Once the user has identified him or herself, information on assigned
208bugs is also shown.204bugs is also shown.
209205
210 >>> print_portlet(user_browser, path)206 >>> print_bugfilters_portlet_unfilled(user_browser, path)
211 Open bugs207 Open bugs
212 Bugs assigned to me208 Bugs assigned to me
213 Critical bugs209 Critical bugs
214 Bugs fixed elsewhere210 Bugs fixed elsewhere
215 New bugs211 New bugs
216 Open CVE bugs212 Open CVE bugs
217213 Bugs with patches
218 >>> print_portlet_contents(user_browser, path)214
215 >>> print_bugfilters_portlet_filled(user_browser, path)
219 2 Open bugs216 2 Open bugs
220 0 Bugs assigned to me217 0 Bugs assigned to me
221 0 Critical bugs218 0 Critical bugs
222 0 Bugs fixed elsewhere219 0 Bugs fixed elsewhere
223 2 New bugs220 2 New bugs
224 1 Open CVE bugs221 1 Open CVE bugs
222 0 Bugs with patches
225223
226Note that the "CVE reports" link is not shown above; source packages224Note that the "CVE reports" link is not shown above; source packages
227do not have a CVE reports page.225do not have a CVE reports page.
@@ -238,42 +236,46 @@
238236
239If the user is not logged-in general stats are shown.237If the user is not logged-in general stats are shown.
240238
241 >>> print_portlet(anon_browser, path)239 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
242 Open bugs240 Open bugs
243 Critical bugs241 Critical bugs
244 Bugs fixed elsewhere242 Bugs fixed elsewhere
245 New bugs243 New bugs
246 Open CVE bugs244 Open CVE bugs
245 Bugs with patches
247 Subscribe to bug mail246 Subscribe to bug mail
248 --> http://bugs.launchpad.dev/mozilla/+subscribe247 --> http://bugs.launchpad.dev/mozilla/+subscribe
249248
250 >>> print_portlet_contents(anon_browser, path)249 >>> print_bugfilters_portlet_filled(anon_browser, path)
251 4 Open bugs250 4 Open bugs
252 1 Critical bugs251 1 Critical bugs
253 0 Bugs fixed elsewhere252 0 Bugs fixed elsewhere
254 4 New bugs253 4 New bugs
255 1 Open CVE bugs254 1 Open CVE bugs
255 0 Bugs with patches
256256
257Once the user has identified him or herself, information on assigned257Once the user has identified him or herself, information on assigned
258bugs is also shown.258bugs is also shown.
259259
260 >>> print_portlet(user_browser, path)260 >>> print_bugfilters_portlet_unfilled(user_browser, path)
261 Open bugs261 Open bugs
262 Bugs assigned to me262 Bugs assigned to me
263 Critical bugs263 Critical bugs
264 Bugs fixed elsewhere264 Bugs fixed elsewhere
265 New bugs265 New bugs
266 Open CVE bugs266 Open CVE bugs
267 Bugs with patches
267 Subscribe to bug mail268 Subscribe to bug mail
268 --> http://bugs.launchpad.dev/mozilla/+subscribe269 --> http://bugs.launchpad.dev/mozilla/+subscribe
269270
270 >>> print_portlet_contents(user_browser, path)271 >>> print_bugfilters_portlet_filled(user_browser, path)
271 4 Open bugs272 4 Open bugs
272 0 Bugs assigned to me273 0 Bugs assigned to me
273 1 Critical bugs274 1 Critical bugs
274 0 Bugs fixed elsewhere275 0 Bugs fixed elsewhere
275 4 New bugs276 4 New bugs
276 1 Open CVE bugs277 1 Open CVE bugs
278 0 Bugs with patches
277279
278Note that the "CVE reports" link is not shown above; project groups do280Note that the "CVE reports" link is not shown above; project groups do
279not have a CVE reports page.281not have a CVE reports page.
@@ -290,42 +292,46 @@
290292
291If the user is not logged-in general stats are shown.293If the user is not logged-in general stats are shown.
292294
293 >>> print_portlet(anon_browser, path)295 >>> print_bugfilters_portlet_unfilled(anon_browser, path)
294 Open bugs296 Open bugs
295 Critical bugs297 Critical bugs
296 Bugs fixed elsewhere298 Bugs fixed elsewhere
297 New bugs299 New bugs
298 Open CVE bugs - CVE reports300 Open CVE bugs - CVE reports
301 Bugs with patches
299 Subscribe to bug mail302 Subscribe to bug mail
300 --> http://bugs.launchpad.dev/firefox/+subscribe303 --> http://bugs.launchpad.dev/firefox/+subscribe
301304
302 >>> print_portlet_contents(anon_browser, path)305 >>> print_bugfilters_portlet_filled(anon_browser, path)
303 3 Open bugs306 3 Open bugs
304 1 Critical bugs307 1 Critical bugs
305 0 Bugs fixed elsewhere308 0 Bugs fixed elsewhere
306 3 New bugs309 3 New bugs
307 1 Open CVE bugs - CVE reports310 1 Open CVE bugs - CVE reports
311 0 Bugs with patches
308312
309Once the user has identified him or herself, information on assigned313Once the user has identified him or herself, information on assigned
310bugs is also shown.314bugs is also shown.
311315
312 >>> print_portlet(user_browser, path)316 >>> print_bugfilters_portlet_unfilled(user_browser, path)
313 Open bugs317 Open bugs
314 Bugs assigned to me318 Bugs assigned to me
315 Critical bugs319 Critical bugs
316 Bugs fixed elsewhere320 Bugs fixed elsewhere
317 New bugs321 New bugs
318 Open CVE bugs - CVE reports322 Open CVE bugs - CVE reports
323 Bugs with patches
319 Subscribe to bug mail324 Subscribe to bug mail
320 --> http://bugs.launchpad.dev/firefox/+subscribe325 --> http://bugs.launchpad.dev/firefox/+subscribe
321326
322 >>> print_portlet_contents(user_browser, path)327 >>> print_bugfilters_portlet_filled(user_browser, path)
323 3 Open bugs328 3 Open bugs
324 0 Bugs assigned to me329 0 Bugs assigned to me
325 1 Critical bugs330 1 Critical bugs
326 0 Bugs fixed elsewhere331 0 Bugs fixed elsewhere
327 3 New bugs332 3 New bugs
328 1 Open CVE bugs - CVE reports333 1 Open CVE bugs - CVE reports
334 0 Bugs with patches
329335
330336
331The content includes a link to the distribution CVE report.337The content includes a link to the distribution CVE report.
332338
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2009-11-27 14:44:44 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2010-02-19 06:44:15 +0000
@@ -64,4 +64,14 @@
64 </a>64 </a>
65 </td>65 </td>
66 </tr>66 </tr>
67 <tr tal:define="count view/bugs_with_patches_count|nothing;
68 plural string: Bugs with patches;
69 singular string: Bug with a patch;">
70 <td class="bugs-count" tal:content="count"/>
71 <td class="bugs-link">
72 <a tal:attributes="href string:${context/fmt:url}/+patches">
73 <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
74 </a>
75 </td>
76 </tr>
67</tal:portlet-bug-filters-content>77</tal:portlet-bug-filters-content>
6878
=== modified file 'lib/lp/bugs/tests/bug.py'
--- lib/lp/bugs/tests/bug.py 2010-01-19 20:45:38 +0000
+++ lib/lp/bugs/tests/bug.py 2010-02-19 06:44:15 +0000
@@ -16,7 +16,8 @@
1616
17from canonical.launchpad.ftests import sync17from canonical.launchpad.ftests import sync
18from canonical.launchpad.testing.pages import (18from canonical.launchpad.testing.pages import (
19 extract_text, find_tag_by_id, find_main_content, find_tags_by_class)19 extract_text, find_tag_by_id, find_main_content, find_tags_by_class,
20 print_table)
20from lp.bugs.interfaces.bug import CreateBugParams, IBugSet21from lp.bugs.interfaces.bug import CreateBugParams, IBugSet
21from lp.bugs.interfaces.bugtask import BugTaskStatus, IBugTaskSet22from lp.bugs.interfaces.bugtask import BugTaskStatus, IBugTaskSet
22from lp.bugs.interfaces.bugwatch import IBugWatchSet23from lp.bugs.interfaces.bugwatch import IBugWatchSet
@@ -279,3 +280,46 @@
279 if text_field is not None:280 if text_field is not None:
280 text_control = browser.getControl(name=text_field.get('name'))281 text_control = browser.getControl(name=text_field.get('name'))
281 print ' [%s]' % text_control.value.ljust(10)282 print ' [%s]' % text_control.value.ljust(10)
283
284
285def print_bugfilters_portlet_unfilled(browser, target):
286 """Print the raw, unfilled contents of the bugfilters portlet.
287
288 This is the contents before any actual data has been fetched.
289 (The portlet is normally populated with data by a separate
290 javascript call, to avoid delaying the overall page load. Use
291 print_bugfilters_portlet_filled() to test the populated portlet.)
292
293 :param browser browser from which to extract the content.
294 :param target entity from whose bugs page to fetch the portlet
295 (e.g., http://bugs.launchpad.dev/TARGET/...)
296 """
297 browser.open(
298 'http://bugs.launchpad.dev/%s/+portlet-bugfilters' % target)
299 table = BeautifulSoup(browser.contents).find('table', 'bug-links')
300 tbody_info, tbody_links = table('tbody')
301 print_table(tbody_info)
302 for link in tbody_links('a'):
303 text = extract_text(link)
304 if len(text) > 0:
305 print "%s\n --> %s" % (text, link['href'])
306
307
308def print_bugfilters_portlet_filled(browser, target):
309 """Print the filled-in contents of the bugfilters portlet.
310
311 This is the contents after the actual data has been fetched.
312 (The portlet is normally populated with data by a separate
313 javascript call, to avoid delaying the overall page load. Use
314 print_bugfilters_portlet_unfilled() to test the unpopulated
315 portlet.)
316
317 :param browser browser from which to extract the content.
318 :param target entity from whose bugs page to fetch the portlet
319 (e.g., http://bugs.launchpad.dev/TARGET/...)
320 """
321 browser.open(
322 'http://bugs.launchpad.dev'
323 '/%s/+bugtarget-portlet-bugfilters-stats' % target)
324 table = BeautifulSoup('<table>%s</table>' % browser.contents)
325 print_table(table)

Subscribers

People subscribed via source and target branches

to status/vote changes: