← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/retarget-bug-oops-1040948 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1040948 in Launchpad itself: "oops retargeting a bug to a distribution source package"
  https://bugs.launchpad.net/launchpad/+bug/1040948

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/retarget-bug-oops-1040948/+merge/121111

== 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


-- 
https://code.launchpad.net/~wallyworld/launchpad/retarget-bug-oops-1040948/+merge/121111
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/retarget-bug-oops-1040948 into lp:launchpad.
=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py	2012-08-21 04:28:11 +0000
+++ lib/lp/bugs/model/bugtask.py	2012-08-24 01:39:20 +0000
@@ -1146,7 +1146,7 @@
             # have access to the parent bug. We need to run a job to remove any
             # such subscriptions.
             getUtility(IRemoveArtifactSubscriptionsJobSource).create(
-                user, [self.bug], pillar=target_before_change)
+                user, [self.bug], pillar=target_before_change.pillar)
 
     def updateTargetNameCache(self, newtarget=None):
         """See `IBugTask`."""

=== modified file 'lib/lp/registry/interfaces/sharingjob.py'
--- lib/lp/registry/interfaces/sharingjob.py	2012-06-29 02:15:05 +0000
+++ lib/lp/registry/interfaces/sharingjob.py	2012-08-24 01:39:20 +0000
@@ -83,7 +83,7 @@
 class IRemoveArtifactSubscriptionsJobSource(ISharingJobSource):
     """An interface for acquiring IRemoveArtifactSubscriptionsJobs."""
 
-    def create(requestor, bugs=None, grantee=None, pillar=None,
+    def create(requestor, artifacts=None, grantee=None, pillar=None,
                information_types=None):
         """Create a new job to remove subscriptions for the specified
         artifacts.


Follow ups