Merge lp:~wgrant/launchpad/team-verbose-bugnotifications-bug-253788 into lp:launchpad/db-devel
- team-verbose-bugnotifications-bug-253788
- Merge into db-devel
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~wgrant/launchpad/team-verbose-bugnotifications-bug-253788 |
Merge into: | lp:launchpad/db-devel |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~wgrant/launchpad/team-verbose-bugnotifications-bug-253788 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+9190@code.launchpad.net |
Commit message
Description of the change
William Grant (wgrant) wrote : | # |
Graham Binns (gmb) wrote : | # |
Hi William,
Thanks for submitting this branch. I think you're the first community
contributer to Launchpad - which I honestly kinda expected anyway.
This is a really good branch. As we discussed on IRC, you're going to
drop the sampledata changes and rewrite the tests to use the factory.
I'm going to mark the branch needs-fixing for the sake of taking a look
at the new tests.
The code is fine. There are a couple of stylistic changes I want you to
make but nothing major. This is a really nice patch for an annoying
problem (which, incidentally, I've just noticed is starting to crop up
on the launchpad-dev list too, so this might be worth cherrypicking;
we'll see what Kiko says).
review needs-fixing
> === modified file 'database/
We've agreed on IRC that we can drop this change for using the object
factory and all that new hotness.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1272,8 +1272,21 @@
> >>> bug_15.
> <...>
>
> -If we then add a comment to the bug, ddaa will receieve a notification
> -containing that comment.
> +Notifications sent through a team membership respect the member's
> +verbose_
> +through his membership in landscape-
> +he wants verbose notifications.
> +
> + >>> salgado = getUtility(
> + >>> salgado.
> + True
> +
> + >>> ls = getUtility(
> + >>> ls.verbose_
> + False
> +
> +If we then add a comment to the bug, ddaa and salgado will receieve
> +notifications containing that comment.
>
> >>> comment = getUtility(
> ... 'subject', 'a really simple comment.', sample_person,
> @@ -1286,10 +1299,11 @@
> 1
>
> If we pass this notifcation to get_email_
> -ddaa will receieve a notification which contains the bug description and
> -its status in all of its targets. All other subscribers will receive
> -standard notifications that don't include the bug description. To help
> -with demonstrating this, we'll define a helper function.
> +ddaa and salgado will receieve a notification which contains the bug
> +description and its status in all of its targets. All other subscribers
> +will receive standard notifications that don't include the bug
> +description. To help with demonstrating this, we'll define a helper
> +function.
>
> >>> def collate_
> ... messages_
> @@ -1350,6 +1364,31 @@
> <BLANKLINE>
> -------
>
> +And salgado does too:
> +
> + >>> print_notification(
> + ... collated_
> + To: <email address hidden>
> + From: Sample Person <email address hidden>
> + Subject: [Bug 1...
William Grant (wgrant) wrote : | # |
Thanks Graham, I believe I've fixed all those issues.
=== modified file 'database/
--- database/
+++ database/
@@ -4687,7 +4687,7 @@
[snip reversion of change]
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -1247,9 +1247,40 @@
cases where the user doesn't save bug notifications, which can make
subsequent notifications seem somewhat obscure.
+To demonstrate verbose notifications, we'll create a bug, and subscribe
+some very picky users to it. Verbose Person wants verbose emails, while
+Concise Person does not. We'll also create a team with a member that
+wants verbose notifications.
+
+ >>> switch_
+ >>> bug = factory.
+ ... title='Foo is broken', description='desc')
+
+ >>> vperson = factory.
+ ... <email address hidden>')
+ >>> vperson.
+ >>> bug.subscribe(
+ <BugSubscriptio
+
+ >>> cperson = factory.
+ ... <email address hidden>')
+ >>> cperson.
+ >>> bug.subscribe(
+ <BugSubscriptio
+
+ >>> team = factory.
+ >>> team.verbose_
+ >>> tperson = factory.
+ ... <email address hidden>')
+ >>> tperson.
+ >>> team.addMember(
+ >>> bug.subscribe(team, tperson)
+ <BugSubscriptio
+
We'll expire all existing notifications since we're not interested in
them:
+ >>> switch_
>>> notifications = getUtility(
... IBugNotificatio
>>> len(notifications)
@@ -1261,37 +1292,13 @@
... syncUpdate(
-To demonstrate verbose notifications, we'll subscribe David Allouche,
-who receives verbose bug notifications, to bug 15.
-
- >>> bug_15 = getUtility(
- >>> ddaa = getUtility(
- >>> ddaa.verbose_
- True
-
- >>> bug_15.
- <...>
-
-Notifications sent through a team membership respect the member's
-verbose_
-through his membership in landscape-
-he wants verbose notifications.
-
- >>> salgado = getUtility(
- >>> salgado.
- True
-
- >>> ls = getUtility(
- >>> ls.verbose_
- False
-
-If we then add a comment to the bug, ddaa and salgado will receieve
+If we then add a ...
Graham Binns (gmb) wrote : | # |
Hi William,
The changes look good. You've agreed to add a test for the case where
Person.
Team.verbose_
There are a couple of stylistic changes I'd like you to make, otherwise
this is ready to go once that test has been added.
On Thu, Jul 23, 2009 at 03:00:39PM -0000, William Grant wrote:
> Thanks Graham, I believe I've fixed all those issues.
>
> === modified file 'database/
> --- database/
> +++ database/
> @@ -4687,7 +4687,7 @@
> [snip reversion of change]
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1247,9 +1247,40 @@
> cases where the user doesn't save bug notifications, which can make
> subsequent notifications seem somewhat obscure.
>
> +To demonstrate verbose notifications, we'll create a bug, and subscribe
> +some very picky users to it. Verbose Person wants verbose emails, while
> +Concise Person does not. We'll also create a team with a member that
> +wants verbose notifications.
> +
> + >>> switch_
> + >>> bug = factory.
> + ... title='Foo is broken', description='desc')
We prefer to do wrapping of method calls thus:
>>> bug = factory.makeBug(
... product=
... description='desc')
See http://
you've done it is okay, but we've pretty much standardised on the
style above, so we should stick with that (in fact I don't know why the
other version is in the style guide any more; this one is the one that
gets used).
> +
> + >>> vperson = factory.
> + ... <email address hidden>')
> + >>> vperson.
> + >>> bug.subscribe(
> + <BugSubscriptio
> +
We should be verbose in tests where possible. So,
s/vperson/
> + >>> cperson = factory.
> + ... <email address hidden>')
> + >>> cperson.
> + >>> bug.subscribe(
> + <BugSubscriptio
> +
And s/cperson/
> + >>> team = factory.
> + >>> team.verbose_
> + >>> tperson = factory.
> + ... <email address hidden>')
And s/tperson/
> + >>> tperson.
> + >>> team.addMember(
> + >>> bug.subscribe(team, tperson)
> + <BugSubscriptio
> +
> We'll expire all existing notifications since we're not interested in
> them:
>
> + >>> switch_
> >>> notifications = getUti...
William Grant (wgrant) wrote : | # |
I've added the other case and renamed the variables.
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -1249,32 +1249,53 @@
To demonstrate verbose notifications, we'll create a bug, and subscribe
some very picky users to it. Verbose Person wants verbose emails, while
-Concise Person does not. We'll also create a team with a member that
-wants verbose notifications.
+Concise Person does not. We'll also create teams and give them members
+with different verbose_
>>> switch_
- >>> bug = factory.
- ... title='Foo is broken', description='desc')
-
- >>> vperson = factory.
- ... <email address hidden>')
- >>> vperson.
- >>> bug.subscribe(
- <BugSubscriptio
-
- >>> cperson = factory.
- ... <email address hidden>')
- >>> cperson.
- >>> bug.subscribe(
- <BugSubscriptio
-
- >>> team = factory.
- >>> team.verbose_
- >>> tperson = factory.
- ... <email address hidden>')
- >>> tperson.
- >>> team.addMember(
- >>> bug.subscribe(team, tperson)
+ >>> bug = factory.makeBug(
+ ... product=
+ ... description='desc')
+
+ >>> verbose_person = factory.makePerson(
+ ... displayname=
+ >>> verbose_
+ >>> bug.subscribe(
+ <BugSubscriptio
+
+ >>> concise_person = factory.makePerson(
+ ... displayname=
+ >>> concise_
+ >>> bug.subscribe(
+ <BugSubscriptio
+
+
+Concise Team doesn't want verbose notifications, while Concise Team
+Person, a member, does.
+
+ >>> concise_team = factory.makeTeam(
+ ... name='conciseteam', displayname=
+ >>> concise_
+ >>> concise_team_person = factory.makePerson(
+ ... displayname=
+ ... <email address hidden>')
+ >>> concise_
+ >>> concise_
+ >>> bug.subscribe(
+ <BugSubscriptio
+
+Verbose Team wants verbose notifications, while Verbose Team Person, a
+member, does not.
+
+ >>> verbose_team = factory.makeTeam(
+ ... name='verboseteam', displayname=
Graham Binns (gmb) wrote : | # |
Hi William,
This looks awesome. Merge approved!
review approve code
status approved
Barry Warsaw (barry) wrote : | # |
On Jul 23, 2009, at 11:18 AM, Graham Binns wrote:
>>
>> + >>> switch_
>> + >>> bug =
>> factory.
>> + ... title='Foo is broken',
>> description='desc')
>
> We prefer to do wrapping of method calls thus:
>
>>>> bug = factory.makeBug(
> ... product=
> broken',
> ... description='desc')
>
> See http://
> you've done it is okay, but we've pretty much standardised on the
> style above, so we should stick with that (in fact I don't know why
> the
> other version is in the style guide any more; this one is the one that
> gets used).
TOOWTDI. I've updated the style guide.
-Barry
Preview Diff
1 | === modified file 'database/sampledata/current.sql' |
2 | --- database/sampledata/current.sql 2009-07-17 00:26:05 +0000 |
3 | +++ database/sampledata/current.sql 2009-07-23 04:49:04 +0000 |
4 | @@ -4687,7 +4687,7 @@ |
5 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (26, 'Daniel Silverstone', NULL, NULL, 'kinnison', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.618722', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, 2, 'when importing bugs from http://bugzilla.ubuntu.com/', NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, 261); |
6 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (27, 'Daniel Henrique Debonzi', NULL, NULL, 'debonzi', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.557224', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, 8, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, 271); |
7 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (28, 'Celso Providelo', NULL, NULL, 'cprov', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.59705', 'Somewhere', 'in this world', 'Something', 'whatever', 'not mandatory', 75, '999432423', '+55 16 3374-2027', NULL, NULL, NULL, false, 8, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, 281); |
8 | -INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (29, 'Guilherme Salgado', NULL, NULL, 'salgado', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.596025', 'Somewhere', 'in this world', 'Something', 'whatever', 'not mandatory', 75, '999432423', '+55 16 3374-2027', NULL, NULL, NULL, false, 8, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, 291); |
9 | +INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (29, 'Guilherme Salgado', NULL, NULL, 'salgado', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.596025', 'Somewhere', 'in this world', 'Something', 'whatever', 'not mandatory', 75, '999432423', '+55 16 3374-2027', NULL, NULL, NULL, false, 8, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, true, 291); |
10 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (30, 'Rosetta Administrators', 25, 'Rosetta Administrators', 'rosetta-admins', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.613368', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, NULL); |
11 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (31, 'Ubuntu Translators', 30, 'Ubuntu Translators', 'ubuntu-translators', NULL, NULL, NULL, NULL, 1, NULL, '2005-06-06 08:59:51.617651', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, NULL); |
12 | INSERT INTO person (id, displayname, teamowner, teamdescription, name, language, fti, defaultmembershipperiod, defaultrenewalperiod, subscriptionpolicy, merged, datecreated, addressline1, addressline2, organization, city, province, country, postcode, phone, homepage_content, icon, mugshot, hide_email_addresses, creation_rationale, creation_comment, registrant, logo, renewal_policy, personal_standing, personal_standing_reason, mail_resumption_date, mailing_list_auto_subscribe_policy, mailing_list_receive_duplicates, visibility, verbose_bugnotifications, account) VALUES (32, 'GuadaMen', 16, 'The guadalinex maintainers team', 'guadamen', NULL, NULL, 700, 300, 1, NULL, '2005-06-06 08:59:51.606755', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL, NULL, 10, 0, NULL, NULL, 1, true, 1, false, NULL); |
13 | |
14 | === modified file 'lib/lp/bugs/doc/bugnotification-sending.txt' |
15 | --- lib/lp/bugs/doc/bugnotification-sending.txt 2009-06-12 16:36:02 +0000 |
16 | +++ lib/lp/bugs/doc/bugnotification-sending.txt 2009-07-23 04:51:44 +0000 |
17 | @@ -59,6 +59,33 @@ |
18 | >>> for bug_notifications, messages in email_notifications: |
19 | ... for message in messages: |
20 | ... print_notification(message) |
21 | + To: foo.bar@canonical.com |
22 | + From: Sample Person <test@canonical.com> |
23 | + Subject: [Bug 1] subject |
24 | + X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
25 | + <BLANKLINE> |
26 | + a comment. |
27 | + <BLANKLINE> |
28 | + ... |
29 | + Firefox does not support SVG |
30 | + http://bugs.launchpad.dev/bugs/1 |
31 | + You received this bug notification because you are subscribed to |
32 | + mozilla-firefox in ubuntu. |
33 | + <BLANKLINE> |
34 | + ---------------------------------------------------------------------- |
35 | + To: mark@hbd.com |
36 | + From: Sample Person <test@canonical.com> |
37 | + Subject: [Bug 1] subject |
38 | + X-Launchpad-Message-Rationale: Assignee |
39 | + <BLANKLINE> |
40 | + a comment. |
41 | + <BLANKLINE> |
42 | + ... |
43 | + Firefox does not support SVG |
44 | + http://bugs.launchpad.dev/bugs/1 |
45 | + You received this bug notification because you are a bug assignee. |
46 | + <BLANKLINE> |
47 | + ---------------------------------------------------------------------- |
48 | To: support@ubuntu.com |
49 | From: Sample Person <test@canonical.com> |
50 | Subject: [Bug 1] subject |
51 | @@ -73,19 +100,6 @@ |
52 | Team, which is the registrant for Ubuntu. |
53 | <BLANKLINE> |
54 | ---------------------------------------------------------------------- |
55 | - To: mark@hbd.com |
56 | - From: Sample Person <test@canonical.com> |
57 | - Subject: [Bug 1] subject |
58 | - X-Launchpad-Message-Rationale: Assignee |
59 | - <BLANKLINE> |
60 | - a comment. |
61 | - <BLANKLINE> |
62 | - ... |
63 | - Firefox does not support SVG |
64 | - http://bugs.launchpad.dev/bugs/1 |
65 | - You received this bug notification because you are a bug assignee. |
66 | - <BLANKLINE> |
67 | - ---------------------------------------------------------------------- |
68 | To: test@canonical.com |
69 | From: Sample Person <test@canonical.com> |
70 | Subject: [Bug 1] subject |
71 | @@ -100,20 +114,6 @@ |
72 | of the bug. |
73 | <BLANKLINE> |
74 | ---------------------------------------------------------------------- |
75 | - To: foo.bar@canonical.com |
76 | - From: Sample Person <test@canonical.com> |
77 | - Subject: [Bug 1] subject |
78 | - X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
79 | - <BLANKLINE> |
80 | - a comment. |
81 | - <BLANKLINE> |
82 | - ... |
83 | - Firefox does not support SVG |
84 | - http://bugs.launchpad.dev/bugs/1 |
85 | - You received this bug notification because you are subscribed to |
86 | - mozilla-firefox in ubuntu. |
87 | - <BLANKLINE> |
88 | - ---------------------------------------------------------------------- |
89 | |
90 | You can see that the message above contains the bug's initial comment's |
91 | message id as its reference, in order to make it thread properly in the |
92 | @@ -167,6 +167,10 @@ |
93 | >>> for bug_notifications, messages in email_notifications: |
94 | ... for message in messages: |
95 | ... print_notification(message) |
96 | + To: foo.bar@canonical.com |
97 | + ... |
98 | + To: mark@hbd.com |
99 | + ... |
100 | To: support@ubuntu.com |
101 | From: Sample Person <test@canonical.com> |
102 | Subject: Re: [Bug 1] subject |
103 | @@ -181,12 +185,8 @@ |
104 | Team, which is the registrant for Ubuntu. |
105 | <BLANKLINE> |
106 | ---------------------------------------------------------------------- |
107 | - To: mark@hbd.com |
108 | - ... |
109 | To: test@canonical.com |
110 | ... |
111 | - To: foo.bar@canonical.com |
112 | - ... |
113 | |
114 | >>> flush_notifications() |
115 | |
116 | @@ -207,6 +207,10 @@ |
117 | >>> for bug_notifications, messages in email_notifications: |
118 | ... for message in messages: |
119 | ... print_notification(message) |
120 | + To: foo.bar@canonical.com |
121 | + ... |
122 | + To: mark@hbd.com |
123 | + ... |
124 | To: support@ubuntu.com |
125 | From: Sample Person <test@canonical.com> |
126 | Subject: [Bug 1] Re: Firefox does not support SVG |
127 | @@ -223,12 +227,8 @@ |
128 | Team, which is the registrant for Ubuntu. |
129 | <BLANKLINE> |
130 | ---------------------------------------------------------------------- |
131 | - To: mark@hbd.com |
132 | - ... |
133 | To: test@canonical.com |
134 | ... |
135 | - To: foo.bar@canonical.com |
136 | - ... |
137 | |
138 | If we insert a comment and some more changes, they will be included in |
139 | the constructed email: |
140 | @@ -255,6 +255,10 @@ |
141 | >>> for bug_notifications, messages in email_notifications: |
142 | ... for message in messages: |
143 | ... print_notification(message) |
144 | + To: foo.bar@canonical.com |
145 | + ... |
146 | + To: mark@hbd.com |
147 | + ... |
148 | To: support@ubuntu.com |
149 | From: Sample Person <test@canonical.com> |
150 | Subject: [Bug 1] Re: Firefox does not support SVG |
151 | @@ -276,12 +280,8 @@ |
152 | You received this bug notification because you are a member of Ubuntu |
153 | Team, which is the registrant for Ubuntu. |
154 | ---------------------------------------------------------------------- |
155 | - To: mark@hbd.com |
156 | - ... |
157 | To: test@canonical.com |
158 | ... |
159 | - To: foo.bar@canonical.com |
160 | - ... |
161 | |
162 | If we insert yet another comment, it will be sent as a separate email. |
163 | |
164 | @@ -298,6 +298,10 @@ |
165 | >>> for bug_notifications, messages in email_notifications: |
166 | ... for message in messages: |
167 | ... print_notification(message) |
168 | + To: foo.bar@canonical.com |
169 | + ... |
170 | + To: mark@hbd.com |
171 | + ... |
172 | To: support@ubuntu.com |
173 | From: Sample Person <test@canonical.com> |
174 | Subject: [Bug 1] Re: Firefox does not support SVG |
175 | @@ -320,12 +324,12 @@ |
176 | Team, which is the registrant for Ubuntu. |
177 | <BLANKLINE> |
178 | ---------------------------------------------------------------------- |
179 | - To: mark@hbd.com |
180 | - ... |
181 | To: test@canonical.com |
182 | ... |
183 | To: foo.bar@canonical.com |
184 | ... |
185 | + To: mark@hbd.com |
186 | + ... |
187 | To: support@ubuntu.com |
188 | From: Sample Person <test@canonical.com> |
189 | Subject: [Bug 1] subject |
190 | @@ -340,12 +344,8 @@ |
191 | Team, which is the registrant for Ubuntu. |
192 | <BLANKLINE> |
193 | ---------------------------------------------------------------------- |
194 | - To: mark@hbd.com |
195 | - ... |
196 | To: test@canonical.com |
197 | ... |
198 | - To: foo.bar@canonical.com |
199 | - ... |
200 | |
201 | >>> flush_notifications() |
202 | |
203 | @@ -372,6 +372,10 @@ |
204 | >>> for bug_notifications, messages in email_notifications: |
205 | ... for message in messages: |
206 | ... print_notification(message) |
207 | + To: foo.bar@canonical.com |
208 | + ... |
209 | + To: mark@hbd.com |
210 | + ... |
211 | To: support@ubuntu.com |
212 | From: Sample Person <test@canonical.com> |
213 | Subject: [Bug 1] subject |
214 | @@ -386,12 +390,12 @@ |
215 | Team, which is the registrant for Ubuntu. |
216 | <BLANKLINE> |
217 | ---------------------------------------------------------------------- |
218 | - To: mark@hbd.com |
219 | - ... |
220 | To: test@canonical.com |
221 | ... |
222 | To: foo.bar@canonical.com |
223 | ... |
224 | + To: mark@hbd.com |
225 | + ... |
226 | To: support@ubuntu.com |
227 | From: Sample Person <test@canonical.com> |
228 | Subject: [Bug 1] subject |
229 | @@ -406,12 +410,12 @@ |
230 | Team, which is the registrant for Ubuntu. |
231 | <BLANKLINE> |
232 | ---------------------------------------------------------------------- |
233 | - To: mark@hbd.com |
234 | - ... |
235 | To: test@canonical.com |
236 | ... |
237 | To: foo.bar@canonical.com |
238 | ... |
239 | + To: mark@hbd.com |
240 | + ... |
241 | To: support@ubuntu.com |
242 | From: Sample Person <test@canonical.com> |
243 | Subject: [Bug 1] subject |
244 | @@ -426,12 +430,8 @@ |
245 | Team, which is the registrant for Ubuntu. |
246 | <BLANKLINE> |
247 | ---------------------------------------------------------------------- |
248 | - To: mark@hbd.com |
249 | - ... |
250 | To: test@canonical.com |
251 | ... |
252 | - To: foo.bar@canonical.com |
253 | - ... |
254 | |
255 | >>> flush_notifications() |
256 | |
257 | @@ -460,6 +460,10 @@ |
258 | >>> for bug_notifications, messages in email_notifications: |
259 | ... for message in messages: |
260 | ... print_notification(message) |
261 | + To: foo.bar@canonical.com |
262 | + ... |
263 | + To: mark@hbd.com |
264 | + ... |
265 | To: support@ubuntu.com |
266 | From: Sample Person <test@canonical.com> |
267 | Subject: [Bug 1] subject |
268 | @@ -474,12 +478,12 @@ |
269 | Team, which is the registrant for Ubuntu. |
270 | <BLANKLINE> |
271 | ---------------------------------------------------------------------- |
272 | - To: mark@hbd.com |
273 | - ... |
274 | To: test@canonical.com |
275 | ... |
276 | To: foo.bar@canonical.com |
277 | ... |
278 | + To: mark@hbd.com |
279 | + ... |
280 | To: support@ubuntu.com |
281 | From: Foo Bar <foo.bar@canonical.com> |
282 | Subject: [Bug 1] Re: Firefox does not support SVG |
283 | @@ -494,12 +498,12 @@ |
284 | Team, which is the registrant for Ubuntu. |
285 | <BLANKLINE> |
286 | ---------------------------------------------------------------------- |
287 | - To: mark@hbd.com |
288 | - ... |
289 | To: test@canonical.com |
290 | ... |
291 | To: foo.bar@canonical.com |
292 | ... |
293 | + To: mark@hbd.com |
294 | + ... |
295 | To: support@ubuntu.com |
296 | From: Sample Person <test@canonical.com> |
297 | Subject: [Bug 1] Re: Firefox does not support SVG |
298 | @@ -514,12 +518,8 @@ |
299 | Team, which is the registrant for Ubuntu. |
300 | <BLANKLINE> |
301 | ---------------------------------------------------------------------- |
302 | - To: mark@hbd.com |
303 | - ... |
304 | To: test@canonical.com |
305 | ... |
306 | - To: foo.bar@canonical.com |
307 | - ... |
308 | |
309 | >>> flush_notifications() |
310 | |
311 | @@ -602,75 +602,75 @@ |
312 | ... for message in messages: |
313 | ... print_notification_headers(message) |
314 | |
315 | - To: support@ubuntu.com |
316 | - From: Sample Person <test@canonical.com> |
317 | - Subject: [Bug 2] Re: Blackhole Trash folder |
318 | - X-Launchpad-Message-Rationale: Registrant (Tomcat) @ubuntu-team |
319 | - <BLANKLINE> |
320 | - To: mark@hbd.com |
321 | - From: Sample Person <test@canonical.com> |
322 | - Subject: [Bug 2] Re: Blackhole Trash folder |
323 | - X-Launchpad-Message-Rationale: Registrant (Debian) |
324 | - <BLANKLINE> |
325 | - To: test@canonical.com |
326 | - From: Sample Person <test@canonical.com> |
327 | - Subject: [Bug 2] Re: Blackhole Trash folder |
328 | - X-Launchpad-Message-Rationale: Assignee |
329 | - <BLANKLINE> |
330 | - To: support@ubuntu.com |
331 | - From: Foo Bar <foo.bar@canonical.com> |
332 | - Subject: [Bug 2] Re: Blackhole Trash folder |
333 | - X-Launchpad-Message-Rationale: Registrant (Tomcat) @ubuntu-team |
334 | - <BLANKLINE> |
335 | - To: mark@hbd.com |
336 | - From: Foo Bar <foo.bar@canonical.com> |
337 | - Subject: [Bug 2] Re: Blackhole Trash folder |
338 | - X-Launchpad-Message-Rationale: Registrant (Debian) |
339 | - <BLANKLINE> |
340 | - To: test@canonical.com |
341 | - From: Foo Bar <foo.bar@canonical.com> |
342 | - Subject: [Bug 2] Re: Blackhole Trash folder |
343 | - X-Launchpad-Message-Rationale: Assignee |
344 | - <BLANKLINE> |
345 | - To: support@ubuntu.com |
346 | - From: Sample Person <test@canonical.com> |
347 | - Subject: [Bug 1] Re: Firefox does not support SVG |
348 | - X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
349 | - <BLANKLINE> |
350 | - To: mark@hbd.com |
351 | - From: Sample Person <test@canonical.com> |
352 | - Subject: [Bug 1] Re: Firefox does not support SVG |
353 | - X-Launchpad-Message-Rationale: Assignee |
354 | - <BLANKLINE> |
355 | - To: test@canonical.com |
356 | - From: Sample Person <test@canonical.com> |
357 | - Subject: [Bug 1] Re: Firefox does not support SVG |
358 | - X-Launchpad-Message-Rationale: Subscriber |
359 | - <BLANKLINE> |
360 | - To: foo.bar@canonical.com |
361 | - From: Sample Person <test@canonical.com> |
362 | - Subject: [Bug 1] Re: Firefox does not support SVG |
363 | - X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
364 | - <BLANKLINE> |
365 | - To: support@ubuntu.com |
366 | - From: Foo Bar <foo.bar@canonical.com> |
367 | - Subject: [Bug 1] Re: Firefox does not support SVG |
368 | - X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
369 | - <BLANKLINE> |
370 | - To: mark@hbd.com |
371 | - From: Foo Bar <foo.bar@canonical.com> |
372 | - Subject: [Bug 1] Re: Firefox does not support SVG |
373 | - X-Launchpad-Message-Rationale: Assignee |
374 | - <BLANKLINE> |
375 | - To: test@canonical.com |
376 | - From: Foo Bar <foo.bar@canonical.com> |
377 | - Subject: [Bug 1] Re: Firefox does not support SVG |
378 | - X-Launchpad-Message-Rationale: Subscriber |
379 | - <BLANKLINE> |
380 | - To: foo.bar@canonical.com |
381 | - From: Foo Bar <foo.bar@canonical.com> |
382 | - Subject: [Bug 1] Re: Firefox does not support SVG |
383 | - X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
384 | + To: mark@hbd.com |
385 | + From: Sample Person <test@canonical.com> |
386 | + Subject: [Bug 2] Re: Blackhole Trash folder |
387 | + X-Launchpad-Message-Rationale: Registrant (Debian) |
388 | + <BLANKLINE> |
389 | + To: support@ubuntu.com |
390 | + From: Sample Person <test@canonical.com> |
391 | + Subject: [Bug 2] Re: Blackhole Trash folder |
392 | + X-Launchpad-Message-Rationale: Registrant (Tomcat) @ubuntu-team |
393 | + <BLANKLINE> |
394 | + To: test@canonical.com |
395 | + From: Sample Person <test@canonical.com> |
396 | + Subject: [Bug 2] Re: Blackhole Trash folder |
397 | + X-Launchpad-Message-Rationale: Assignee |
398 | + <BLANKLINE> |
399 | + To: mark@hbd.com |
400 | + From: Foo Bar <foo.bar@canonical.com> |
401 | + Subject: [Bug 2] Re: Blackhole Trash folder |
402 | + X-Launchpad-Message-Rationale: Registrant (Debian) |
403 | + <BLANKLINE> |
404 | + To: support@ubuntu.com |
405 | + From: Foo Bar <foo.bar@canonical.com> |
406 | + Subject: [Bug 2] Re: Blackhole Trash folder |
407 | + X-Launchpad-Message-Rationale: Registrant (Tomcat) @ubuntu-team |
408 | + <BLANKLINE> |
409 | + To: test@canonical.com |
410 | + From: Foo Bar <foo.bar@canonical.com> |
411 | + Subject: [Bug 2] Re: Blackhole Trash folder |
412 | + X-Launchpad-Message-Rationale: Assignee |
413 | + <BLANKLINE> |
414 | + To: foo.bar@canonical.com |
415 | + From: Sample Person <test@canonical.com> |
416 | + Subject: [Bug 1] Re: Firefox does not support SVG |
417 | + X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
418 | + <BLANKLINE> |
419 | + To: mark@hbd.com |
420 | + From: Sample Person <test@canonical.com> |
421 | + Subject: [Bug 1] Re: Firefox does not support SVG |
422 | + X-Launchpad-Message-Rationale: Assignee |
423 | + <BLANKLINE> |
424 | + To: support@ubuntu.com |
425 | + From: Sample Person <test@canonical.com> |
426 | + Subject: [Bug 1] Re: Firefox does not support SVG |
427 | + X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
428 | + <BLANKLINE> |
429 | + To: test@canonical.com |
430 | + From: Sample Person <test@canonical.com> |
431 | + Subject: [Bug 1] Re: Firefox does not support SVG |
432 | + X-Launchpad-Message-Rationale: Subscriber |
433 | + <BLANKLINE> |
434 | + To: foo.bar@canonical.com |
435 | + From: Foo Bar <foo.bar@canonical.com> |
436 | + Subject: [Bug 1] Re: Firefox does not support SVG |
437 | + X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) |
438 | + <BLANKLINE> |
439 | + To: mark@hbd.com |
440 | + From: Foo Bar <foo.bar@canonical.com> |
441 | + Subject: [Bug 1] Re: Firefox does not support SVG |
442 | + X-Launchpad-Message-Rationale: Assignee |
443 | + <BLANKLINE> |
444 | + To: support@ubuntu.com |
445 | + From: Foo Bar <foo.bar@canonical.com> |
446 | + Subject: [Bug 1] Re: Firefox does not support SVG |
447 | + X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
448 | + <BLANKLINE> |
449 | + To: test@canonical.com |
450 | + From: Foo Bar <foo.bar@canonical.com> |
451 | + Subject: [Bug 1] Re: Firefox does not support SVG |
452 | + X-Launchpad-Message-Rationale: Subscriber |
453 | <BLANKLINE> |
454 | |
455 | There's a blank line before the signature, and the signature marker has |
456 | @@ -689,8 +689,8 @@ |
457 | '-- ', |
458 | 'Firefox does not support SVG', |
459 | 'http://bugs.launchpad.dev/bugs/1', |
460 | - 'You received this bug notification because you are subscribed to', |
461 | - 'mozilla-firefox in ubuntu.'] |
462 | + 'You received this bug notification because you are a direct subscriber', |
463 | + 'of the bug.'] |
464 | |
465 | >>> flush_notifications() |
466 | |
467 | @@ -720,11 +720,11 @@ |
468 | >>> for bug_notifications, messages in email_notifications: |
469 | ... for message in messages: |
470 | ... print message['To'] |
471 | + foo.bar@canonical.com |
472 | marilize@hbd.com |
473 | mark@hbd.com |
474 | + support@ubuntu.com |
475 | test@canonical.com |
476 | - support@ubuntu.com |
477 | - foo.bar@canonical.com |
478 | |
479 | >>> flush_notifications() |
480 | |
481 | @@ -778,6 +778,23 @@ |
482 | >>> for bug_notifications, messages in get_email_notifications(notifications): |
483 | ... for message in messages: |
484 | ... print_notification(message) |
485 | + To: foo.bar@canonical.com |
486 | + From: Sample Person <test@canonical.com> |
487 | + Subject: [Bug 16] subject |
488 | + X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) via Bug 1 |
489 | + <BLANKLINE> |
490 | + *** This bug is a duplicate of bug 1 *** |
491 | + http://bugs.launchpad.dev/bugs/1 |
492 | + <BLANKLINE> |
493 | + a comment. |
494 | + <BLANKLINE> |
495 | + -- |
496 | + new bug |
497 | + http://bugs.launchpad.dev/bugs/16 |
498 | + You received this bug notification because you are subscribed to |
499 | + mozilla-firefox in ubuntu (via bug 1). |
500 | + <BLANKLINE> |
501 | + ---------------------------------------------------------------------- |
502 | To: marilize@hbd.com |
503 | From: Sample Person <test@canonical.com> |
504 | Subject: [Bug 16] subject |
505 | @@ -812,6 +829,23 @@ |
506 | bug 1). |
507 | <BLANKLINE> |
508 | ---------------------------------------------------------------------- |
509 | + To: support@ubuntu.com |
510 | + From: Sample Person <test@canonical.com> |
511 | + Subject: [Bug 16] subject |
512 | + X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
513 | + <BLANKLINE> |
514 | + *** This bug is a duplicate of bug 1 *** |
515 | + http://bugs.launchpad.dev/bugs/1 |
516 | + <BLANKLINE> |
517 | + a comment. |
518 | + <BLANKLINE> |
519 | + -- |
520 | + new bug |
521 | + http://bugs.launchpad.dev/bugs/16 |
522 | + You received this bug notification because you are a member of Ubuntu |
523 | + Team, which is the registrant for Ubuntu. |
524 | + <BLANKLINE> |
525 | + ---------------------------------------------------------------------- |
526 | To: test@canonical.com |
527 | From: Sample Person <test@canonical.com> |
528 | Subject: [Bug 16] subject |
529 | @@ -829,40 +863,6 @@ |
530 | of the bug. |
531 | <BLANKLINE> |
532 | ---------------------------------------------------------------------- |
533 | - To: support@ubuntu.com |
534 | - From: Sample Person <test@canonical.com> |
535 | - Subject: [Bug 16] subject |
536 | - X-Launchpad-Message-Rationale: Registrant (Ubuntu) @ubuntu-team |
537 | - <BLANKLINE> |
538 | - *** This bug is a duplicate of bug 1 *** |
539 | - http://bugs.launchpad.dev/bugs/1 |
540 | - <BLANKLINE> |
541 | - a comment. |
542 | - <BLANKLINE> |
543 | - -- |
544 | - new bug |
545 | - http://bugs.launchpad.dev/bugs/16 |
546 | - You received this bug notification because you are a member of Ubuntu |
547 | - Team, which is the registrant for Ubuntu. |
548 | - <BLANKLINE> |
549 | - ---------------------------------------------------------------------- |
550 | - To: foo.bar@canonical.com |
551 | - From: Sample Person <test@canonical.com> |
552 | - Subject: [Bug 16] subject |
553 | - X-Launchpad-Message-Rationale: Subscriber (mozilla-firefox in ubuntu) via Bug 1 |
554 | - <BLANKLINE> |
555 | - *** This bug is a duplicate of bug 1 *** |
556 | - http://bugs.launchpad.dev/bugs/1 |
557 | - <BLANKLINE> |
558 | - a comment. |
559 | - <BLANKLINE> |
560 | - -- |
561 | - new bug |
562 | - http://bugs.launchpad.dev/bugs/16 |
563 | - You received this bug notification because you are subscribed to |
564 | - mozilla-firefox in ubuntu (via bug 1). |
565 | - <BLANKLINE> |
566 | - ---------------------------------------------------------------------- |
567 | |
568 | Also note that notification was sent to Mark as well, since he's a |
569 | subscriber of bug one. |
570 | @@ -985,10 +985,10 @@ |
571 | 0 |
572 | >>> print err |
573 | INFO creating lockfile |
574 | + INFO Notifying mark@hbd.com about bug 2. |
575 | + ... |
576 | INFO Notifying support@ubuntu.com about bug 2. |
577 | ... |
578 | - INFO Notifying mark@hbd.com about bug 2. |
579 | - ... |
580 | INFO Notifying test@canonical.com about bug 2. |
581 | ... |
582 | From: Sample Person <test@canonical.com> |
583 | @@ -999,14 +999,6 @@ |
584 | ... |
585 | X-Launchpad-Message-Rationale: Assignee |
586 | ... |
587 | - INFO Notifying marilize@hbd.com about bug 1. |
588 | - ... |
589 | - INFO Notifying mark@hbd.com about bug 1. |
590 | - ... |
591 | - INFO Notifying test@canonical.com about bug 1. |
592 | - ... |
593 | - INFO Notifying support@ubuntu.com about bug 1. |
594 | - ... |
595 | INFO Notifying foo.bar@canonical.com about bug 1. |
596 | ... |
597 | From: Sample Person <test@canonical.com> |
598 | @@ -1021,9 +1013,9 @@ |
599 | ... |
600 | INFO Notifying mark@hbd.com about bug 1. |
601 | ... |
602 | + INFO Notifying support@ubuntu.com about bug 1. |
603 | + ... |
604 | INFO Notifying test@canonical.com about bug 1. |
605 | - ... |
606 | - INFO Notifying support@ubuntu.com about bug 1. |
607 | ... |
608 | INFO Notifying foo.bar@canonical.com about bug 1. |
609 | ... |
610 | @@ -1049,6 +1041,14 @@ |
611 | http://bugs.launchpad.dev/bugs/1 |
612 | You received this bug notification because you are subscribed to |
613 | mozilla-firefox in ubuntu. |
614 | + <BLANKLINE> |
615 | + INFO Notifying marilize@hbd.com about bug 1. |
616 | + ... |
617 | + INFO Notifying mark@hbd.com about bug 1. |
618 | + ... |
619 | + INFO Notifying support@ubuntu.com about bug 1. |
620 | + ... |
621 | + INFO Notifying test@canonical.com about bug 1. |
622 | ... |
623 | |
624 | >>> flush_notifications() |
625 | @@ -1272,8 +1272,21 @@ |
626 | >>> bug_15.subscribe(ddaa, sample_person) |
627 | <...> |
628 | |
629 | -If we then add a comment to the bug, ddaa will receieve a notification |
630 | -containing that comment. |
631 | +Notifications sent through a team membership respect the member's |
632 | +verbose_bugnotifications, not the team's. salgado gets notifications |
633 | +through his membership in landscape-developers. salgado decides that |
634 | +he wants verbose notifications. |
635 | + |
636 | + >>> salgado = getUtility(IPersonSet).getByName('salgado') |
637 | + >>> salgado.verbose_bugnotifications |
638 | + True |
639 | + |
640 | + >>> ls = getUtility(IPersonSet).getByName('landscape-developers') |
641 | + >>> ls.verbose_bugnotifications |
642 | + False |
643 | + |
644 | +If we then add a comment to the bug, ddaa and salgado will receieve |
645 | +notifications containing that comment. |
646 | |
647 | >>> comment = getUtility(IMessageSet).fromText( |
648 | ... 'subject', 'a really simple comment.', sample_person, |
649 | @@ -1286,10 +1299,11 @@ |
650 | 1 |
651 | |
652 | If we pass this notifcation to get_email_notifications we can see that |
653 | -ddaa will receieve a notification which contains the bug description and |
654 | -its status in all of its targets. All other subscribers will receive |
655 | -standard notifications that don't include the bug description. To help |
656 | -with demonstrating this, we'll define a helper function. |
657 | +ddaa and salgado will receieve a notification which contains the bug |
658 | +description and its status in all of its targets. All other subscribers |
659 | +will receive standard notifications that don't include the bug |
660 | +description. To help with demonstrating this, we'll define a helper |
661 | +function. |
662 | |
663 | >>> def collate_messages_by_recipient(messages): |
664 | ... messages_by_recipient = {} |
665 | @@ -1350,6 +1364,31 @@ |
666 | <BLANKLINE> |
667 | ---------------------------------------------------------------------- |
668 | |
669 | +And salgado does too: |
670 | + |
671 | + >>> print_notification( |
672 | + ... collated_messages['guilherme.salgado@canonical.com'][0]) |
673 | + To: guilherme.salgado@canonical.com |
674 | + From: Sample Person <test@canonical.com> |
675 | + Subject: [Bug 15] subject |
676 | + X-Launchpad-Message-Rationale: Subscriber (Redfish) @landscape-developers |
677 | + <BLANKLINE> |
678 | + a really simple comment. |
679 | + <BLANKLINE> |
680 | + -- |
681 | + Nonsensical bugs are useless |
682 | + http://bugs.launchpad.dev/bugs/15 |
683 | + You received this bug notification because you are a member of Landscape |
684 | + Developers, which is subscribed to Redfish. |
685 | + <BLANKLINE> |
686 | + Status in Redfish: New |
687 | + Status in Mozilla Thunderbird: New |
688 | + <BLANKLINE> |
689 | + Bug description: |
690 | + Like this one, natch. |
691 | + <BLANKLINE> |
692 | + ---------------------------------------------------------------------- |
693 | + |
694 | == Notification Recipients == |
695 | |
696 | Bug notifications are sent to direct subscribers of a bug as well as to |
697 | @@ -1386,16 +1425,21 @@ |
698 | >>> for bug_notifications, messages in email_notifications: |
699 | ... for message in messages: |
700 | ... print_notification(message) |
701 | - To: support@ubuntu.com |
702 | - ... |
703 | - You received this bug notification because you are a member of Ubuntu |
704 | - Team, which is the registrant for Ubuntu. |
705 | - <BLANKLINE> |
706 | - ---------------------------------------------------------------------- |
707 | - To: test@canonical.com |
708 | - ... |
709 | - You received this bug notification because you are a direct subscriber |
710 | - of the bug. |
711 | + To: foo.bar@canonical.com |
712 | + ... |
713 | + You received this bug notification because you are subscribed to |
714 | + mozilla-firefox in ubuntu. |
715 | + <BLANKLINE> |
716 | + ---------------------------------------------------------------------- |
717 | + To: marilize@hbd.com |
718 | + ... |
719 | + You received this bug notification because you are a member of ShipIt |
720 | + Administrators, which is a direct subscriber. |
721 | + <BLANKLINE> |
722 | + ---------------------------------------------------------------------- |
723 | + To: mark@hbd.com |
724 | + ... |
725 | + You received this bug notification because you are a bug assignee. |
726 | <BLANKLINE> |
727 | ---------------------------------------------------------------------- |
728 | To: no-priv@canonical.com |
729 | @@ -1412,21 +1456,16 @@ |
730 | Firefox. |
731 | <BLANKLINE> |
732 | ---------------------------------------------------------------------- |
733 | - To: mark@hbd.com |
734 | - ... |
735 | - You received this bug notification because you are a bug assignee. |
736 | - <BLANKLINE> |
737 | - ---------------------------------------------------------------------- |
738 | - To: foo.bar@canonical.com |
739 | - ... |
740 | - You received this bug notification because you are subscribed to |
741 | - mozilla-firefox in ubuntu. |
742 | - <BLANKLINE> |
743 | - ---------------------------------------------------------------------- |
744 | - To: marilize@hbd.com |
745 | - ... |
746 | - You received this bug notification because you are a member of ShipIt |
747 | - Administrators, which is a direct subscriber. |
748 | + To: support@ubuntu.com |
749 | + ... |
750 | + You received this bug notification because you are a member of Ubuntu |
751 | + Team, which is the registrant for Ubuntu. |
752 | + <BLANKLINE> |
753 | + ---------------------------------------------------------------------- |
754 | + To: test@canonical.com |
755 | + ... |
756 | + You received this bug notification because you are a direct subscriber |
757 | + of the bug. |
758 | <BLANKLINE> |
759 | ---------------------------------------------------------------------- |
760 | |
761 | @@ -1449,6 +1488,12 @@ |
762 | >>> for bug_notifications, messages in email_notifications: |
763 | ... for message in messages: |
764 | ... print_notification(message) |
765 | + To: foo.bar@canonical.com |
766 | + ... |
767 | + You received this bug notification because you are subscribed to |
768 | + mozilla-firefox in ubuntu. |
769 | + <BLANKLINE> |
770 | + ---------------------------------------------------------------------- |
771 | To: marilize@hbd.com |
772 | From: Sample Person <test@canonical.com> |
773 | Subject: [Bug 1] subject |
774 | @@ -1468,24 +1513,18 @@ |
775 | You received this bug notification because you are a bug assignee. |
776 | <BLANKLINE> |
777 | ---------------------------------------------------------------------- |
778 | + To: support@ubuntu.com |
779 | + ... |
780 | + You received this bug notification because you are a member of Ubuntu |
781 | + Team, which is the registrant for Ubuntu. |
782 | + <BLANKLINE> |
783 | + ---------------------------------------------------------------------- |
784 | To: test@canonical.com |
785 | ... |
786 | You received this bug notification because you are a direct subscriber |
787 | of the bug. |
788 | <BLANKLINE> |
789 | ---------------------------------------------------------------------- |
790 | - To: support@ubuntu.com |
791 | - ... |
792 | - You received this bug notification because you are a member of Ubuntu |
793 | - Team, which is the registrant for Ubuntu. |
794 | - <BLANKLINE> |
795 | - ---------------------------------------------------------------------- |
796 | - To: foo.bar@canonical.com |
797 | - ... |
798 | - You received this bug notification because you are subscribed to |
799 | - mozilla-firefox in ubuntu. |
800 | - <BLANKLINE> |
801 | - ---------------------------------------------------------------------- |
802 | |
803 | The notifications generated by addChangeNotification() are sent only to |
804 | structural subscribers with the notification level METADATA or higher. |
805 | @@ -1500,16 +1539,21 @@ |
806 | >>> for bug_notifications, messages in email_notifications: |
807 | ... for message in messages: |
808 | ... print_notification(message) |
809 | - To: support@ubuntu.com |
810 | - ... |
811 | - You received this bug notification because you are a member of Ubuntu |
812 | - Team, which is the registrant for Ubuntu. |
813 | - <BLANKLINE> |
814 | - ---------------------------------------------------------------------- |
815 | - To: test@canonical.com |
816 | - ... |
817 | - You received this bug notification because you are a direct subscriber |
818 | - of the bug. |
819 | + To: foo.bar@canonical.com |
820 | + ... |
821 | + You received this bug notification because you are subscribed to |
822 | + mozilla-firefox in ubuntu. |
823 | + <BLANKLINE> |
824 | + ---------------------------------------------------------------------- |
825 | + To: marilize@hbd.com |
826 | + ... |
827 | + You received this bug notification because you are a member of ShipIt |
828 | + Administrators, which is a direct subscriber. |
829 | + <BLANKLINE> |
830 | + ---------------------------------------------------------------------- |
831 | + To: mark@hbd.com |
832 | + ... |
833 | + You received this bug notification because you are a bug assignee. |
834 | <BLANKLINE> |
835 | ---------------------------------------------------------------------- |
836 | To: no-priv@canonical.com |
837 | @@ -1528,21 +1572,16 @@ |
838 | Firefox. |
839 | <BLANKLINE> |
840 | ---------------------------------------------------------------------- |
841 | - To: mark@hbd.com |
842 | - ... |
843 | - You received this bug notification because you are a bug assignee. |
844 | - <BLANKLINE> |
845 | - ---------------------------------------------------------------------- |
846 | - To: foo.bar@canonical.com |
847 | - ... |
848 | - You received this bug notification because you are subscribed to |
849 | - mozilla-firefox in ubuntu. |
850 | - <BLANKLINE> |
851 | - ---------------------------------------------------------------------- |
852 | - To: marilize@hbd.com |
853 | - ... |
854 | - You received this bug notification because you are a member of ShipIt |
855 | - Administrators, which is a direct subscriber. |
856 | + To: support@ubuntu.com |
857 | + ... |
858 | + You received this bug notification because you are a member of Ubuntu |
859 | + Team, which is the registrant for Ubuntu. |
860 | + <BLANKLINE> |
861 | + ---------------------------------------------------------------------- |
862 | + To: test@canonical.com |
863 | + ... |
864 | + You received this bug notification because you are a direct subscriber |
865 | + of the bug. |
866 | <BLANKLINE> |
867 | ---------------------------------------------------------------------- |
868 | |
869 | @@ -1563,6 +1602,12 @@ |
870 | >>> for bug_notifications, messages in email_notifications: |
871 | ... for message in messages: |
872 | ... print_notification(message) |
873 | + To: foo.bar@canonical.com |
874 | + ... |
875 | + You received this bug notification because you are subscribed to |
876 | + mozilla-firefox in ubuntu. |
877 | + <BLANKLINE> |
878 | + ---------------------------------------------------------------------- |
879 | To: marilize@hbd.com |
880 | From: Sample Person <test@canonical.com> |
881 | Subject: [Bug 1] Re: Firefox does not support SVG |
882 | @@ -1582,21 +1627,15 @@ |
883 | You received this bug notification because you are a bug assignee. |
884 | <BLANKLINE> |
885 | ---------------------------------------------------------------------- |
886 | + To: support@ubuntu.com |
887 | + ... |
888 | + You received this bug notification because you are a member of Ubuntu |
889 | + Team, which is the registrant for Ubuntu. |
890 | + <BLANKLINE> |
891 | + ---------------------------------------------------------------------- |
892 | To: test@canonical.com |
893 | ... |
894 | You received this bug notification because you are a direct subscriber |
895 | of the bug. |
896 | <BLANKLINE> |
897 | ---------------------------------------------------------------------- |
898 | - To: support@ubuntu.com |
899 | - ... |
900 | - You received this bug notification because you are a member of Ubuntu |
901 | - Team, which is the registrant for Ubuntu. |
902 | - <BLANKLINE> |
903 | - ---------------------------------------------------------------------- |
904 | - To: foo.bar@canonical.com |
905 | - ... |
906 | - You received this bug notification because you are subscribed to |
907 | - mozilla-firefox in ubuntu. |
908 | - <BLANKLINE> |
909 | - ---------------------------------------------------------------------- |
910 | |
911 | === modified file 'lib/lp/bugs/scripts/bugnotification.py' |
912 | --- lib/lp/bugs/scripts/bugnotification.py 2009-06-25 00:40:31 +0000 |
913 | +++ lib/lp/bugs/scripts/bugnotification.py 2009-07-23 13:02:15 +0000 |
914 | @@ -11,8 +11,7 @@ |
915 | |
916 | from canonical.config import config |
917 | from canonical.database.sqlbase import rollback, begin |
918 | -from canonical.launchpad.helpers import ( |
919 | - get_contact_email_addresses, get_email_template) |
920 | +from canonical.launchpad.helpers import emailPeople, get_email_template |
921 | from lp.bugs.interfaces.bugmessage import IBugMessageSet |
922 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
923 | from lp.registry.interfaces.person import IPersonSet |
924 | @@ -41,8 +40,8 @@ |
925 | recipients = {} |
926 | for notification in bug_notifications: |
927 | for recipient in notification.recipients: |
928 | - for address in get_contact_email_addresses(recipient.person): |
929 | - recipients[address] = recipient |
930 | + for emailperson in emailPeople(recipient.person): |
931 | + recipients[emailperson] = recipient |
932 | |
933 | for notification in bug_notifications: |
934 | assert notification.bug == bug, bug.id |
935 | @@ -105,14 +104,18 @@ |
936 | config.malone.comment_syncing_team) |
937 | # Only members of the comment syncing team should get comment |
938 | # notifications related to bug watches or initial comment imports. |
939 | + # XXX wgrant 2009-07-23: Do we want to take the emailperson's or |
940 | + # recipient's membership? |
941 | if (is_initial_import_notification or |
942 | (bug_message is not None and bug_message.bugwatch is not None)): |
943 | recipients = dict( |
944 | - (address, recipient) |
945 | - for address, recipient in recipients.items() |
946 | + (emailperson, recipient) |
947 | + for emailperson, recipient in recipients.items() |
948 | if recipient.person.inTeam(comment_syncing_team)) |
949 | bug_notification_builder = BugNotificationBuilder(bug) |
950 | - for address, recipient in recipients.items(): |
951 | + for emailperson, recipient in sorted(recipients.items(), |
952 | + key=lambda t: t[0].preferredemail.email): |
953 | + address = str(emailperson.preferredemail.email) |
954 | reason = recipient.reason_body |
955 | rationale = recipient.reason_header |
956 | |
957 | @@ -125,8 +128,7 @@ |
958 | # If the person we're sending to receives verbose notifications |
959 | # we include the description and status of the bug in the email |
960 | # footer. |
961 | - person = recipient.person |
962 | - if person.verbose_bugnotifications: |
963 | + if emailperson.verbose_bugnotifications: |
964 | email_template = 'bug-notification-verbose.txt' |
965 | body_data['bug_description'] = bug.description |
966 |
This branch fixes bug #253788, by making bugmail to a team member use the member's verbose_ bugnotification s, not the team's.
bugnotification -sending. txt relied on dict ordering in construct_ email_notificat ions, and I needed to rekey that dict with Persons. As they don't hash reliably, the order changed between test runs, so I decided to sort the returned messages by emailaddress. The majority of the changes in bugnotification -sending. txt are reorderings based on this; only the hunks mentioning salgado are new tests.