Merge lp:~stevenk/launchpad/notify-announce-list into lp:launchpad
- notify-announce-list
- Merge into devel
Proposed by
Steve Kowalik
Status: | Merged |
---|---|
Approved by: | Steve Kowalik |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13153 |
Proposed branch: | lp:~stevenk/launchpad/notify-announce-list |
Merge into: | lp:launchpad |
Diff against target: |
524 lines (+56/-84) 17 files modified
lib/lp/archiveuploader/nascentupload.py (+0/-1) lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+7/-1) lib/lp/archiveuploader/tests/nascentupload-ddebs.txt (+2/-2) lib/lp/archiveuploader/tests/test_uploadprocessor.py (+1/-1) lib/lp/archiveuploader/tests/upload-karma.txt (+2/-2) lib/lp/archiveuploader/tests/uploadpolicy.txt (+0/-2) lib/lp/archiveuploader/uploadpolicy.py (+0/-9) lib/lp/soyuz/adapters/notification.py (+15/-13) lib/lp/soyuz/browser/queue.py (+1/-1) lib/lp/soyuz/doc/distroseriesqueue-notify.txt (+4/-7) lib/lp/soyuz/doc/distroseriesqueue.txt (+1/-1) lib/lp/soyuz/interfaces/queue.py (+2/-5) lib/lp/soyuz/model/queue.py (+6/-7) lib/lp/soyuz/scripts/queue.py (+8/-17) lib/lp/soyuz/scripts/tests/test_queue.py (+4/-5) lib/lp/soyuz/tests/test_packageupload.py (+1/-2) scripts/ftpmaster-tools/queue (+2/-8) |
To merge this branch: | bzr merge lp:~stevenk/launchpad/notify-announce-list |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | Approve | ||
Review via email: mp+63067@code.launchpad.net |
Commit message
[r=wgrant][no-qa] Drop announce_list from notify() and PackageUpload.
Description of the change
Drop announce_list from the arguments for notify() and PackageUpload.
This now leaves announce notification up to the IDistroSeries.
I have discussed this change with Julian Edwards before implementing, and he agreed it was a good change.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/archiveuploader/nascentupload.py' | |||
2 | --- lib/lp/archiveuploader/nascentupload.py 2011-05-20 08:04:19 +0000 | |||
3 | +++ lib/lp/archiveuploader/nascentupload.py 2011-06-02 09:53:33 +0000 | |||
4 | @@ -855,7 +855,6 @@ | |||
5 | 855 | changes_file_object = open(self.changes.filepath, "r") | 855 | changes_file_object = open(self.changes.filepath, "r") |
6 | 856 | self.queue_root.notify( | 856 | self.queue_root.notify( |
7 | 857 | summary_text=self.warning_message, | 857 | summary_text=self.warning_message, |
8 | 858 | announce_list=self.policy.announcelist, | ||
9 | 859 | changes_file_object=changes_file_object, | 858 | changes_file_object=changes_file_object, |
10 | 860 | logger=self.logger) | 859 | logger=self.logger) |
11 | 861 | changes_file_object.close() | 860 | changes_file_object.close() |
12 | 862 | 861 | ||
13 | === modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt' | |||
14 | --- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-05-27 06:17:14 +0000 | |||
15 | +++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-06-02 09:53:33 +0000 | |||
16 | @@ -655,11 +655,17 @@ | |||
17 | 655 | DEBUG Body: | 655 | DEBUG Body: |
18 | 656 | DEBUG bar (1.0-6) breezy; urgency=low | 656 | DEBUG bar (1.0-6) breezy; urgency=low |
19 | 657 | ... | 657 | ... |
21 | 658 | DEBUG No announcement sent | 658 | DEBUG Announcing to hoary-announce@lists.ubuntu.com |
22 | 659 | ... | 659 | ... |
23 | 660 | DEBUG You are receiving this email because you are the uploader, maintainer | 660 | DEBUG You are receiving this email because you are the uploader, maintainer |
24 | 661 | or | 661 | or |
25 | 662 | DEBUG signer of the above package. | 662 | DEBUG signer of the above package. |
26 | 663 | DEBUG Would have sent a mail: | ||
27 | 664 | DEBUG Subject: [ubuntu/hoary] bar 1.0-6 (Accepted) | ||
28 | 665 | DEBUG Sender: Celso Providelo <cprov@ubuntu.com> | ||
29 | 666 | DEBUG Recipients: hoary-announce@lists.ubuntu.com | ||
30 | 667 | DEBUG Bcc: Root <root@localhost>, bar_derivatives@packages.qa.debian.org | ||
31 | 668 | ... | ||
32 | 663 | 669 | ||
33 | 664 | No emails generated: | 670 | No emails generated: |
34 | 665 | 671 | ||
35 | 666 | 672 | ||
36 | === modified file 'lib/lp/archiveuploader/tests/nascentupload-ddebs.txt' | |||
37 | --- lib/lp/archiveuploader/tests/nascentupload-ddebs.txt 2011-03-03 00:43:44 +0000 | |||
38 | +++ lib/lp/archiveuploader/tests/nascentupload-ddebs.txt 2011-06-02 09:53:33 +0000 | |||
39 | @@ -39,7 +39,7 @@ | |||
40 | 39 | We don't really care where the source ends up, so we just accept the | 39 | We don't really care where the source ends up, so we just accept the |
41 | 40 | default overrides. It is now pending publication. | 40 | default overrides. It is now pending publication. |
42 | 41 | 41 | ||
44 | 42 | >>> src.queue_root.acceptFromQueue("announce@example.com") | 42 | >>> src.queue_root.acceptFromQueue() |
45 | 43 | >>> print src.queue_root.status.name | 43 | >>> print src.queue_root.status.name |
46 | 44 | DONE | 44 | DONE |
47 | 45 | 45 | ||
48 | @@ -91,7 +91,7 @@ | |||
49 | 91 | 91 | ||
50 | 92 | >>> bin.queue_root.overrideBinaries(main, devel, None, [main, universe]) | 92 | >>> bin.queue_root.overrideBinaries(main, devel, None, [main, universe]) |
51 | 93 | True | 93 | True |
53 | 94 | >>> bin.queue_root.acceptFromQueue('announce@example.com') | 94 | >>> bin.queue_root.acceptFromQueue() |
54 | 95 | 95 | ||
55 | 96 | >>> print bin.queue_root.status.name | 96 | >>> print bin.queue_root.status.name |
56 | 97 | ACCEPTED | 97 | ACCEPTED |
57 | 98 | 98 | ||
58 | === modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py' | |||
59 | --- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2011-05-20 03:28:24 +0000 | |||
60 | +++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2011-06-02 09:53:33 +0000 | |||
61 | @@ -1438,7 +1438,7 @@ | |||
62 | 1438 | # just-uploaded changesfile from librarian. | 1438 | # just-uploaded changesfile from librarian. |
63 | 1439 | self.layer.txn.commit() | 1439 | self.layer.txn.commit() |
64 | 1440 | 1440 | ||
66 | 1441 | upload.queue_root.acceptFromQueue('announce@ubuntu.com') | 1441 | upload.queue_root.acceptFromQueue() |
67 | 1442 | 1442 | ||
68 | 1443 | # 'biscuit_1.0-2' building on i386 get accepted and published. | 1443 | # 'biscuit_1.0-2' building on i386 get accepted and published. |
69 | 1444 | packager.buildVersion('1.0-2', suite=self.breezy.name, arch="i386") | 1444 | packager.buildVersion('1.0-2', suite=self.breezy.name, arch="i386") |
70 | 1445 | 1445 | ||
71 | === modified file 'lib/lp/archiveuploader/tests/upload-karma.txt' | |||
72 | --- lib/lp/archiveuploader/tests/upload-karma.txt 2010-12-02 16:13:51 +0000 | |||
73 | +++ lib/lp/archiveuploader/tests/upload-karma.txt 2011-06-02 09:53:33 +0000 | |||
74 | @@ -33,7 +33,7 @@ | |||
75 | 33 | 33 | ||
76 | 34 | >>> from canonical.database.sqlbase import commit | 34 | >>> from canonical.database.sqlbase import commit |
77 | 35 | >>> commit() | 35 | >>> commit() |
79 | 36 | >>> bar_src.queue_root.acceptFromQueue("announce@example.com") | 36 | >>> bar_src.queue_root.acceptFromQueue() |
80 | 37 | Karma added: action=distributionuploadaccepted, distribution=ubuntu | 37 | Karma added: action=distributionuploadaccepted, distribution=ubuntu |
81 | 38 | 38 | ||
82 | 39 | As can be seen, karma was added for the package creator. | 39 | As can be seen, karma was added for the package creator. |
83 | @@ -55,7 +55,7 @@ | |||
84 | 55 | >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0] | 55 | >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0] |
85 | 56 | >>> removeSecurityProxy(foo_src.queue_root).signing_key = key | 56 | >>> removeSecurityProxy(foo_src.queue_root).signing_key = key |
86 | 57 | >>> commit() | 57 | >>> commit() |
88 | 58 | >>> foo_src.queue_root.acceptFromQueue("announce@example.com") | 58 | >>> foo_src.queue_root.acceptFromQueue() |
89 | 59 | Karma added: action=distributionuploadaccepted, distribution=ubuntu | 59 | Karma added: action=distributionuploadaccepted, distribution=ubuntu |
90 | 60 | Karma added: action=sponsoruploadaccepted, distribution=ubuntu | 60 | Karma added: action=sponsoruploadaccepted, distribution=ubuntu |
91 | 61 | 61 | ||
92 | 62 | 62 | ||
93 | === modified file 'lib/lp/archiveuploader/tests/uploadpolicy.txt' | |||
94 | --- lib/lp/archiveuploader/tests/uploadpolicy.txt 2010-10-18 22:24:59 +0000 | |||
95 | +++ lib/lp/archiveuploader/tests/uploadpolicy.txt 2011-06-02 09:53:33 +0000 | |||
96 | @@ -71,8 +71,6 @@ | |||
97 | 71 | >>> buildd_policy.setDistroSeriesAndPocket("hoary") | 71 | >>> buildd_policy.setDistroSeriesAndPocket("hoary") |
98 | 72 | >>> print buildd_policy.distroseries.name | 72 | >>> print buildd_policy.distroseries.name |
99 | 73 | hoary | 73 | hoary |
100 | 74 | >>> print buildd_policy.announcelist | ||
101 | 75 | hoary-changes@ubuntu.com | ||
102 | 76 | 74 | ||
103 | 77 | Policies can make decisions based on whether or not they want to | 75 | Policies can make decisions based on whether or not they want to |
104 | 78 | approve an upload automatically (I.E. move it straight to ACCEPTED | 76 | approve an upload automatically (I.E. move it straight to ACCEPTED |
105 | 79 | 77 | ||
106 | === modified file 'lib/lp/archiveuploader/uploadpolicy.py' | |||
107 | --- lib/lp/archiveuploader/uploadpolicy.py 2011-05-27 19:53:20 +0000 | |||
108 | +++ lib/lp/archiveuploader/uploadpolicy.py 2011-06-02 09:53:33 +0000 | |||
109 | @@ -150,15 +150,6 @@ | |||
110 | 150 | if self.archive is None: | 150 | if self.archive is None: |
111 | 151 | self.archive = self.distroseries.main_archive | 151 | self.archive = self.distroseries.main_archive |
112 | 152 | 152 | ||
113 | 153 | @property | ||
114 | 154 | def announcelist(self): | ||
115 | 155 | """Return the announcement list address.""" | ||
116 | 156 | announce_list = getattr(self.options, 'announcelist', None) | ||
117 | 157 | if (announce_list is None and | ||
118 | 158 | getattr(self, 'distroseries', None) is not None): | ||
119 | 159 | announce_list = self.distroseries.changeslist | ||
120 | 160 | return announce_list | ||
121 | 161 | |||
122 | 162 | def checkUpload(self, upload): | 153 | def checkUpload(self, upload): |
123 | 163 | """Mandatory policy checks on NascentUploads.""" | 154 | """Mandatory policy checks on NascentUploads.""" |
124 | 164 | if self.archive.is_copy: | 155 | if self.archive.is_copy: |
125 | 165 | 156 | ||
126 | === modified file 'lib/lp/soyuz/adapters/notification.py' | |||
127 | --- lib/lp/soyuz/adapters/notification.py 2011-05-27 21:12:25 +0000 | |||
128 | +++ lib/lp/soyuz/adapters/notification.py 2011-06-02 09:53:33 +0000 | |||
129 | @@ -115,9 +115,8 @@ | |||
130 | 115 | 115 | ||
131 | 116 | 116 | ||
132 | 117 | def notify(blamer, spr, bprs, customfiles, archive, distroseries, pocket, | 117 | def notify(blamer, spr, bprs, customfiles, archive, distroseries, pocket, |
136 | 118 | announce_list=None, summary_text=None, changes=None, | 118 | summary_text=None, changes=None, changesfile_content=None, |
137 | 119 | changesfile_content=None, changesfile_object=None, action=None, | 119 | changesfile_object=None, action=None, dry_run=False, logger=None): |
135 | 120 | dry_run=False, logger=None): | ||
138 | 121 | """Notify about | 120 | """Notify about |
139 | 122 | 121 | ||
140 | 123 | :param blamer: The `IPerson` who is to blame for this notification. | 122 | :param blamer: The `IPerson` who is to blame for this notification. |
141 | @@ -127,7 +126,6 @@ | |||
142 | 127 | :param archive: The target `IArchive`. | 126 | :param archive: The target `IArchive`. |
143 | 128 | :param distroseries: The target `IDistroSeries`. | 127 | :param distroseries: The target `IDistroSeries`. |
144 | 129 | :param pocket: The target `PackagePublishingPocket`. | 128 | :param pocket: The target `PackagePublishingPocket`. |
145 | 130 | :param announce_list: Where to announce the upload. | ||
146 | 131 | :param summary_text: The summary of the notification. | 129 | :param summary_text: The summary of the notification. |
147 | 132 | :param changes: A dictionary of the parsed changes file. | 130 | :param changes: A dictionary of the parsed changes file. |
148 | 133 | :param changesfile_content: The raw content of the changes file, so it | 131 | :param changesfile_content: The raw content of the changes file, so it |
149 | @@ -203,7 +201,7 @@ | |||
150 | 203 | spr, bprs, customfiles, archive, distroseries, pocket, action) | 201 | spr, bprs, customfiles, archive, distroseries, pocket, action) |
151 | 204 | body = assemble_body( | 202 | body = assemble_body( |
152 | 205 | blamer, spr, archive, distroseries, summarystring, changes, | 203 | blamer, spr, archive, distroseries, summarystring, changes, |
154 | 206 | action, announce_list) | 204 | action) |
155 | 207 | send_mail( | 205 | send_mail( |
156 | 208 | spr, archive, recipients, subject, body, dry_run, | 206 | spr, archive, recipients, subject, body, dry_run, |
157 | 209 | changesfile_content=changesfile_content, | 207 | changesfile_content=changesfile_content, |
158 | @@ -215,10 +213,12 @@ | |||
159 | 215 | # If we're sending an acceptance notification for a non-PPA upload, | 213 | # If we're sending an acceptance notification for a non-PPA upload, |
160 | 216 | # announce if possible. Avoid announcing backports, binary-only | 214 | # announce if possible. Avoid announcing backports, binary-only |
161 | 217 | # security uploads, or autosync uploads. | 215 | # security uploads, or autosync uploads. |
166 | 218 | if (action == 'accepted' and announce_list and not archive.is_ppa and | 216 | if (action == 'accepted' and distroseries.changeslist |
167 | 219 | pocket != PackagePublishingPocket.BACKPORTS and | 217 | and not archive.is_ppa |
168 | 220 | not (pocket == PackagePublishingPocket.SECURITY and spr is None) and | 218 | and pocket != PackagePublishingPocket.BACKPORTS |
169 | 221 | not is_auto_sync_upload(spr, bprs, pocket, changes['Changed-By'])): | 219 | and not (pocket == PackagePublishingPocket.SECURITY and spr is None) |
170 | 220 | and not is_auto_sync_upload( | ||
171 | 221 | spr, bprs, pocket, changes['Changed-By'])): | ||
172 | 222 | from_addr = sanitize_string(changes['Changed-By']) | 222 | from_addr = sanitize_string(changes['Changed-By']) |
173 | 223 | name = None | 223 | name = None |
174 | 224 | bcc_addr = None | 224 | bcc_addr = None |
175 | @@ -230,11 +230,12 @@ | |||
176 | 230 | bcc_addr = '%s_derivatives@packages.qa.debian.org' % name | 230 | bcc_addr = '%s_derivatives@packages.qa.debian.org' % name |
177 | 231 | 231 | ||
178 | 232 | build_and_send_mail( | 232 | build_and_send_mail( |
180 | 233 | 'announcement', [str(announce_list)], from_addr, bcc_addr) | 233 | 'announcement', [str(distroseries.changeslist)], from_addr, |
181 | 234 | bcc_addr) | ||
182 | 234 | 235 | ||
183 | 235 | 236 | ||
184 | 236 | def assemble_body(blamer, spr, archive, distroseries, summary, changes, | 237 | def assemble_body(blamer, spr, archive, distroseries, summary, changes, |
186 | 237 | action, announce_list): | 238 | action): |
187 | 238 | """Assemble the e-mail notification body.""" | 239 | """Assemble the e-mail notification body.""" |
188 | 239 | information = { | 240 | information = { |
189 | 240 | 'STATUS': ACTION_DESCRIPTIONS[action], | 241 | 'STATUS': ACTION_DESCRIPTIONS[action], |
190 | @@ -262,8 +263,9 @@ | |||
191 | 262 | if action == 'unapproved': | 263 | if action == 'unapproved': |
192 | 263 | information['SUMMARY'] += ( | 264 | information['SUMMARY'] += ( |
193 | 264 | "\nThis upload awaits approval by a distro manager\n") | 265 | "\nThis upload awaits approval by a distro manager\n") |
196 | 265 | if announce_list: | 266 | if distroseries.changeslist: |
197 | 266 | information['ANNOUNCE'] = "Announcing to %s" % announce_list | 267 | information['ANNOUNCE'] = "Announcing to %s" % ( |
198 | 268 | distroseries.changeslist) | ||
199 | 267 | if blamer is not None: | 269 | if blamer is not None: |
200 | 268 | signer_signature = '%s <%s>' % ( | 270 | signer_signature = '%s <%s>' % ( |
201 | 269 | blamer.displayname, blamer.preferredemail.email) | 271 | blamer.displayname, blamer.preferredemail.email) |
202 | 270 | 272 | ||
203 | === modified file 'lib/lp/soyuz/browser/queue.py' | |||
204 | --- lib/lp/soyuz/browser/queue.py 2010-08-25 11:00:07 +0000 | |||
205 | +++ lib/lp/soyuz/browser/queue.py 2011-06-02 09:53:33 +0000 | |||
206 | @@ -400,7 +400,7 @@ | |||
207 | 400 | 400 | ||
208 | 401 | def queue_action_accept(self, queue_item): | 401 | def queue_action_accept(self, queue_item): |
209 | 402 | """Reject the queue item passed.""" | 402 | """Reject the queue item passed.""" |
211 | 403 | queue_item.acceptFromQueue(announce_list=self.context.changeslist) | 403 | queue_item.acceptFromQueue() |
212 | 404 | 404 | ||
213 | 405 | def queue_action_reject(self, queue_item): | 405 | def queue_action_reject(self, queue_item): |
214 | 406 | """Accept the queue item passed.""" | 406 | """Accept the queue item passed.""" |
215 | 407 | 407 | ||
216 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue-notify.txt' | |||
217 | --- lib/lp/soyuz/doc/distroseriesqueue-notify.txt 2011-05-27 06:17:14 +0000 | |||
218 | +++ lib/lp/soyuz/doc/distroseriesqueue-notify.txt 2011-06-02 09:53:33 +0000 | |||
219 | @@ -43,7 +43,6 @@ | |||
220 | 43 | >>> changes_file = open(changes_file_path,'r') | 43 | >>> changes_file = open(changes_file_path,'r') |
221 | 44 | >>> from lp.services.log.logger import FakeLogger | 44 | >>> from lp.services.log.logger import FakeLogger |
222 | 45 | >>> netapplet_upload.notify( | 45 | >>> netapplet_upload.notify( |
223 | 46 | ... announce_list="announcelist@canonical.com", | ||
224 | 47 | ... changes_file_object=changes_file, logger=FakeLogger()) | 46 | ... changes_file_object=changes_file, logger=FakeLogger()) |
225 | 48 | DEBUG Building recipients list. | 47 | DEBUG Building recipients list. |
226 | 49 | DEBUG Changes file is unsigned, adding changer as recipient | 48 | DEBUG Changes file is unsigned, adding changer as recipient |
227 | @@ -116,7 +115,6 @@ | |||
228 | 116 | >>> changes_file = open(changes_file_path,'r') | 115 | >>> changes_file = open(changes_file_path,'r') |
229 | 117 | >>> netapplet_upload.setAccepted() | 116 | >>> netapplet_upload.setAccepted() |
230 | 118 | >>> netapplet_upload.notify( | 117 | >>> netapplet_upload.notify( |
231 | 119 | ... announce_list="announcelist@canonical.com", | ||
232 | 120 | ... changes_file_object=changes_file, logger=FakeLogger()) | 118 | ... changes_file_object=changes_file, logger=FakeLogger()) |
233 | 121 | DEBUG Building recipients list. | 119 | DEBUG Building recipients list. |
234 | 122 | ... | 120 | ... |
235 | @@ -124,7 +122,7 @@ | |||
236 | 124 | ... | 122 | ... |
237 | 125 | DEBUG Recipients: Foo Bar <foo.bar@canonical.com>, Daniel Silverstone <daniel.silverstone@canonical.com> | 123 | DEBUG Recipients: Foo Bar <foo.bar@canonical.com>, Daniel Silverstone <daniel.silverstone@canonical.com> |
238 | 126 | ... | 124 | ... |
240 | 127 | DEBUG Announcing to announcelist@canonical.com | 125 | DEBUG Announcing to autotest_changes@ubuntu.com |
241 | 128 | ... | 126 | ... |
242 | 129 | DEBUG Sent a mail: | 127 | DEBUG Sent a mail: |
243 | 130 | ... | 128 | ... |
244 | @@ -137,10 +135,10 @@ | |||
245 | 137 | 2 | 135 | 2 |
246 | 138 | 136 | ||
247 | 139 | The mail 'To:' addresses contain the signer and the changer's email. The | 137 | The mail 'To:' addresses contain the signer and the changer's email. The |
249 | 140 | announcement email contains the argument specified for "announce_list". | 138 | announcement email contains the serieses changeslist. |
250 | 141 | 139 | ||
251 | 142 | >>> [msg['To'] for msg in msgs] | 140 | >>> [msg['To'] for msg in msgs] |
253 | 143 | ['Foo Bar <foo.bar@canonical.com>,\n\tDaniel Silverstone <daniel.silverstone@canonical.com>', 'announcelist@canonical.com'] | 141 | ['Foo Bar <foo.bar@canonical.com>,\n\tDaniel Silverstone <daniel.silverstone@canonical.com>', 'autotest_changes@ubuntu.com'] |
254 | 144 | 142 | ||
255 | 145 | The mail 'Bcc:' address is the uploader. The announcement has the uploader | 143 | The mail 'Bcc:' address is the uploader. The announcement has the uploader |
256 | 146 | and the Debian derivatives address for the package uploaded. | 144 | and the Debian derivatives address for the package uploaded. |
257 | @@ -185,8 +183,7 @@ | |||
258 | 185 | >>> fillLibrarianFile(1, content=changes_file.read()) | 183 | >>> fillLibrarianFile(1, content=changes_file.read()) |
259 | 186 | >>> changes_file.close() | 184 | >>> changes_file.close() |
260 | 187 | >>> netapplet_upload.setNew() | 185 | >>> netapplet_upload.setNew() |
263 | 188 | >>> netapplet_upload.notify(announce_list="announcelist@canonical.com", | 186 | >>> netapplet_upload.notify(logger=FakeLogger()) |
262 | 189 | ... logger=FakeLogger()) | ||
264 | 190 | DEBUG Building recipients list. | 187 | DEBUG Building recipients list. |
265 | 191 | ... | 188 | ... |
266 | 192 | DEBUG Sent a mail: | 189 | DEBUG Sent a mail: |
267 | 193 | 190 | ||
268 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt' | |||
269 | --- lib/lp/soyuz/doc/distroseriesqueue.txt 2011-01-17 21:51:09 +0000 | |||
270 | +++ lib/lp/soyuz/doc/distroseriesqueue.txt 2011-06-02 09:53:33 +0000 | |||
271 | @@ -982,7 +982,7 @@ | |||
272 | 982 | >>> insertFakeChangesFile(items[1].changesfile.id) | 982 | >>> insertFakeChangesFile(items[1].changesfile.id) |
273 | 983 | >>> insertFakeChangesFile(items[3].changesfile.id) | 983 | >>> insertFakeChangesFile(items[3].changesfile.id) |
274 | 984 | >>> try: | 984 | >>> try: |
276 | 985 | ... items[1].acceptFromQueue('announce@example.com') | 985 | ... items[1].acceptFromQueue() |
277 | 986 | ... except QueueInconsistentStateError, e: | 986 | ... except QueueInconsistentStateError, e: |
278 | 987 | ... print 'FAILED' | 987 | ... print 'FAILED' |
279 | 988 | ... else: | 988 | ... else: |
280 | 989 | 989 | ||
281 | === modified file 'lib/lp/soyuz/interfaces/queue.py' | |||
282 | --- lib/lp/soyuz/interfaces/queue.py 2011-05-25 08:16:52 +0000 | |||
283 | +++ lib/lp/soyuz/interfaces/queue.py 2011-06-02 09:53:33 +0000 | |||
284 | @@ -238,7 +238,7 @@ | |||
285 | 238 | has no sources associated to it. | 238 | has no sources associated to it. |
286 | 239 | """ | 239 | """ |
287 | 240 | 240 | ||
289 | 241 | def acceptFromQueue(announce_list, logger=None, dry_run=False): | 241 | def acceptFromQueue(logger=None, dry_run=False): |
290 | 242 | """Call setAccepted, do a syncUpdate, and send notification email. | 242 | """Call setAccepted, do a syncUpdate, and send notification email. |
291 | 243 | 243 | ||
292 | 244 | * Grant karma to people involved with the upload. | 244 | * Grant karma to people involved with the upload. |
293 | @@ -280,15 +280,12 @@ | |||
294 | 280 | committed to have some updates actually written to the database. | 280 | committed to have some updates actually written to the database. |
295 | 281 | """ | 281 | """ |
296 | 282 | 282 | ||
299 | 283 | def notify(announce_list=None, summary_text=None, | 283 | def notify(summary_text=None, changes_file_object=None, logger=None): |
298 | 284 | changes_file_object=None, logger=None): | ||
300 | 285 | """Notify by email when there is a new distroseriesqueue entry. | 284 | """Notify by email when there is a new distroseriesqueue entry. |
301 | 286 | 285 | ||
302 | 287 | This will send new, accept, announce and rejection messages as | 286 | This will send new, accept, announce and rejection messages as |
303 | 288 | appropriate. | 287 | appropriate. |
304 | 289 | 288 | ||
305 | 290 | :param announce_list: The email address of the distro announcements | ||
306 | 291 | |||
307 | 292 | :param summary_text: Any additional text to append to the auto- | 289 | :param summary_text: Any additional text to append to the auto- |
308 | 293 | generated summary. This is also the only text used if there is | 290 | generated summary. This is also the only text used if there is |
309 | 294 | a rejection message generated. | 291 | a rejection message generated. |
310 | 295 | 292 | ||
311 | === modified file 'lib/lp/soyuz/model/queue.py' | |||
312 | --- lib/lp/soyuz/model/queue.py 2011-05-27 07:29:08 +0000 | |||
313 | +++ lib/lp/soyuz/model/queue.py 2011-06-02 09:53:33 +0000 | |||
314 | @@ -392,7 +392,7 @@ | |||
315 | 392 | self._closeBugs(changesfile_path, logger) | 392 | self._closeBugs(changesfile_path, logger) |
316 | 393 | self._giveKarma() | 393 | self._giveKarma() |
317 | 394 | 394 | ||
319 | 395 | def acceptFromQueue(self, announce_list, logger=None, dry_run=False): | 395 | def acceptFromQueue(self, logger=None, dry_run=False): |
320 | 396 | """See `IPackageUpload`.""" | 396 | """See `IPackageUpload`.""" |
321 | 397 | assert not self.is_delayed_copy, 'Cannot process delayed copies.' | 397 | assert not self.is_delayed_copy, 'Cannot process delayed copies.' |
322 | 398 | 398 | ||
323 | @@ -402,7 +402,7 @@ | |||
324 | 402 | # is pulled from the librarian which are stripped of their | 402 | # is pulled from the librarian which are stripped of their |
325 | 403 | # signature just before being stored. | 403 | # signature just before being stored. |
326 | 404 | self.notify( | 404 | self.notify( |
328 | 405 | announce_list=announce_list, logger=logger, dry_run=dry_run, | 405 | logger=logger, dry_run=dry_run, |
329 | 406 | changes_file_object=changes_file_object) | 406 | changes_file_object=changes_file_object) |
330 | 407 | self.syncUpdate() | 407 | self.syncUpdate() |
331 | 408 | 408 | ||
332 | @@ -633,7 +633,6 @@ | |||
333 | 633 | changes_file_object = StringIO.StringIO( | 633 | changes_file_object = StringIO.StringIO( |
334 | 634 | changes_file.read()) | 634 | changes_file.read()) |
335 | 635 | self.notify( | 635 | self.notify( |
336 | 636 | announce_list=self.distroseries.changeslist, | ||
337 | 637 | changes_file_object=changes_file_object, | 636 | changes_file_object=changes_file_object, |
338 | 638 | logger=logger) | 637 | logger=logger) |
339 | 639 | self.syncUpdate() | 638 | self.syncUpdate() |
340 | @@ -683,8 +682,8 @@ | |||
341 | 683 | # and uploading to any archive as the signer. | 682 | # and uploading to any archive as the signer. |
342 | 684 | return changes, strip_pgp_signature(changes_content).splitlines(True) | 683 | return changes, strip_pgp_signature(changes_content).splitlines(True) |
343 | 685 | 684 | ||
346 | 686 | def notify(self, announce_list=None, summary_text=None, | 685 | def notify(self, summary_text=None, changes_file_object=None, |
347 | 687 | changes_file_object=None, logger=None, dry_run=False): | 686 | logger=None, dry_run=False): |
348 | 688 | """See `IPackageUpload`.""" | 687 | """See `IPackageUpload`.""" |
349 | 689 | status_action = { | 688 | status_action = { |
350 | 690 | PackageUploadStatus.NEW: 'new', | 689 | PackageUploadStatus.NEW: 'new', |
351 | @@ -704,8 +703,8 @@ | |||
352 | 704 | signer = None | 703 | signer = None |
353 | 705 | notify( | 704 | notify( |
354 | 706 | signer, self.sourcepackagerelease, self.builds, self.customfiles, | 705 | signer, self.sourcepackagerelease, self.builds, self.customfiles, |
357 | 707 | self.archive, self.distroseries, self.pocket, announce_list, | 706 | self.archive, self.distroseries, self.pocket, summary_text, |
358 | 708 | summary_text, changes, changesfile_content, changes_file_object, | 707 | changes, changesfile_content, changes_file_object, |
359 | 709 | status_action[self.status], dry_run, logger) | 708 | status_action[self.status], dry_run, logger) |
360 | 710 | 709 | ||
361 | 711 | def _isPersonUploader(self, person): | 710 | def _isPersonUploader(self, person): |
362 | 712 | 711 | ||
363 | === modified file 'lib/lp/soyuz/scripts/queue.py' | |||
364 | --- lib/lp/soyuz/scripts/queue.py 2010-09-27 20:47:58 +0000 | |||
365 | +++ lib/lp/soyuz/scripts/queue.py 2011-06-02 09:53:33 +0000 | |||
366 | @@ -79,8 +79,7 @@ | |||
367 | 79 | 79 | ||
368 | 80 | def __init__(self, distribution_name, suite_name, queue, terms, | 80 | def __init__(self, distribution_name, suite_name, queue, terms, |
369 | 81 | component_name, section_name, priority_name, | 81 | component_name, section_name, priority_name, |
372 | 82 | announcelist, display, no_mail=True, exact_match=False, | 82 | display, no_mail=True, exact_match=False, log=None): |
371 | 83 | log=None): | ||
373 | 84 | """Initialises passed variables. """ | 83 | """Initialises passed variables. """ |
374 | 85 | self.terms = terms | 84 | self.terms = terms |
375 | 86 | # Some actions have addtional commands at the start of the terms | 85 | # Some actions have addtional commands at the start of the terms |
376 | @@ -94,7 +93,6 @@ | |||
377 | 94 | self.no_mail = no_mail | 93 | self.no_mail = no_mail |
378 | 95 | self.distribution_name = distribution_name | 94 | self.distribution_name = distribution_name |
379 | 96 | self.suite_name = suite_name | 95 | self.suite_name = suite_name |
380 | 97 | self.announcelist = announcelist | ||
381 | 98 | self.default_sender = "%s <%s>" % ( | 96 | self.default_sender = "%s <%s>" % ( |
382 | 99 | config.uploader.default_sender_name, | 97 | config.uploader.default_sender_name, |
383 | 100 | config.uploader.default_sender_address) | 98 | config.uploader.default_sender_address) |
384 | @@ -112,7 +110,7 @@ | |||
385 | 112 | pocket=self.pocket) | 110 | pocket=self.pocket) |
386 | 113 | 111 | ||
387 | 114 | def setDefaultContext(self): | 112 | def setDefaultContext(self): |
389 | 115 | """Set default distribuiton, distroseries, announcelist.""" | 113 | """Set default distribuiton, distroseries.""" |
390 | 116 | # if not found defaults to 'ubuntu' | 114 | # if not found defaults to 'ubuntu' |
391 | 117 | 115 | ||
392 | 118 | # Avoid circular imports. | 116 | # Avoid circular imports. |
393 | @@ -140,9 +138,6 @@ | |||
394 | 140 | self.distroseries = self.distribution.currentseries | 138 | self.distroseries = self.distribution.currentseries |
395 | 141 | self.pocket = PackagePublishingPocket.RELEASE | 139 | self.pocket = PackagePublishingPocket.RELEASE |
396 | 142 | 140 | ||
397 | 143 | if not self.announcelist: | ||
398 | 144 | self.announcelist = self.distroseries.changeslist | ||
399 | 145 | |||
400 | 146 | def initialize(self): | 141 | def initialize(self): |
401 | 147 | """Builds a list of affected records based on the filter argument.""" | 142 | """Builds a list of affected records based on the filter argument.""" |
402 | 148 | self.setDefaultContext() | 143 | self.setDefaultContext() |
403 | @@ -483,8 +478,7 @@ | |||
404 | 483 | self.display('Accepting %s' % queue_item.displayname) | 478 | self.display('Accepting %s' % queue_item.displayname) |
405 | 484 | try: | 479 | try: |
406 | 485 | queue_item.acceptFromQueue( | 480 | queue_item.acceptFromQueue( |
409 | 486 | announce_list=self.announcelist, logger=self.log, | 481 | logger=self.log, dry_run=self.no_mail) |
408 | 487 | dry_run=self.no_mail) | ||
410 | 488 | except QueueInconsistentStateError, info: | 482 | except QueueInconsistentStateError, info: |
411 | 489 | self.display('** %s could not be accepted due to %s' | 483 | self.display('** %s could not be accepted due to %s' |
412 | 490 | % (queue_item.displayname, info)) | 484 | % (queue_item.displayname, info)) |
413 | @@ -522,8 +516,7 @@ | |||
414 | 522 | 516 | ||
415 | 523 | def __init__(self, distribution_name, suite_name, queue, terms, | 517 | def __init__(self, distribution_name, suite_name, queue, terms, |
416 | 524 | component_name, section_name, priority_name, | 518 | component_name, section_name, priority_name, |
419 | 525 | announcelist, display, no_mail=True, exact_match=False, | 519 | display, no_mail=True, exact_match=False, log=None): |
418 | 526 | log=None): | ||
420 | 527 | """Constructor for QueueActionOverride.""" | 520 | """Constructor for QueueActionOverride.""" |
421 | 528 | 521 | ||
422 | 529 | # This exists so that self.terms_start_index can be set as this action | 522 | # This exists so that self.terms_start_index can be set as this action |
423 | @@ -532,8 +525,8 @@ | |||
424 | 532 | # over-ride. | 525 | # over-ride. |
425 | 533 | QueueAction.__init__(self, distribution_name, suite_name, queue, | 526 | QueueAction.__init__(self, distribution_name, suite_name, queue, |
426 | 534 | terms, component_name, section_name, | 527 | terms, component_name, section_name, |
429 | 535 | priority_name, announcelist, display, | 528 | priority_name, display, no_mail=True, |
430 | 536 | no_mail=True, exact_match=False, log=log) | 529 | exact_match=False, log=log) |
431 | 537 | self.terms_start_index = 1 | 530 | self.terms_start_index = 1 |
432 | 538 | self.overrides_performed = 0 | 531 | self.overrides_performed = 0 |
433 | 539 | 532 | ||
434 | @@ -665,12 +658,11 @@ | |||
435 | 665 | """A wrapper for queue_action classes.""" | 658 | """A wrapper for queue_action classes.""" |
436 | 666 | 659 | ||
437 | 667 | def __init__(self, queue, distribution_name, suite_name, | 660 | def __init__(self, queue, distribution_name, suite_name, |
440 | 668 | announcelist, no_mail, component_name, section_name, | 661 | no_mail, component_name, section_name, priority_name, |
441 | 669 | priority_name, display=default_display, log=None): | 662 | display=default_display, log=None): |
442 | 670 | self.queue = queue | 663 | self.queue = queue |
443 | 671 | self.distribution_name = distribution_name | 664 | self.distribution_name = distribution_name |
444 | 672 | self.suite_name = suite_name | 665 | self.suite_name = suite_name |
445 | 673 | self.announcelist = announcelist | ||
446 | 674 | self.no_mail = no_mail | 666 | self.no_mail = no_mail |
447 | 675 | self.component_name = component_name | 667 | self.component_name = component_name |
448 | 676 | self.section_name = section_name | 668 | self.section_name = section_name |
449 | @@ -701,7 +693,6 @@ | |||
450 | 701 | queue_action = queue_action_class( | 693 | queue_action = queue_action_class( |
451 | 702 | distribution_name=self.distribution_name, | 694 | distribution_name=self.distribution_name, |
452 | 703 | suite_name=self.suite_name, | 695 | suite_name=self.suite_name, |
453 | 704 | announcelist=self.announcelist, | ||
454 | 705 | queue=self.queue, | 696 | queue=self.queue, |
455 | 706 | no_mail=self.no_mail, | 697 | no_mail=self.no_mail, |
456 | 707 | display=self.display, | 698 | display=self.display, |
457 | 708 | 699 | ||
458 | === modified file 'lib/lp/soyuz/scripts/tests/test_queue.py' | |||
459 | --- lib/lp/soyuz/scripts/tests/test_queue.py 2011-01-17 21:51:09 +0000 | |||
460 | +++ lib/lp/soyuz/scripts/tests/test_queue.py 2011-06-02 09:53:33 +0000 | |||
461 | @@ -91,10 +91,9 @@ | |||
462 | 91 | self.test_output.append(text) | 91 | self.test_output.append(text) |
463 | 92 | 92 | ||
464 | 93 | def execute_command(self, argument, queue_name='new', no_mail=True, | 93 | def execute_command(self, argument, queue_name='new', no_mail=True, |
469 | 94 | distribution_name='ubuntu',announcelist=None, | 94 | distribution_name='ubuntu', component_name=None, |
470 | 95 | component_name=None, section_name=None, | 95 | section_name=None, priority_name=None, |
471 | 96 | priority_name=None, suite_name='breezy-autotest', | 96 | suite_name='breezy-autotest', quiet=True): |
468 | 97 | quiet=True): | ||
472 | 98 | """Helper method to execute a queue command. | 97 | """Helper method to execute a queue command. |
473 | 99 | 98 | ||
474 | 100 | Initialise output buffer and execute a command according | 99 | Initialise output buffer and execute a command according |
475 | @@ -105,7 +104,7 @@ | |||
476 | 105 | self.test_output = [] | 104 | self.test_output = [] |
477 | 106 | queue = name_queue_map[queue_name] | 105 | queue = name_queue_map[queue_name] |
478 | 107 | runner = CommandRunner( | 106 | runner = CommandRunner( |
480 | 108 | queue, distribution_name, suite_name, announcelist, no_mail, | 107 | queue, distribution_name, suite_name, no_mail, |
481 | 109 | component_name, section_name, priority_name, | 108 | component_name, section_name, priority_name, |
482 | 110 | display=self._test_display) | 109 | display=self._test_display) |
483 | 111 | 110 | ||
484 | 112 | 111 | ||
485 | === modified file 'lib/lp/soyuz/tests/test_packageupload.py' | |||
486 | --- lib/lp/soyuz/tests/test_packageupload.py 2011-05-25 07:09:27 +0000 | |||
487 | +++ lib/lp/soyuz/tests/test_packageupload.py 2011-06-02 09:53:33 +0000 | |||
488 | @@ -63,8 +63,7 @@ | |||
489 | 63 | delayed_copy = self.createEmptyDelayedCopy() | 63 | delayed_copy = self.createEmptyDelayedCopy() |
490 | 64 | self.assertRaisesWithContent( | 64 | self.assertRaisesWithContent( |
491 | 65 | AssertionError, | 65 | AssertionError, |
494 | 66 | 'Cannot process delayed copies.', | 66 | 'Cannot process delayed copies.', delayed_copy.acceptFromQueue) |
493 | 67 | delayed_copy.acceptFromQueue, 'some-announce-list') | ||
495 | 68 | 67 | ||
496 | 69 | def test_acceptFromCopy_refuses_empty_copies(self): | 68 | def test_acceptFromCopy_refuses_empty_copies(self): |
497 | 70 | # Empty delayed-copies cannot be accepted. | 69 | # Empty delayed-copies cannot be accepted. |
498 | 71 | 70 | ||
499 | === modified file 'scripts/ftpmaster-tools/queue' | |||
500 | --- scripts/ftpmaster-tools/queue 2010-04-27 19:48:39 +0000 | |||
501 | +++ scripts/ftpmaster-tools/queue 2011-06-02 09:53:33 +0000 | |||
502 | @@ -59,12 +59,6 @@ | |||
503 | 59 | default=False, | 59 | default=False, |
504 | 60 | help="Ignore errors when performing a list of commands.") | 60 | help="Ignore errors when performing a list of commands.") |
505 | 61 | 61 | ||
506 | 62 | parser.add_option("-A", "--announcelist", | ||
507 | 63 | dest="announcelist", metavar="ANNOUNCELIST", | ||
508 | 64 | default=None, | ||
509 | 65 | help=("Overrides the announcement list for accepts, " | ||
510 | 66 | "defaults to the distribution 'changeslist'")) | ||
511 | 67 | |||
512 | 68 | parser.add_option("-f", "--file", metavar="FILE", default=None, | 62 | parser.add_option("-f", "--file", metavar="FILE", default=None, |
513 | 69 | help="file containing a sequence of command lines.") | 63 | help="file containing a sequence of command lines.") |
514 | 70 | 64 | ||
515 | @@ -98,8 +92,8 @@ | |||
516 | 98 | 92 | ||
517 | 99 | cmd_runner = CommandRunner( | 93 | cmd_runner = CommandRunner( |
518 | 100 | queue, options.distribution_name, options.suite_name, | 94 | queue, options.distribution_name, options.suite_name, |
521 | 101 | options.announcelist, no_mail, options.component_name, | 95 | no_mail, options.component_name, options.section_name, |
522 | 102 | options.section_name, options.priority_name, log=log) | 96 | options.priority_name, log=log) |
523 | 103 | 97 | ||
524 | 104 | print ("Initialising connection to queue %s" % options.queue_name) | 98 | print ("Initialising connection to queue %s" % options.queue_name) |
525 | 105 | 99 |
133 + if (action == 'accepted' and distroseries. changeslist and ngPocket. BACKPORTS ngPocket. SECURITY and spr is None) sync_upload( 'Changed- By'])):
134 + not archive.is_ppa and pocket != PackagePublishi
135 + and not (pocket == PackagePublishi
136 + and not is_auto_
137 + spr, bprs, pocket, changes[
The ands were consistently at the end of each line. Either is OK, but not both at once please.