Merge lp:~edwin-grubbs/launchpad/bug-682727-bug-count-timeout into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12158 |
Proposed branch: | lp:~edwin-grubbs/launchpad/bug-682727-bug-count-timeout |
Merge into: | lp:launchpad |
Diff against target: |
200 lines (+125/-9) 3 files modified
lib/lp/bugs/model/bugtask.py (+7/-3) lib/lp/bugs/tests/test_bugtaskset.py (+91/-0) lib/lp/testing/factory.py (+27/-6) |
To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-682727-bug-count-timeout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+45141@code.launchpad.net |
Commit message
[r=gmb][ui=none][bug=682727] Fix timeout on $project/+series page by simplifying bug count query.
Description of the change
Summary
-------
This branch fixes a timeout on the $project/+series page.
I simplified the permission query for bug counts on milestones, since
the query which determines which private bugs a user can view is costly,
and displaying a count including all private bugs doesn't reveal any
sensitive information.
Implementation details
-------
configs/
lib/lp/
lib/lp/
lib/lp/
Tests
-----
./bin/test -vvp lp.bugs.
Demo and Q/A
------------
* Open https:/
* It should not timeout.
Lint
----
No lint.
Hi Edwin,
Couple of minor nitpicks here, but otherwise this is r=me.
60 + def get_counts(self, user): set.getStatusCo untsForProductS eries( .items[ status_ id], count)
61 + counts = self.bugtask_
62 + user, self.series)
63 + return [(BugTaskStatus
64 + for status_id, count in counts]
The indentation for these statements is a bit weird. I think that it
should look like this:
counts = self.bugtask_ set.getStatusCo untsForProductS eries(
(BugTaskStatus .items[ status_ id], count)
user, self.series)
return [
for status_id, count in counts]
186 + [bugtask] = bug.bugtasks
I know that the context makes it unlikely that we'll have > 1 bugtask on
the bug at this point, but for safety's (and readability's) sake I'd
prefer this to be:
bugtask = bug.default_bugtask