Merge lp://qastaging/~jcsackett/launchpad/plus-participation-additional-fixes into lp://qastaging/launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Edwin Grubbs | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11408 | ||||
Proposed branch: | lp://qastaging/~jcsackett/launchpad/plus-participation-additional-fixes | ||||
Merge into: | lp://qastaging/launchpad | ||||
Diff against target: |
656 lines (+238/-87) 13 files modified
lib/canonical/launchpad/doc/sample-data-assertions.txt (+2/-2) lib/lp/bugs/doc/initial-bug-contacts.txt (+1/-1) lib/lp/bugs/templates/person-portlet-team-assignedbugs.pt (+1/-1) lib/lp/registry/browser/person.py (+34/-21) lib/lp/registry/browser/tests/test_person_view.py (+2/-2) lib/lp/registry/doc/person-account.txt (+2/-2) lib/lp/registry/doc/private-team-visibility.txt (+1/-1) lib/lp/registry/doc/teammembership.txt (+5/-5) lib/lp/registry/doc/vocabularies.txt (+1/-1) lib/lp/registry/interfaces/person.py (+7/-7) lib/lp/registry/model/person.py (+77/-15) lib/lp/registry/tests/test_person.py (+95/-7) lib/lp/registry/vocabularies.py (+10/-22) |
||||
To merge this branch: | bzr merge lp://qastaging/~jcsackett/launchpad/plus-participation-additional-fixes | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | code | Approve | |
Edwin Grubbs (community) | code | Approve | |
Māris Fogels (community) | Needs Information | ||
Review via email: mp+32820@code.qastaging.launchpad.net |
Commit message
Attacks the +participation problem by stormifying the team_memberships method (previously myactivemembers
Description of the change
Summary
Contributes to fixing the +participation time outs by converting team path look ups into one large SQL lookup followed by some graph traversal.
Previously the mp showed an implementation that largely cut-off the team_path lookup; the changes for it are still useful, so have not been removed from the branch, but the solution changed in the last few revisions.
Proposed fix
Stormifying where possible to assist db load; more importantly, using a graph of all teams the person participates in to create the team_paths for indirect teams as displayed.
Pre-implementation notes
Chatted with Curtis Hovey (sinzui)
Got schooled by Robert Collins (lifeless) in the ways of the graph, and agreed it was a much better solution.
Implementation details
Renames myactivememberships to team_memberships, per an XXX from kiko in the codebase. Updates call sites.
Stormifies team_memberships and updates callsites.
Uses a graph traversal in getPathsToTeams to find the path between the person and all teams, then filters out direct memberships from that to get indirect teams and their team_paths.
Demo and Q/A
bin/test -vvc -t TestPersonTeams
bin/test -vvc -t TestPersonParti
On launchpad.dev, checkout https:/
lint
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
180: E302 expected 2 blank lines, found 1
230: E302 expected 2 blank lines, found 1
625: E302 expected 2 blank lines, found 1
1495: E301 expected 1 blank line, found 0
./lib/lp/
448: E302 expected 2 blank lines, found 1
The "expected n blank lines" were explained to me as a factor of lint having issues around comments and class definitions.
Could you explain why the indirect team path calculations were a problem?