← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/no-more-add-bug-supervisor into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/no-more-add-bug-supervisor into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1029724 in Launchpad itself: "Retargeting a private bug notifies maintainer and bug supervisor without subscriptions"
  https://bugs.launchpad.net/launchpad/+bug/1029724

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/no-more-add-bug-supervisor/+merge/119818

Now that we have structural subscriptions working for private bugs, we no longer need to explicitly notify the bug supervisor and maintainer when a private bug is re-targeted. This neatly also drops BugNotificationRecipients.add{Maintainer,BugSupervisor}, so I've cleaned them up too.
-- 
https://code.launchpad.net/~stevenk/launchpad/no-more-add-bug-supervisor/+merge/119818
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/no-more-add-bug-supervisor into lp:launchpad.
=== modified file 'lib/lp/bugs/configure.zcml'
--- lib/lp/bugs/configure.zcml	2012-08-07 02:31:56 +0000
+++ lib/lp/bugs/configure.zcml	2012-08-16 01:00:31 +0000
@@ -976,7 +976,7 @@
         <!-- BugNotificationRecipients provides the following
              attributes/methods in addition. -->
         <allow
-            attributes="subscription_filters addFilter addBugSupervisor addMaintainer"/>
+            attributes="subscription_filters addFilter"/>
     </class>
     <securedutility
         provides="lp.bugs.interfaces.bugnotification.IBugNotificationSet"

=== modified file 'lib/lp/bugs/mail/bugnotificationrecipients.py'
--- lib/lp/bugs/mail/bugnotificationrecipients.py	2012-08-06 03:47:42 +0000
+++ lib/lp/bugs/mail/bugnotificationrecipients.py	2012-08-16 01:00:31 +0000
@@ -1,4 +1,4 @@
-# Copyright 2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2011-2012 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Code for handling bug notification recipients in bug mail."""
@@ -107,28 +107,6 @@
             text = "are a bug assignee"
         self._addReason(person, text, reason)
 
-    def addBugSupervisor(self, person):
-        """Registers a bug supervisor of a bugtask's pillar of this bug."""
-        reason = "Bug Supervisor"
-        if person.is_team:
-            text = ("are a member of %s, which is a bug supervisor"
-                    % person.displayname)
-            reason += " @%s" % person.name
-        else:
-            text = "are a bug supervisor"
-        self._addReason(person, text, reason)
-
-    def addMaintainer(self, person):
-        """Registers a maintainer of a bugtask's pillar of this bug."""
-        reason = "Maintainer"
-        if person.is_team:
-            text = ("are a member of %s, which is a maintainer"
-                    % person.displayname)
-            reason += " @%s" % person.name
-        else:
-            text = "are a maintainer"
-        self._addReason(person, text, reason)
-
     def addStructuralSubscriber(self, person, target):
         """Registers a structural subscriber to this bug's target."""
         reason = "Subscriber (%s)" % target.displayname

=== modified file 'lib/lp/bugs/subscribers/bug.py'
--- lib/lp/bugs/subscribers/bug.py	2012-08-06 03:47:42 +0000
+++ lib/lp/bugs/subscribers/bug.py	2012-08-16 01:00:31 +0000
@@ -19,7 +19,6 @@
 from lp.bugs.adapters.bugchange import (
     BugDuplicateChange,
     BugTaskAssigneeChange,
-    BugTaskTargetChange,
     get_bug_changes,
     )
 from lp.bugs.adapters.bugdelta import BugDelta
@@ -29,7 +28,6 @@
 from lp.bugs.mail.newbug import generate_bug_add_email
 from lp.bugs.model.bug import get_also_notified_subscribers
 from lp.registry.interfaces.person import IPerson
-from lp.registry.interfaces.product import IProduct
 from lp.services.config import config
 from lp.services.database.sqlbase import block_implicit_flushes
 from lp.services.features import getFeatureFlag
@@ -176,28 +174,6 @@
                     old_bug=bug_delta.bug_before_modification,
                     level=change.change_level)
                 recipients.update(change_recipients)
-            # Additionally, if we are re-targetting a bugtask for a private
-            # bug, we need to ensure the new bug supervisor and maintainer are
-            # notified (if they can view the bug).
-            # If they are the same person, only send one notification.
-            if (isinstance(change, BugTaskTargetChange) and
-                  old_bugtask is not None and bug_delta.bug.private):
-                bugtask_deltas = bug_delta.bugtask_deltas
-                if not isinstance(bugtask_deltas, (list, tuple)):
-                    bugtask_deltas = [bugtask_deltas]
-                for bugtask_delta in bugtask_deltas:
-                    if not bugtask_delta.target:
-                        continue
-                    new_target = bugtask_delta.bugtask.target
-                    if not new_target or not IProduct.providedBy(new_target):
-                        continue
-                    if bug_delta.bug.userCanView(new_target.owner):
-                        recipients.addMaintainer(new_target.owner)
-                    if (new_target.bug_supervisor and not
-                        new_target.bug_supervisor.inTeam(new_target.owner) and
-                        bug_delta.bug.userCanView(new_target.bug_supervisor)):
-                            recipients.addBugSupervisor(
-                                new_target.bug_supervisor)
             bug_delta.bug.addChange(change, recipients=recipients)
 
 


Follow ups