Merge lp:~jml/launchpad/fix-release-hot-bugs-486437 into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/fix-release-hot-bugs-486437
Merge into: lp:launchpad
Diff against target: 46 lines (+26/-2)
2 files modified
lib/lp/bugs/browser/bugtask.py (+4/-2)
lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt (+22/-0)
To merge this branch: bzr merge lp:~jml/launchpad/fix-release-hot-bugs-486437
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+16173@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

As the linked bug indicates, the "Bugs" tab page for a project (or any bugtarget, really) shows "Fix released" bugs on the "Hot bugs" area. This really sucks, especially for small projects, since "Fix released" bugs aren't really interesting in active development.

This patch changes the search used for the "Hot bugs" table such that it only shows unresolved bugs. I haven't added a test, because I can't see any place that has already been established for such a test to go.

Revision history for this message
Tim Penhey (thumper) wrote :

Thanks for adding the test.

review: Approve

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 2009-12-12 00:27:49 +0000
+++ lib/lp/bugs/browser/bugtask.py 2009-12-15 03:33:22 +0000
@@ -2720,8 +2720,10 @@
2720 def hot_bugtasks(self):2720 def hot_bugtasks(self):
2721 """Return the 10 most recently updated bugtasks for this target."""2721 """Return the 10 most recently updated bugtasks for this target."""
2722 params = BugTaskSearchParams(2722 params = BugTaskSearchParams(
2723 orderby="-date_last_updated", omit_dupes=True, user=self.user)2723 orderby="-date_last_updated", omit_dupes=True, user=self.user,
2724 return list(self.context.searchTasks(params)[:10])2724 status=any(*UNRESOLVED_BUGTASK_STATUSES))
2725 search = self.context.searchTasks(params)
2726 return list(search[:10])
27252727
2726 @property2728 @property
2727 def addquestion_url(self):2729 def addquestion_url(self):
27282730
=== modified file 'lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2009-10-02 15:16:03 +0000
+++ lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2009-12-15 03:33:22 +0000
@@ -177,3 +177,25 @@
177 #4 Reflow problems... New Medium on 2006-07-14177 #4 Reflow problems... New Medium on 2006-07-14
178 #1 Firefox does no... New Low on 2006-05-19178 #1 Firefox does no... New Low on 2006-05-19
179179
180
181Fix released bugs are not shown. We demonstrate this by setting the bugtask
182for bug 4 to be "Fix released".
183
184 >>> from zope.component import getUtility
185 >>> from lp.bugs.interfaces.bug import BugTaskStatus, IBugSet
186 >>> from lp.registry.interfaces.person import IPersonSet
187 >>> login('foo.bar@canonical.com')
188 >>> bug_4 = getUtility(IBugSet).get(4)
189 >>> project_owner = getUtility(IPersonSet).getByName('name12')
190 >>> bug_4.bugtasks[0].transitionToStatus(
191 ... BugTaskStatus.FIXRELEASED, project_owner)
192 >>> logout()
193
194And then reloading the page. The Fix released bug, bug 4, is no longer shown.
195
196 >>> anon_browser.reload()
197 >>> print extract_text(
198 ... find_tag_by_id(anon_browser.contents, 'hot-bugs'))
199 Summary Status Importance Last changed
200 #5 Firefox install... New Critical on 2006-07-14
201 #1 Firefox does no... New Low on 2006-05-19