Merge lp:~wallyworld/launchpad/retarget-bug-oops-1040948 into lp:launchpad

Proposed by Ian Booth on 2012-08-24
Status: Merged
Approved by: William Grant on 2012-08-24
Approved revision: no longer in the source branch.
Merged at revision: 15859
Proposed branch: lp:~wallyworld/launchpad/retarget-bug-oops-1040948
Merge into: lp:launchpad
Diff against target: 25 lines (+2/-2)
2 files modified
lib/lp/bugs/model/bugtask.py (+1/-1)
lib/lp/registry/interfaces/sharingjob.py (+1/-1)
To merge this branch: bzr merge lp:~wallyworld/launchpad/retarget-bug-oops-1040948
Reviewer Review Type Date Requested Status
William Grant code 2012-08-24 Approve on 2012-08-24
Review via email: mp+121111@code.launchpad.net

Commit Message

Correctly create the remove subscriptions job when retargetting a bugtask

Description of the Change

== Implementation ==

A small but critical fix for an oops retargetting a bugtask to a distro source package. The oops occured when we enabled writeable sharing on prod.

The issue was the construction of the sharing remove subscriptions job with an incorrect pillar.

== Tests ==

No new tests for this branch. The code involved is behind a feature flag which is in the process of being removed. As soon as the flag is gone, the relevant code path will be covered by existing tests.

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/model/bugtask.py
  lib/lp/registry/interfaces/sharingjob.py

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/model/bugtask.py'
2--- lib/lp/bugs/model/bugtask.py 2012-08-21 04:28:11 +0000
3+++ lib/lp/bugs/model/bugtask.py 2012-08-24 01:39:20 +0000
4@@ -1146,7 +1146,7 @@
5 # have access to the parent bug. We need to run a job to remove any
6 # such subscriptions.
7 getUtility(IRemoveArtifactSubscriptionsJobSource).create(
8- user, [self.bug], pillar=target_before_change)
9+ user, [self.bug], pillar=target_before_change.pillar)
10
11 def updateTargetNameCache(self, newtarget=None):
12 """See `IBugTask`."""
13
14=== modified file 'lib/lp/registry/interfaces/sharingjob.py'
15--- lib/lp/registry/interfaces/sharingjob.py 2012-06-29 02:15:05 +0000
16+++ lib/lp/registry/interfaces/sharingjob.py 2012-08-24 01:39:20 +0000
17@@ -83,7 +83,7 @@
18 class IRemoveArtifactSubscriptionsJobSource(ISharingJobSource):
19 """An interface for acquiring IRemoveArtifactSubscriptionsJobs."""
20
21- def create(requestor, bugs=None, grantee=None, pillar=None,
22+ def create(requestor, artifacts=None, grantee=None, pillar=None,
23 information_types=None):
24 """Create a new job to remove subscriptions for the specified
25 artifacts.