Merge lp:~adeuring/launchpad/bug-675595-2 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Māris Fogels on 2010-11-23 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11973 |
| Proposed branch: | lp:~adeuring/launchpad/bug-675595-2 |
| Merge into: | lp:launchpad |
| Prerequisite: | lp:~adeuring/launchpad/bug-675595 |
| Diff against target: |
565 lines (+200/-119) 9 files modified
lib/canonical/launchpad/systemhomes.py (+7/-4) lib/lp/bugs/browser/bugtask.py (+2/-2) lib/lp/bugs/browser/tests/test_buglisting.py (+26/-0) lib/lp/bugs/doc/milestones-from-bugtask-search.txt (+0/-54) lib/lp/bugs/interfaces/bugtask.py (+0/-7) lib/lp/bugs/interfaces/malone.py (+1/-1) lib/lp/bugs/model/bugtask.py (+0/-38) lib/lp/registry/browser/person.py (+26/-12) lib/lp/registry/browser/tests/test_person_view.py (+138/-1) |
| To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-675595-2 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Māris Fogels (community) | 2010-11-23 | Approve on 2010-11-23 | |
|
Review via email:
|
|||
Commit Message
[r=mars][ui=none] [r=mars, gmb][ui=none][bug=675595] new optional parameter prejoins for BugTaskSearchLi
Description of the Change
This branch fixes bug 675595: "BugTaskSet.
can call BugTaskSet.
one SQL query instead of two"
Working on the branch, I realized that the method
BugTaskSet.
The only callsite was RelevantMilesto
since we can now retrieve milestones by pre-joining the table in
BugTaskSet.
getMilestoneWid
BugTaskSearchLi
"prejoins" to this method.
tests:
./bin/test -vvt test_buglisting -t test_person_view
| Abel Deuring (adeuring) wrote : | # |
Hi Māris,
thanks for the review!
On 23.11.2010 16:16, Māris Fogels wrote:
> Review: Approve
> Hi Abel,
>
> This code looks good! r=mars, with two comments:
>
> First, on line 72 of the diff, I think you should include a comment that says "If the table prejoin failed, then this will issue two additional SQL queries".
Good idea, added.
>
> Second, the SQL prejoins in lp.registry.
I am not if it is worth the effort: Basically, we can now pre-join more
or less arbitrary tables in calls of BugTaskSet.
method is used quite frequently, and for each callsite we might need to
pre-join other tables. There might even be conflicts: We can at present
join the same table only once, and for one callsite it might be
reasonable to pre-join for exmaple Person in order to retrieve a bug
reporter, while another callsite would benefit from pre-joining a
bugtask assignee.
So I think that the callsites of searchTasks() should decide what to
pre-join -- and these callsite live quite often in browser code. But
perhaps I am too much focused on the way how I implemented the branch
and I'm completely missing some better way to tell searchTasks() what
pre-join...
Abel
>
> I recognize that a refactoring of the TaskSearchListi
>
> With the above taken into consideration, I think you can land this.
>
> Maris

Hi Abel,
This code looks good! r=mars, with two comments:
First, on line 72 of the diff, I think you should include a comment that says "If the table prejoin failed, then this will issue two additional SQL queries".
Second, the SQL prejoins in lp.registry. browser. person look odd - it looks like ORM code that should live in the model has been placed in the view. Is there a better place to put these operations?
I recognize that a refactoring of the TaskSearchListi ngView is not trivial, so please consider the refactoring as optional. If you do want to try the refactoring, it should be in a follow-up branch.
With the above taken into consideration, I think you can land this.
Maris