Merge lp:~stevenk/launchpad/no-implicit-maintainer-sub into lp:launchpad

Proposed by Steve Kowalik on 2012-07-27
Status: Merged
Approved by: William Grant on 2012-07-27
Approved revision: no longer in the source branch.
Merged at revision: 15699
Proposed branch: lp:~stevenk/launchpad/no-implicit-maintainer-sub
Merge into: lp:launchpad
Diff against target: 750 lines (+21/-291)
14 files modified
lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt (+0/-24)
lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt (+0/-1)
lib/lp/bugs/configure.zcml (+0/-1)
lib/lp/bugs/doc/bugnotification-sending.txt (+3/-70)
lib/lp/bugs/doc/bugnotification-threading.txt (+4/-4)
lib/lp/bugs/doc/bugnotificationrecipients.txt (+0/-16)
lib/lp/bugs/doc/bugsubscription.txt (+3/-9)
lib/lp/bugs/doc/security-teams.txt (+2/-2)
lib/lp/bugs/mail/bugnotificationrecipients.py (+0/-25)
lib/lp/bugs/model/bug.py (+1/-28)
lib/lp/bugs/model/tests/test_bugsubscriptioninfo.py (+1/-71)
lib/lp/bugs/stories/bugs/bug-add-subscriber.txt (+0/-1)
lib/lp/bugs/tests/bugs-emailinterface.txt (+7/-10)
lib/lp/bugs/tests/test_bugnotification.py (+0/-29)
To merge this branch: bzr merge lp:~stevenk/launchpad/no-implicit-maintainer-sub
Reviewer Review Type Date Requested Status
William Grant code 2012-07-27 Approve on 2012-07-27
Review via email: mp+116991@code.launchpad.net

Commit Message

No longer implicitly notify the product maintainer for bugs.

Description of the Change

No longer implicitly notify the maintainer for bugs.

This required a lot of test changes, and I flat out removed tests that no longer made sense.

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/archiveuploader/tests/nascentupload-closing-bugs.txt'
2--- lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2012-01-20 15:42:44 +0000
3+++ lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2012-07-27 06:20:26 +0000
4@@ -110,30 +110,6 @@
5 Bug #6 in bar (Ubuntu): "Firefox crashes when ...
6 FIXRELEASED
7
8- >>> from lp.bugs.model.bugnotification import BugNotification
9- >>> notifications = BugNotification.selectBy(bug=the_bug, orderBy='id')
10- >>> for notification in notifications:
11- ... print "From %s:\n%s\n" % (
12- ... notification.message.owner.displayname,
13- ... notification.message.text_contents)
14- From Launchpad Janitor:
15- ** Changed in: bar (Ubuntu)
16- Status: New => Fix Released
17- <BLANKLINE>
18- From Launchpad Janitor:
19- This bug was fixed in the package bar - 1.0-2
20- <BLANKLINE>
21- ---------------
22- bar (1.0-2) breezy; urgency=low
23- <BLANKLINE>
24- * A second upload to ensure that binary overrides of _all work
25- <BLANKLINE>
26- * Also closes Launchpad bug #6
27- <BLANKLINE>
28- <BLANKLINE>
29- -- Daniel Silverstone <daniel.silverstone@canonical.com> Thu, 30 Mar 2006 01:36:14 +0100
30- <BLANKLINE>
31-
32 And clean up.
33
34 >>> import os
35
36=== modified file 'lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt'
37--- lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt 2012-07-19 04:40:03 +0000
38+++ lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt 2012-07-27 06:20:26 +0000
39@@ -458,7 +458,6 @@
40 >>> for subscriber in filebug_view.added_bug.getIndirectSubscribers():
41 ... print subscriber.displayname
42 Foo Bar
43- Ubuntu Team
44
45
46 Subscriptions
47
48=== modified file 'lib/lp/bugs/configure.zcml'
49--- lib/lp/bugs/configure.zcml 2012-07-20 15:53:52 +0000
50+++ lib/lp/bugs/configure.zcml 2012-07-27 06:20:26 +0000
51@@ -666,7 +666,6 @@
52 permission="launchpad.View"
53 attributes="
54 all_assignees
55- all_pillar_owners_without_bug_supervisors
56 also_notified_subscribers
57 direct_subscribers
58 direct_subscribers_at_all_levels
59
60=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
61--- lib/lp/bugs/doc/bugnotification-sending.txt 2012-07-19 03:18:37 +0000
62+++ lib/lp/bugs/doc/bugnotification-sending.txt 2012-07-27 06:20:26 +0000
63@@ -86,15 +86,6 @@
64 <BLANKLINE>
65 ...
66 ----------------------------------------------------------------------
67- To: support@ubuntu.com
68- From: Sample Person <1@bugs.launchpad.net>
69- Subject: [Bug 1] subject
70- X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team
71- <BLANKLINE>
72- a comment.
73- <BLANKLINE>
74- ...
75- ----------------------------------------------------------------------
76 To: test@canonical.com
77 From: Sample Person <1@bugs.launchpad.net>
78 Subject: [Bug 1] subject
79@@ -159,11 +150,9 @@
80 To: foo.bar@canonical.com
81 ...
82 To: mark@example.com
83- ...
84- To: support@ubuntu.com
85 From: Sample Person <1@bugs.launchpad.net>
86 Subject: Re: [Bug 1] subject
87- X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team
88+ X-Launchpad-Message-Rationale: Assignee
89 <BLANKLINE>
90 a new comment.
91 <BLANKLINE>
92@@ -199,11 +188,9 @@
93 To: foo.bar@canonical.com
94 ...
95 To: mark@example.com
96- ...
97- To: support@ubuntu.com
98 From: Sample Person <1@bugs.launchpad.net>
99 Subject: [Bug 1] Re: Firefox does not support SVG
100- X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team
101+ X-Launchpad-Message-Rationale: Assignee
102 <BLANKLINE>
103 ** Summary changed:
104 - Old summary
105@@ -247,11 +234,9 @@
106 To: foo.bar@canonical.com
107 ...
108 To: mark@example.com
109- ...
110- To: support@ubuntu.com
111 From: Sample Person <1@bugs.launchpad.net>
112 Subject: [Bug 1] Re: Firefox does not support SVG
113- X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team
114+ X-Launchpad-Message-Rationale: Assignee
115 <BLANKLINE>
116 a new comment.
117 <BLANKLINE>
118@@ -341,7 +326,6 @@
119 foo.bar@canonical.com
120 mark@example.com
121 owner@example.com
122- support@ubuntu.com
123 test@canonical.com
124
125 >>> flush_notifications()
126@@ -383,15 +367,6 @@
127 ... get_email_notifications(notifications)):
128 ... for message in messages:
129 ... print_notification(message)
130- To: support@ubuntu.com
131- From: Sample Person <16@bugs.launchpad.net>
132- Subject: [Bug 16] subject
133- X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team
134- <BLANKLINE>
135- *** This bug is a duplicate of bug 1 ***
136- http://bugs.launchpad.dev/bugs/1
137- ...
138- ----------------------------------------------------------------------
139 To: test@canonical.com
140 From: Sample Person <16@bugs.launchpad.net>
141 Subject: [Bug 16] subject
142@@ -528,8 +503,6 @@
143 0
144 >>> print err
145 DEBUG ...
146- INFO Notifying support@ubuntu.com about bug 2.
147- ...
148 INFO Notifying test@canonical.com about bug 2.
149 ...
150 From: Sample Person <...@bugs.launchpad.net>
151@@ -554,8 +527,6 @@
152 ...
153 INFO Notifying owner@example.com about bug 1.
154 ...
155- INFO Notifying support@ubuntu.com about bug 1.
156- ...
157 INFO Notifying test@canonical.com about bug 1.
158 ...
159 INFO Notifying foo.bar@canonical.com about bug 1.
160@@ -585,8 +556,6 @@
161 ...
162 INFO Notifying owner@example.com about bug 1.
163 ...
164- INFO Notifying support@ubuntu.com about bug 1.
165- ...
166 INFO Notifying test@canonical.com about bug 1.
167 ...
168
169@@ -1157,12 +1126,6 @@
170 Addressless Team, which is subscribed to the bug report.
171 ...
172 ----------------------------------------------------------------------
173- To: support@ubuntu.com
174- ...
175- You received this bug notification because you are a member of Ubuntu
176- Team, which is the registrant for Ubuntu.
177- ...
178- ----------------------------------------------------------------------
179 To: test@canonical.com
180 ...
181 You received this bug notification because you are subscribed to the bug
182@@ -1221,12 +1184,6 @@
183 Addressless Team, which is subscribed to the bug report.
184 ...
185 ----------------------------------------------------------------------
186- To: support@ubuntu.com
187- ...
188- You received this bug notification because you are a member of Ubuntu
189- Team, which is the registrant for Ubuntu.
190- ...
191- ----------------------------------------------------------------------
192 To: test@canonical.com
193 ...
194 You received this bug notification because you are subscribed to the bug
195@@ -1274,12 +1231,6 @@
196 Addressless Team, which is subscribed to the bug report.
197 ...
198 ----------------------------------------------------------------------
199- To: support@ubuntu.com
200- ...
201- You received this bug notification because you are a member of Ubuntu
202- Team, which is the registrant for Ubuntu.
203- ...
204- ----------------------------------------------------------------------
205 To: test@canonical.com
206 ...
207 You received this bug notification because you are subscribed to the bug
208@@ -1338,12 +1289,6 @@
209 Addressless Team, which is subscribed to the bug report.
210 ...
211 ----------------------------------------------------------------------
212- To: support@ubuntu.com
213- ...
214- You received this bug notification because you are a member of Ubuntu
215- Team, which is the registrant for Ubuntu.
216- ...
217- ----------------------------------------------------------------------
218 To: test@canonical.com
219 ...
220 You received this bug notification because you are subscribed to the bug
221@@ -1394,12 +1339,6 @@
222 http://bugs.launchpad.dev/bugs/1
223 ...
224 ----------------------------------------------------------------------
225- To: support@ubuntu.com
226- ...
227- You received this bug notification because you are a member of Ubuntu
228- Team, which is the registrant for Ubuntu.
229- ...
230- ----------------------------------------------------------------------
231 To: test@canonical.com
232 ...
233 You received this bug notification because you are subscribed to the bug
234@@ -1460,12 +1399,6 @@
235 Addressless Team, which is subscribed to the bug report.
236 ...
237 ----------------------------------------------------------------------
238- To: support@ubuntu.com
239- ...
240- You received this bug notification because you are a member of Ubuntu
241- Team, which is the registrant for Ubuntu.
242- ...
243- ----------------------------------------------------------------------
244 To: test@canonical.com
245 ...
246 You received this bug notification because you are subscribed to the bug
247
248=== modified file 'lib/lp/bugs/doc/bugnotification-threading.txt'
249--- lib/lp/bugs/doc/bugnotification-threading.txt 2011-12-30 06:14:56 +0000
250+++ lib/lp/bugs/doc/bugnotification-threading.txt 2012-07-27 06:20:26 +0000
251@@ -40,11 +40,11 @@
252 >>> len(messages)
253 1
254
255-There are four recipients for this message, so we get:
256+There are three recipients for this message, so we get:
257
258 >>> emails = messages[0]
259 >>> len(emails)
260- 4
261+ 3
262
263 The three emails have identical headers for our purposes, so:
264
265@@ -79,7 +79,7 @@
266 1
267 >>> emails = messages[0]
268 >>> len(emails)
269- 4
270+ 3
271 >>> notification = emails[0]
272
273 >>> notification['Message-Id'] == comment.rfc822msgid
274@@ -112,7 +112,7 @@
275 1
276 >>> emails = messages[0]
277 >>> len(emails)
278- 4
279+ 3
280 >>> notification = emails[0]
281 >>> notification['Message-Id'] == reply.rfc822msgid
282 True
283
284=== modified file 'lib/lp/bugs/doc/bugnotificationrecipients.txt'
285--- lib/lp/bugs/doc/bugnotificationrecipients.txt 2012-06-13 21:01:11 +0000
286+++ lib/lp/bugs/doc/bugnotificationrecipients.txt 2012-07-27 06:20:26 +0000
287@@ -47,10 +47,6 @@
288 mark@example.com
289 Assignee
290 You received this bug notification because you are a bug assignee.
291- support@ubuntu.com
292- Registrant (Ubuntu) @ubuntu-team
293- You received this bug notification because you are a member of
294- Ubuntu Team, which is the registrant for Ubuntu.
295 test@canonical.com
296 Subscriber
297 You received this bug notification because you are subscribed
298@@ -185,9 +181,6 @@
299 >>> name20 = personset.getByName("name20")
300 >>> recipients.addStructuralSubscriber(name20, pmount)
301
302- >>> vcs_imports = personset.getByName("vcs-imports")
303- >>> recipients.addRegistrant(vcs_imports, gnomebaker)
304-
305 >>> commercial_admins = personset.getByName("commercial-admins")
306 >>> recipients.addDirectSubscriber(commercial_admins)
307
308@@ -205,10 +198,6 @@
309 You received this bug notification because you are a member
310 of Commercial Subscription Admins, which is subscribed to the
311 bug report.
312- david.allouche@canonical.com
313- Registrant (gnomebaker) @vcs-imports
314- You received this bug notification because you are a member
315- of VCS imports, which is the registrant for gnomebaker.
316 foo.bar@canonical.com
317 Subscriber of Duplicate @testing-spanish-team
318 You received this bug notification because you are a member
319@@ -224,10 +213,6 @@
320 You received this bug notification because you are a member
321 of testing Spanish team, which is subscribed to a
322 duplicate bug report.
323- robertc@robertcollins.net
324- Registrant (gnomebaker) @vcs-imports
325- You received this bug notification because you are a member
326- of VCS imports, which is the registrant for gnomebaker.
327 support@ubuntu.com
328 Assignee @guadamen
329 You received this bug notification because you are a member
330@@ -260,7 +245,6 @@
331 >>> recipients = BugNotificationRecipients()
332 >>> recipients.addDirectSubscriber(test)
333 >>> recipients.addAssignee(test)
334- >>> recipients.addRegistrant(test, gnomebaker)
335 >>> recipients.addDirectSubscriber(foo_bar)
336
337 This guy is emailed because he's a direct subscriber, an assignee and an
338
339=== modified file 'lib/lp/bugs/doc/bugsubscription.txt'
340--- lib/lp/bugs/doc/bugsubscription.txt 2012-07-19 04:40:03 +0000
341+++ lib/lp/bugs/doc/bugsubscription.txt 2012-07-27 06:20:26 +0000
342@@ -94,13 +94,13 @@
343 IBug.getIndirectSubscribers().
344
345 >>> linux_source_bug.getIndirectSubscribers()
346- [<Person at ...>]
347+ []
348
349 Finer-grained access to indirect subscribers is provided by
350 getAlsoNotifiedSubscribers() and getSubscribersFromDuplicates().
351
352 >>> list(linux_source_bug.getAlsoNotifiedSubscribers())
353- [<Person at ...>]
354+ []
355 >>> list(linux_source_bug.getSubscribersFromDuplicates())
356 []
357
358@@ -110,7 +110,7 @@
359 >>> from lp.bugs.model.bug import get_also_notified_subscribers
360 >>> res = get_also_notified_subscribers(linux_source_bug.bugtasks[0])
361 >>> list(res)
362- [<Person at ...>]
363+ []
364
365 These are security proxied.
366
367@@ -130,7 +130,6 @@
368 >>> print_displayname(task.bug_subscribers)
369 Foo Bar
370 Mark Shuttleworth
371- Ubuntu Team
372
373 Here are some examples of the three types of indirect subscribers:
374
375@@ -142,14 +141,12 @@
376
377 >>> print_displayname(linux_source_bug.getIndirectSubscribers())
378 Sample Person
379- Ubuntu Team
380
381 >>> linux_source_bug.getSubscribersFromDuplicates()
382 ()
383
384 >>> print_displayname(linux_source_bug.getAlsoNotifiedSubscribers())
385 Sample Person
386- Ubuntu Team
387
388 2. Structural subscribers
389
390@@ -166,14 +163,12 @@
391 >>> print_displayname(linux_source_bug.getIndirectSubscribers())
392 No Privileges Person
393 Sample Person
394- Ubuntu Team
395
396 >>> linux_source_bug.getSubscribersFromDuplicates()
397 ()
398 >>> print_displayname(linux_source_bug.getAlsoNotifiedSubscribers())
399 No Privileges Person
400 Sample Person
401- Ubuntu Team
402
403 >>> ubuntu_team = personset.getByName("ubuntu-team")
404
405@@ -779,7 +774,6 @@
406 foo.bar@canonical.com
407 mark@example.com
408 robertc@robertcollins.net
409- test@canonical.com
410
411 The upstream maintainer will be subscribed to security-related private
412 bugs, because upstream has no security contact, in this case.
413
414=== modified file 'lib/lp/bugs/doc/security-teams.txt'
415--- lib/lp/bugs/doc/security-teams.txt 2012-07-19 04:40:03 +0000
416+++ lib/lp/bugs/doc/security-teams.txt 2012-07-27 06:20:26 +0000
417@@ -87,7 +87,7 @@
418 False
419
420 >>> subscriber_names(bug)
421- [u'name16', u'ubuntu-team']
422+ [u'name16']
423
424 Likewise, filing a security-related bug on Firefox will subscribe the
425 security contact, the Ubuntu team, to the bug.
426@@ -121,7 +121,7 @@
427 False
428
429 >>> subscriber_names(bug)
430- [u'name12', u'name16']
431+ [u'name16']
432
433 When no security contact exists, only the reporter and product
434 registrant get subscribed.
435
436=== modified file 'lib/lp/bugs/mail/bugnotificationrecipients.py'
437--- lib/lp/bugs/mail/bugnotificationrecipients.py 2012-07-19 04:40:03 +0000
438+++ lib/lp/bugs/mail/bugnotificationrecipients.py 2012-07-27 06:20:26 +0000
439@@ -118,17 +118,6 @@
440 text = "are a bug supervisor"
441 self._addReason(person, text, reason)
442
443- def addSecurityContact(self, person):
444- """Registers a security contact of a bugtask's pillar of this bug."""
445- reason = "Security Contact"
446- if person.is_team:
447- text = ("are a member of %s, which is a security contact"
448- % person.displayname)
449- reason += " @%s" % person.name
450- else:
451- text = "are a security contact"
452- self._addReason(person, text, reason)
453-
454 def addMaintainer(self, person):
455 """Registers a maintainer of a bugtask's pillar of this bug."""
456 reason = "Maintainer"
457@@ -151,20 +140,6 @@
458 text = "are subscribed to %s" % target.displayname
459 self._addReason(person, text, reason)
460
461- def addRegistrant(self, person, upstream):
462- """Registers an upstream product registrant for this bug."""
463- reason = "Registrant (%s)" % upstream.displayname
464- try:
465- if person.is_team:
466- text = ("are a member of %s, which is the registrant for %s" %
467- (person.displayname, upstream.displayname))
468- reason += " @%s" % person.name
469- else:
470- text = "are the registrant for %s" % upstream.displayname
471- except AttributeError:
472- import pdb; pdb.set_trace()
473- self._addReason(person, text, reason)
474-
475 def update(self, recipient_set):
476 """See `INotificationRecipientSet`."""
477 super(BugNotificationRecipients, self).update(recipient_set)
478
479=== modified file 'lib/lp/bugs/model/bug.py'
480--- lib/lp/bugs/model/bug.py 2012-07-25 22:25:27 +0000
481+++ lib/lp/bugs/model/bug.py 2012-07-27 06:20:26 +0000
482@@ -2264,12 +2264,6 @@
483 if assignee in also_notified_subscribers:
484 # We have an assignee that is not a direct subscriber.
485 recipients.addAssignee(bugtask.assignee)
486- # If the target's bug supervisor isn't set...
487- pillar = bugtask.pillar
488- if pillar.official_malone and pillar.bug_supervisor is None:
489- if pillar.owner in also_notified_subscribers:
490- # ...we add the owner as a subscriber.
491- recipients.addRegistrant(pillar.owner, pillar)
492
493 # This structural subscribers code omits direct subscribers itself.
494 # TODO: Pass the info object into get_structural_subscribers for
495@@ -2591,34 +2585,13 @@
496 return load_people(Person.id == self.bugtask.assigneeID)
497
498 @cachedproperty
499- @freeze(BugSubscriberSet)
500- def all_pillar_owners_without_bug_supervisors(self):
501- """Owners of pillars for which there is no bug supervisor.
502-
503- The pillars must also use Launchpad for bug tracking.
504-
505- *Does not* exclude muted subscribers.
506- """
507- if self.bugtask is None:
508- bugtasks = self.bug.bugtasks
509- else:
510- bugtasks = [self.bugtask]
511- for bugtask in bugtasks:
512- pillar = bugtask.pillar
513- if pillar.official_malone:
514- if pillar.bug_supervisor is None:
515- yield pillar.owner
516-
517- @cachedproperty
518 def also_notified_subscribers(self):
519 """All subscribers except direct, dupe, and muted subscribers."""
520 if self.bug.private:
521 return BugSubscriberSet()
522 else:
523 subscribers = BugSubscriberSet().union(
524- self.structural_subscribers,
525- self.all_pillar_owners_without_bug_supervisors,
526- self.all_assignees)
527+ self.structural_subscribers, self.all_assignees)
528 return subscribers.difference(
529 self.direct_subscribers_at_all_levels,
530 self.muted_subscribers)
531
532=== modified file 'lib/lp/bugs/model/tests/test_bugsubscriptioninfo.py'
533--- lib/lp/bugs/model/tests/test_bugsubscriptioninfo.py 2012-07-19 04:40:03 +0000
534+++ lib/lp/bugs/model/tests/test_bugsubscriptioninfo.py 2012-07-27 06:20:26 +0000
535@@ -1,4 +1,4 @@
536-# Copyright 2010 Canonical Ltd. This software is licensed under the
537+# Copyright 2010-2012 Canonical Ltd. This software is licensed under the
538 # GNU Affero General Public License version 3 (see the file LICENSE).
539
540 """Test `BugSubscriptionInfo`."""
541@@ -375,67 +375,6 @@
542 [bugtask2.owner],
543 self.getInfo().forTask(bugtask2).all_assignees)
544
545- def test_all_pillar_owners_without_bug_supervisors(self):
546- # The set of owners of pillars for which no bug supervisor is
547- # configured and which use Launchpad for bug tracking.
548- [bugtask] = self.bug.bugtasks
549- found_owners = (
550- self.getInfo().all_pillar_owners_without_bug_supervisors)
551- self.assertContentEqual([], found_owners)
552- # Clear the supervisor for the bugtask's target and ensure that the
553- # project uses Launchpad Bugs.
554- with person_logged_in(bugtask.target.owner):
555- bugtask.target.setBugSupervisor(None, bugtask.owner)
556- bugtask.pillar.official_malone = True
557- # The collection includes the pillar's owner.
558- found_owners = (
559- self.getInfo().all_pillar_owners_without_bug_supervisors)
560- self.assertContentEqual([bugtask.pillar.owner], found_owners)
561- # Add another bugtask for a pillar that uses Launchpad but does not
562- # have a bug supervisor.
563- target2 = self.factory.makeProduct(
564- bug_supervisor=None, official_malone=True)
565- bugtask2 = self.factory.makeBugTask(bug=self.bug, target=target2)
566- found_owners = (
567- self.getInfo().all_pillar_owners_without_bug_supervisors)
568- self.assertContentEqual(
569- [bugtask.pillar.owner, bugtask2.pillar.owner],
570- found_owners)
571-
572- def test_all_pillar_owners_without_bug_supervisors_not_using_malone(self):
573- # The set of owners of pillars for which no bug supervisor is
574- # configured and which do not use Launchpad for bug tracking is empty.
575- [bugtask] = self.bug.bugtasks
576- # Clear the supervisor for the first bugtask's target and ensure the
577- # project does not use Launchpad Bugs.
578- with person_logged_in(bugtask.target.owner):
579- bugtask.target.setBugSupervisor(None, bugtask.owner)
580- bugtask.pillar.official_malone = False
581- found_owners = (
582- self.getInfo().all_pillar_owners_without_bug_supervisors)
583- self.assertContentEqual([], found_owners)
584-
585- def test_all_pillar_owners_without_bug_supervisors_for_bugtask(self):
586- # The set of the owner of the chosen bugtask's pillar when no bug
587- # supervisor is configured and which uses Launchpad for bug tracking.
588- [bugtask] = self.bug.bugtasks
589- # Clear the supervisor for the bugtask's target and ensure that the
590- # project uses Launchpad Bugs.
591- with person_logged_in(bugtask.target.owner):
592- bugtask.target.setBugSupervisor(None, bugtask.owner)
593- bugtask.pillar.official_malone = True
594- # Add another bugtask for a pillar that uses Launchpad but does not
595- # have a bug supervisor.
596- target2 = self.factory.makeProduct(
597- bug_supervisor=None, official_malone=True)
598- bugtask2 = self.factory.makeBugTask(bug=self.bug, target=target2)
599- # Getting subscription info for just a specific bugtask will yield
600- # owners for only the pillar associated with that bugtask.
601- info_for_bugtask2 = self.getInfo().forTask(bugtask2)
602- self.assertContentEqual(
603- [bugtask2.pillar.owner],
604- info_for_bugtask2.all_pillar_owners_without_bug_supervisors)
605-
606 def _create_also_notified_subscribers(self):
607 # Add an assignee, a bug supervisor and a structural subscriber.
608 bugtask = self.bug.default_bugtask
609@@ -669,14 +608,6 @@
610 with self.exactly_x_queries(1):
611 self.info.all_assignees
612
613- def test_all_pillar_owners_without_bug_supervisors(self):
614- # Getting all bug supervisors and pillar owners can take several
615- # queries. However, there are typically few tasks so the trade for
616- # simplicity of implementation is acceptable. Only the simplest case
617- # is tested here (everything is already cached).
618- with self.exactly_x_queries(0):
619- self.info.all_pillar_owners_without_bug_supervisors
620-
621 def test_also_notified_subscribers(self):
622 with self.exactly_x_queries(5):
623 self.info.also_notified_subscribers
624@@ -685,7 +616,6 @@
625 # When also_notified_subscribers is referenced after some other sets
626 # in BugSubscriptionInfo are referenced, everything comes from cache.
627 self.info.all_assignees
628- self.info.all_pillar_owners_without_bug_supervisors
629 self.info.direct_subscriptions.subscribers
630 self.info.structural_subscribers
631 with self.exactly_x_queries(1):
632
633=== modified file 'lib/lp/bugs/stories/bugs/bug-add-subscriber.txt'
634--- lib/lp/bugs/stories/bugs/bug-add-subscriber.txt 2011-11-17 04:41:58 +0000
635+++ lib/lp/bugs/stories/bugs/bug-add-subscriber.txt 2012-07-27 06:20:26 +0000
636@@ -44,7 +44,6 @@
637 Also notified:
638 Foo Bar
639 Mark Shuttleworth
640- Ubuntu Team
641
642 He subscribes David Allouche to the bug using his Launchpad username.
643
644
645=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
646--- lib/lp/bugs/tests/bugs-emailinterface.txt 2012-07-08 17:40:59 +0000
647+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2012-07-27 06:20:26 +0000
648@@ -142,12 +142,11 @@
649 ... recipients = bug.getBugNotificationRecipients()
650 ... return recipients.getEmails()
651
652-Foo Bar and Sample Person got subscribed to the bug. Foo Bar got
653-subscribed "implicitly", because he's the product owner.
654+Foo Bar got subscribed to the bug.
655
656 >>> added_bug = bug_notification.bug
657 >>> getSubscribers(added_bug)
658- ['foo.bar@canonical.com', 'test@canonical.com']
659+ ['foo.bar@canonical.com']
660
661 If we would file a bug on Ubuntu instead, we would submit a mail like
662 this:
663@@ -182,12 +181,10 @@
664 >>> bug_notification.message == bug.initial_message
665 True
666
667-Foo Bar and Sample Person got subscribed to the bug. Foo Bar got
668-subscribed "implicitly" since he's a bug supervisor for the mozilla
669-package:
670+Foo Bar got subscribed to the bug.
671
672 >>> getSubscribers(added_bug)
673- ['foo.bar@canonical.com', 'test@canonical.com']
674+ ['foo.bar@canonical.com']
675
676 It's possible to file a bug on more than product/package at once:
677
678@@ -822,14 +819,14 @@
679
680 >>> sorted([subscriber.displayname
681 ... for subscriber in bug_five.getIndirectSubscribers()])
682- [u'Sample Person', u'Ubuntu Team']
683+ [u'Sample Person']
684
685 >>> bug_six.subscribe(no_priv, no_priv)
686 <lp.bugs.model.bugsubscription.BugSubscription ...>
687
688 >>> sorted([subscriber.displayname
689 ... for subscriber in bug_five.getIndirectSubscribers()])
690- [u'No Privileges Person', u'Sample Person', u'Ubuntu Team']
691+ [u'No Privileges Person', u'Sample Person']
692
693 Now, if we unsubscribe no-priv from bug #5, he will actually get
694 unsubscribed from bug #6, thus no longer being indirectly subscribed to
695@@ -845,7 +842,7 @@
696
697 >>> sorted([subscriber.displayname
698 ... for subscriber in bug_five.getIndirectSubscribers()])
699- [u'Sample Person', u'Ubuntu Team']
700+ [u'Sample Person']
701
702 (Log back in for the tests that follow.)
703
704
705=== modified file 'lib/lp/bugs/tests/test_bugnotification.py'
706--- lib/lp/bugs/tests/test_bugnotification.py 2012-07-24 05:07:13 +0000
707+++ lib/lp/bugs/tests/test_bugnotification.py 2012-07-27 06:20:26 +0000
708@@ -431,13 +431,6 @@
709 self.pillar = self.makePillar()
710 self.bug = self.makeBug()
711
712- def test_notification_uses_malone(self):
713- self.pillar.official_malone = True
714- direct = self.bug.getDirectSubscribers()
715- indirect = self.bug.getIndirectSubscribers()
716- self.assertThat(direct, Not(Contains(self.pillar_owner)))
717- self.assertThat(indirect, Contains(self.pillar_owner))
718-
719 def test_notification_does_not_use_malone(self):
720 self.pillar.official_malone = False
721 direct = self.bug.getDirectSubscribers()
722@@ -445,28 +438,6 @@
723 self.assertThat(direct, Not(Contains(self.pillar_owner)))
724 self.assertThat(indirect, Not(Contains(self.pillar_owner)))
725
726- def test_status_change_uses_malone(self):
727- # Status changes are sent to the direct and indirect subscribers.
728- self.pillar.official_malone = True
729- [bugtask] = self.bug.bugtasks
730- all_subscribers = set(
731- [person.name for person in chain(
732- self.bug.getDirectSubscribers(),
733- self.bug.getIndirectSubscribers())])
734- bugtask_before_modification = Snapshot(
735- bugtask, providing=providedBy(bugtask))
736- bugtask.transitionToStatus(
737- BugTaskStatus.INVALID, self.bug.owner)
738- notify(ObjectModifiedEvent(
739- bugtask, bugtask_before_modification, ['status'],
740- user=self.bug.owner))
741- latest_notification = BugNotification.selectFirst(orderBy='-id')
742- notified_people = set(
743- recipient.person.name
744- for recipient in latest_notification.recipients)
745- self.assertEqual(all_subscribers, notified_people)
746- self.assertThat(all_subscribers, Contains(self.pillar_owner.name))
747-
748 def test_status_change_does_not_use_malone(self):
749 # Status changes are sent to the direct and indirect subscribers.
750 self.pillar.official_malone = False