Merge lp://staging/~wgrant/launchpad/retarget-bugtask-model into lp://staging/launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 13494
Proposed branch: lp://staging/~wgrant/launchpad/retarget-bugtask-model
Merge into: lp://staging/launchpad
Prerequisite: lp://staging/~wgrant/launchpad/destroy-bugtask-markers
Diff against target: 445 lines (+257/-58)
5 files modified
lib/lp/bugs/model/bugtask.py (+61/-23)
lib/lp/bugs/model/tests/test_bugtask.py (+194/-1)
lib/lp/bugs/scripts/bugtasktargetnamecaches.py (+2/-2)
lib/lp/bugs/stories/webservice/xx-bug.txt (+0/-31)
lib/lp/bugs/tests/test_bugnotification.py (+0/-1)
To merge this branch: bzr merge lp://staging/~wgrant/launchpad/retarget-bugtask-model
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+68761@code.staging.launchpad.net

Commit message

[r=stevenk][bug=80902][incr] Allow BugTask.transitionToTarget to transition between all non-series targets.

Description of the change

This branch extends BugTask.transitionToTarget to permit most changes. It was previously restricted to not changing the type of a task (eg. product->product, distribution->distributionsourcepackage) because of the IUpstreamBugTask, IDistroBugTask, etc. marker interfaces. But the prerequisite branches remove those, so changing task types is fine now.

transitionToTarget now uses a new bug_target_to_key function, which converts an IBugTarget to a dict of column values. This is the inverse of the existing determine_target, which has been renamed to bug_target_from_key.

I've added tests for the various cases. There are only three that are disallowed now: transition to or from a productseries; transition to or from a distroseries; and transition to or from a sourcepackage, except where it is to or from another sourcepackage in the same distroseries. Transitioning between series is forbidden, as that's what nominations are for.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.