Merge lp:~sinzui/launchpad/person-merge-job-0 into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 12622
Proposed branch: lp:~sinzui/launchpad/person-merge-job-0
Merge into: lp:launchpad
Diff against target: 0 lines
To merge this branch: bzr merge lp:~sinzui/launchpad/person-merge-job-0
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+53706@code.launchpad.net

Description of the change

Add sanity checks to mergeAsync.

    Launchpad bug: https://bugs.launchpad.net/bugs/728471
    Pre-implementation: allenap, jcsackett
    Test command: ./bin/test -vv \
      -t webservice/xx-person.txt -t registry.tests.person.TestPerson.test \
      -t TestPersonMergeJob

This issue is a continuation of bug 162510. The infrastructure is in place to
merge people an team async.

- Export is_merge_pending to the API.

- No check is performed to see if either merge user is already the
  subject of a scheduled merge job.

--------------------------------------------------------------------

RULES

    * Export is_merge_pending()
    * Add a guard to mergeAsync() to ensure a merge is not already scheduled.
      * Use is_merge_pending()
      * revise is_merge_pending() to check *both* 'from' and 'to' because
        users can be working with several merges.
    * ADDENDUM: The test setup is incorrect. Fixing it reveals that DB
      permissions are wrong.

QA

    * Verify that is_merge_pending is exported:
        lp = Launchpad.login_with(
            'testing', 'https://api.launchpad.net/', version='devel')
        sinzui = lp.people['sinzui']
        print sinzui.is_merge_pending

LINT

    database/schema/security.cfg
    lib/lp/registry/interfaces/person.py
    lib/lp/registry/interfaces/persontransferjob.py
    lib/lp/registry/model/person.py
    lib/lp/registry/model/persontransferjob.py
    lib/lp/registry/stories/webservice/xx-person.txt
    lib/lp/registry/tests/test_person.py
    lib/lp/registry/tests/test_person_merge_job.py

IMPLEMENTATION

Exported is_merge_pending() and updated the docstring to apply to both
profiles.
    lp/registry/stories/webservice/xx-person.txt
    lp/registry/interfaces/person.py

Updated is_merge_pending() to meet the needs of the UI and added a guard to
mergeAsync(). Updated the tests and the DB permissions to ensure merge works
for teams and users.
    database/schema/security.cfg
    lp/registry/interfaces/person.py
    lib/lp/registry/interfaces/persontransferjob.py
    lib/lp/registry/model/person.py
    lib/lp/registry/model/persontransferjob.py
    lib/lp/registry/tests/test_person.py
    lib/lp/registry/tests/test_person_merge_job.py

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

This looks good to land, and a good improvement to the async system.

review: Approve

Preview Diff

Empty