Code review comment for lp://staging/~deryck/launchpad/hot-bugs-list-515232

Revision history for this message
Deryck Hodge (deryck) wrote :

This branch converts a bugtask.py's hot_bugtasks method to a hot_bugs
method on a bug target. The effect of this change is that the bugs home
page for a project will no longer feature the most recently changed
bugs. The home page will now show the top 10 hottest bugs.

This also fixes bug 442170, bug 77701, and bug 515232.

== Implementation details ==

One version of this landed during week 3 last cycle, but the branch was
reverted last minute due to timeout issues. After much playing on
staging with queries (and after talking with Björn), I feel confident
setting a limit and not doing a secondary sort on -datecreated will fix
the timeouts we had.

I also took the opportunity to clean up some lint and add a link to the
rest of the hot bugs list. Because I added this link, I needed a way to
check that more than 10 hot bugs exist. I made the hot_bugs list a dict
with a flag for has_more_bugs, which allows doing this in one method,
too, avoiding having to look up the hot bugs list again.

== Tests ==

Test with:

./bin/test -cvvt xx-product-bugs-page.txt

== Demo and Q/A ==

To QA, visit any bugs home page (e.g.
https://bugs.launchpad.net/malone/) and confirm that the 10 bugs shown
are the top ten when you follow the link to the full hot bugs list.

= 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/bugs/browser/bugtarget.py
  lib/lp/bugs/browser/bugtask.py
  lib/lp/bugs/templates/bugtarget-bugs.pt
  lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt

« Back to merge proposal