Merge lp:~jcsackett/launchpad/merge-person-participation-676494 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12016 |
Proposed branch: | lp:~jcsackett/launchpad/merge-person-participation-676494 |
Merge into: | lp:launchpad |
Diff against target: |
229 lines (+125/-11) 6 files modified
lib/lp/registry/browser/peoplemerge.py (+5/-1) lib/lp/registry/browser/tests/test_peoplemerge.py (+25/-7) lib/lp/registry/doc/person-merge.txt (+4/-2) lib/lp/registry/model/person.py (+35/-0) lib/lp/registry/tests/test_person.py (+31/-1) lib/lp/registry/tests/test_team.py (+25/-0) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/merge-person-participation-676494 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Review via email: mp+41932@code.launchpad.net |
Commit message
[r=bac][ui=none][bug=676494] Fixes bad execution path that leads to extra teams being assigned to ~registry on merge and bad entries in TeamParticipation.
Description of the change
Summary
=======
A long execution path on merging teams as part of a delete leads to corruption of the TeamParticipation table and the addition of teams to ~registry that should never be part of it.
To remedy this, this branch adds an extra guard to prevent super teams from making it through the team merge, as well as cleaning up team participation for indirect entries.
Additional, use of flush_db_updates lower in the call stack helps sync team removal.
Proposed fix
============
Add additional guards to the process of merging teams, add additional db flushes, and make sure to delete all the team participation entries for members when deactivateAllMe
Preimplementation talk
=======
Talked with and explored the execution path with Curtis Hovey.
Implementation details
=======
As in proposed. The cleanup for team participation is a particularly complicated sql query--I'm very open to discussing better implementations if you have an idea. This branch presents the best I could come up with.
Tests
=====
bin/test -t test_peoplemerge.py
bin/test -t test_person.py
bin/test -t test_team.py
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Hi Jon,
Thanks for this fix. I hope it completely solves the problem.
In test_team_ with_super_ teams_raises_ error the doMerge method could be shared with test_team_ without_ super_teams_ is_fine.
The comment in test_team_ without_ super_teams_ is_fine should end with punctuation.
In test_deactivate AllMembers_ cleans_ up_team_ participation you create a bunch of new objects that are created as objects on the instance but they are not used outside the method. Please change them to just be local variables.
I've gone over the changes carefully and they all make sense. I'm very happy you and Curtis worked this out. I think this fix will solve the other TeamParticipation problem (bug 651210).