Merge lp:~salgado/launchpad/drop-mixed-uploads into lp:launchpad
- drop-mixed-uploads
- Merge into devel
Proposed by
Guilherme Salgado
Status: | Merged |
---|---|
Merged at revision: | 11412 |
Proposed branch: | lp:~salgado/launchpad/drop-mixed-uploads |
Merge into: | lp:launchpad |
Diff against target: |
820 lines (+247/-210) 10 files modified
lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only (+58/-0) lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned (+1/-3) lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes (+59/-0) lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes (+1/-4) lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+1/-66) lib/lp/archiveuploader/tests/nascentupload.txt (+41/-58) lib/lp/archiveuploader/tests/nascentuploadfile.txt (+78/-71) lib/lp/archiveuploader/tests/test_nascentupload_documentation.py (+0/-1) lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt (+6/-1) lib/lp/soyuz/doc/distroseriesqueue.txt (+2/-6) |
To merge this branch: | bzr merge lp:~salgado/launchpad/drop-mixed-uploads |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+33210@code.launchpad.net |
Commit message
Description of the change
Change a bunch of tests that were doing mixed (source+binary) uploads to not
do so as soyuz should no longer accept them.
This is in preparation for the changes I'll do to make soyuz not accept mixed
uploads.
To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only' |
2 | --- lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only 1970-01-01 00:00:00 +0000 |
3 | +++ lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.binary-only 2010-08-20 13:31:08 +0000 |
4 | @@ -0,0 +1,58 @@ |
5 | +-----BEGIN PGP SIGNED MESSAGE----- |
6 | +Hash: SHA1 |
7 | + |
8 | +Format: 1.7 |
9 | +Date: Wed, 2 Apr 2003 17:19:47 +0100 |
10 | +Source: ed |
11 | +Binary: ed |
12 | +Architecture: i386 |
13 | +Version: 0.2-20 |
14 | +Distribution: unstable |
15 | +Urgency: low |
16 | +Maintainer: James Troup <james@nocrew.org> |
17 | +Changed-By: James Troup <james@nocrew.org> |
18 | +Description: |
19 | + ed - The classic unix line editor |
20 | +Closes: 122517 130327 179957 |
21 | +Changes: |
22 | + ed (0.2-20) unstable; urgency=low |
23 | + . |
24 | + * Move to dpatch; existing non-debian/ changes split into |
25 | + 01_buf.c-tmpfile, 02_-Wall-cleanup, 03_ed.1-cleanup and |
26 | + 04_Makfile.in-no-libed. |
27 | + * debian/rules: include /usr/share/dpatch/dpatch.make. |
28 | + * debian/rules (build): depend on patch-stamp. |
29 | + * debian/rules (clean): depend on unpatch. Remove debian/patched. |
30 | + * debian/rules (.PHONY): add 'patch' and 'unpatch'. |
31 | + * debian/control (Build-Depends): add dpatch. |
32 | + . |
33 | + * debian/rules: update copyright. |
34 | + * debian/copyright: likewise and update upstream URL. |
35 | + * debian/changelog: remove local-variables stuff. |
36 | + . |
37 | + * debian/rules: use install_foo convenience variables. |
38 | + * debian/rules (clean): remove *~ in any subdirectory. |
39 | + . |
40 | + * debian/control (Standards-Version): bump to 3.5.8.0. |
41 | + * debian/postinst, debian/prerm: no longer do /usr/doc symlinks. |
42 | + . |
43 | + * config, test/*: unused aegis cruft; removed. |
44 | + * Undo s/%/$/ change in RCS keywords. |
45 | + . |
46 | + * debian/postinst: provide editor.1.gz alternative; thanks to Ben Harris |
47 | + <bjh21@cam.ac.uk> for the suggestion. Closes: #122517 |
48 | + * 05_ed.1-warning-fix.dpatch: new patch to avoid groff warnings. Thanks |
49 | + to Colin Watson <cjwatson@debian.org>. Closes: #179957 |
50 | + * 06_testsuite-Makefile.dpatch: new patch to ensure the test suite bombs |
51 | + out on errors. Thanks to Joel Baker <fenton@debian.org>. |
52 | + Closes: #130327 |
53 | +Files: |
54 | + 379bf8c1d4fd2244d31851e15ee14ae0 46792 editors important ed_0.2-20_i386.deb |
55 | + |
56 | +-----BEGIN PGP SIGNATURE----- |
57 | +Version: GnuPG v1.4.10 (GNU/Linux) |
58 | + |
59 | +iEYEARECAAYFAkxtm0cACgkQDjSYZ10UdUfw1ACfUl2/eg6Iq3nBqQYnSd8c+w1+ |
60 | +2LMAoIcLJiv3Rl8P9+ezamw8pNN8IOF3 |
61 | +=guXd |
62 | +-----END PGP SIGNATURE----- |
63 | |
64 | === modified file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned' |
65 | --- lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned 2008-01-03 14:45:18 +0000 |
66 | +++ lib/lp/archiveuploader/tests/data/ed_0.2-20_i386.changes.mismatched-arch-unsigned 2010-08-20 13:31:08 +0000 |
67 | @@ -2,7 +2,7 @@ |
68 | Date: Wed, 2 Apr 2003 17:19:47 +0100 |
69 | Source: ed |
70 | Binary: ed |
71 | -Architecture: source amd64 |
72 | +Architecture: amd64 |
73 | Version: 0.2-20 |
74 | Distribution: unstable |
75 | Urgency: low |
76 | @@ -44,7 +44,5 @@ |
77 | out on errors. Thanks to Joel Baker <fenton@debian.org>. |
78 | Closes: #130327 |
79 | Files: |
80 | - de8b206f8fc57bd931f6226feac6644a 578 editors important ed_0.2-20.dsc |
81 | - 8343836094fb01ee9b9a1067b23365f1 8600 editors important ed_0.2-20.diff.gz |
82 | 379bf8c1d4fd2244d31851e15ee14ae0 46792 editors important ed_0.2-20_i386.deb |
83 | |
84 | |
85 | === added file 'lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes' |
86 | --- lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes 1970-01-01 00:00:00 +0000 |
87 | +++ lib/lp/archiveuploader/tests/data/ed_0.2-20_source.changes 2010-08-20 13:31:08 +0000 |
88 | @@ -0,0 +1,59 @@ |
89 | +-----BEGIN PGP SIGNED MESSAGE----- |
90 | +Hash: SHA1 |
91 | + |
92 | +Format: 1.7 |
93 | +Date: Wed, 2 Apr 2003 17:19:47 +0100 |
94 | +Source: ed |
95 | +Binary: ed |
96 | +Architecture: source |
97 | +Version: 0.2-20 |
98 | +Distribution: unstable |
99 | +Urgency: low |
100 | +Maintainer: James Troup <james@nocrew.org> |
101 | +Changed-By: James Troup <james@nocrew.org> |
102 | +Description: |
103 | + ed - The classic unix line editor |
104 | +Closes: 122517 130327 179957 |
105 | +Changes: |
106 | + ed (0.2-20) unstable; urgency=low |
107 | + . |
108 | + * Move to dpatch; existing non-debian/ changes split into |
109 | + 01_buf.c-tmpfile, 02_-Wall-cleanup, 03_ed.1-cleanup and |
110 | + 04_Makfile.in-no-libed. |
111 | + * debian/rules: include /usr/share/dpatch/dpatch.make. |
112 | + * debian/rules (build): depend on patch-stamp. |
113 | + * debian/rules (clean): depend on unpatch. Remove debian/patched. |
114 | + * debian/rules (.PHONY): add 'patch' and 'unpatch'. |
115 | + * debian/control (Build-Depends): add dpatch. |
116 | + . |
117 | + * debian/rules: update copyright. |
118 | + * debian/copyright: likewise and update upstream URL. |
119 | + * debian/changelog: remove local-variables stuff. |
120 | + . |
121 | + * debian/rules: use install_foo convenience variables. |
122 | + * debian/rules (clean): remove *~ in any subdirectory. |
123 | + . |
124 | + * debian/control (Standards-Version): bump to 3.5.8.0. |
125 | + * debian/postinst, debian/prerm: no longer do /usr/doc symlinks. |
126 | + . |
127 | + * config, test/*: unused aegis cruft; removed. |
128 | + * Undo s/%/$/ change in RCS keywords. |
129 | + . |
130 | + * debian/postinst: provide editor.1.gz alternative; thanks to Ben Harris |
131 | + <bjh21@cam.ac.uk> for the suggestion. Closes: #122517 |
132 | + * 05_ed.1-warning-fix.dpatch: new patch to avoid groff warnings. Thanks |
133 | + to Colin Watson <cjwatson@debian.org>. Closes: #179957 |
134 | + * 06_testsuite-Makefile.dpatch: new patch to ensure the test suite bombs |
135 | + out on errors. Thanks to Joel Baker <fenton@debian.org>. |
136 | + Closes: #130327 |
137 | +Files: |
138 | + de8b206f8fc57bd931f6226feac6644a 578 editors important ed_0.2-20.dsc |
139 | + 8343836094fb01ee9b9a1067b23365f1 8600 editors important ed_0.2-20.diff.gz |
140 | + ddd57463774cae9b50e70cd51221281b 185913 editors important ed_0.2.orig.tar.gz |
141 | +-----BEGIN PGP SIGNATURE----- |
142 | +Version: GnuPG v1.4.10 (GNU/Linux) |
143 | + |
144 | +iEYEARECAAYFAkxtmZUACgkQDjSYZ10UdUd0TwCeOumev3Nbm4G8z1yTefKt3Oo/ |
145 | +IYQAoNL0W0/vEew0hIqf5nlxcs0e5KOC |
146 | +=RzNg |
147 | +-----END PGP SIGNATURE----- |
148 | |
149 | === modified file 'lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes' |
150 | --- lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes 2008-07-11 11:25:59 +0000 |
151 | +++ lib/lp/archiveuploader/tests/data/suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes 2010-08-20 13:31:08 +0000 |
152 | @@ -2,7 +2,7 @@ |
153 | Date: Thu, 16 Feb 2006 15:47:28 +0000 |
154 | Source: foo |
155 | Binary: foo foo-dev |
156 | -Architecture: source i386 |
157 | +Architecture: i386 |
158 | Version: 1.0-2 |
159 | Distribution: breezy |
160 | Urgency: low |
161 | @@ -16,8 +16,5 @@ |
162 | . |
163 | * A version rev for joy's sake |
164 | Files: |
165 | - 74c1de307d849dc54bd390ab6ae7188f 284 devel optional foo_1.0-2.dsc |
166 | - 0982759bd29072e993c4e375769f6ff7 601 devel optional foo_1.0-2.diff.gz |
167 | 15aaae6676d3d546d6ba69cf7d272875 642 devel optional foo_1.0-2_i386.deb |
168 | 0afcb7d8a6ec16b954ee340fcdaf7644 652 devel optional foo-dev_1.0-2_i386.deb |
169 | - 4a7a1ab59ed8f9f1021825ba4b7ea826 160 devel optional foo_1.0.orig.tar.gz |
170 | |
171 | === modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt' |
172 | --- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-08-04 00:16:44 +0000 |
173 | +++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-08-20 13:31:08 +0000 |
174 | @@ -834,71 +834,6 @@ |
175 | >>> notification['Subject'] |
176 | '[ubuntu/hoary-security] bar 1.0-2 (Accepted)' |
177 | |
178 | - |
179 | -A mixed mode upload to the SECURITY pocket via the 'security' policy |
180 | -will generate a notification to the uploader and an announcement to |
181 | -the distroseries changes list. |
182 | - |
183 | -First, upload and accept foo_1.0-1_mixed to make 'foo' source |
184 | -and binary known in hoary, then our operations in post-release |
185 | -pockets can work: |
186 | - |
187 | - >>> hoary.status = SeriesStatus.DEVELOPMENT |
188 | - >>> modified_sync_policy = getPolicy( |
189 | - ... name='sync', distro='ubuntu', distroseries='hoary') |
190 | - >>> modified_sync_policy.can_upload_mixed = True |
191 | - >>> modified_sync_policy.can_upload_binaries = True |
192 | - >>> modified_sync_policy.can_upload_source = True |
193 | - >>> foo_v1 = NascentUpload.from_changesfile_path( |
194 | - ... datadir('suite/foo_1.0-1_mixed/foo_1.0-1_i386.changes'), |
195 | - ... modified_sync_policy, mock_logger_quiet) |
196 | - >>> foo_v1.process() |
197 | - >>> result = foo_v1.do_accept() |
198 | - >>> foo_v1.queue_root.setAccepted() |
199 | - >>> pub_records = foo_v1.queue_root.realiseUpload() |
200 | - >>> hoary.status = SeriesStatus.CURRENT |
201 | - |
202 | -Get rid of any emails generated: |
203 | - |
204 | - >>> msgs = pop_notifications() |
205 | - |
206 | -Now we can upload a security fix: |
207 | - |
208 | - >>> security_policy = getPolicy( |
209 | - ... name='security', distro='ubuntu', distroseries=None) |
210 | - >>> security_policy.setDistroSeriesAndPocket('hoary-security') |
211 | - >>> foo_mixed = NascentUpload.from_changesfile_path( |
212 | - ... datadir('suite/foo_1.0-2.1/foo_1.0-2.1_source.changes'), |
213 | - ... security_policy, mock_logger_quiet) |
214 | - >>> foo_mixed.process() |
215 | - >>> foo_mixed.logger = mock_logger |
216 | - >>> result = foo_mixed.do_accept() |
217 | - DEBUG: Creating queue entry |
218 | - ... |
219 | - |
220 | -Two emails generated: |
221 | - |
222 | - >>> msgs = pop_notifications(sort_key=operator.itemgetter('To')) |
223 | - >>> len(msgs) |
224 | - 2 |
225 | - |
226 | - >>> [message['To'] for message in msgs] |
227 | - ['Daniel Silverstone <daniel.silverstone@canonical.com>', |
228 | - 'hoary-announce@lists.ubuntu.com'] |
229 | - |
230 | - >>> [message['Subject'] for message in msgs] |
231 | - ['[ubuntu/hoary-security] foo 1.0-2.1 (Accepted)', |
232 | - '[ubuntu/hoary-security] foo 1.0-2.1 (Accepted)'] |
233 | - |
234 | - >>> [message['X-Katie'] for message in msgs] |
235 | - ['Launchpad actually', 'Launchpad actually'] |
236 | - |
237 | -Remove orig.tar.gz pumped from librarian to disk during the upload |
238 | -checks: |
239 | - |
240 | - >>> os.remove(os.path.join(datadir('suite/foo_1.0-2.1'), |
241 | - ... 'foo_1.0.orig.tar.gz')) |
242 | - |
243 | Dry run uploads should not generate any emails. Call do_accept with |
244 | notify=False: |
245 | |
246 | @@ -933,7 +868,7 @@ |
247 | dry_run, which when True will not send any emails. It will also log at |
248 | the INFO level what it /would/ have sent. |
249 | |
250 | - >>> random_package_upload = hoary.getQueueItems()[2] |
251 | + >>> random_package_upload = hoary.getQueueItems()[0] |
252 | >>> random_package_upload.notify(dry_run=True, logger=mock_logger) |
253 | DEBUG: Building recipients list. |
254 | ... |
255 | |
256 | === modified file 'lib/lp/archiveuploader/tests/nascentupload.txt' |
257 | --- lib/lp/archiveuploader/tests/nascentupload.txt 2010-08-05 10:27:01 +0000 |
258 | +++ lib/lp/archiveuploader/tests/nascentupload.txt 2010-08-20 13:31:08 +0000 |
259 | @@ -213,13 +213,10 @@ |
260 | files specified. For instance, the changesfile Architecture list line |
261 | should match the files target architectures: |
262 | |
263 | -XXX cprov 20070404: we need to a policy that accepts unsigned |
264 | -changesfiles and binary, source and mixed uploads ... |
265 | - |
266 | + # Use the buildd policy as it accepts unsigned changes files and binary |
267 | + # uploads. |
268 | >>> modified_buildd_policy = getPolicy( |
269 | ... name='buildd', distro='ubuntu', distroseries='hoary', buildid=1) |
270 | - >>> modified_buildd_policy.can_upload_source = True |
271 | - >>> modified_buildd_policy.can_upload_mixed = True |
272 | |
273 | >>> ed_mismatched_upload = NascentUpload.from_changesfile_path( |
274 | ... datadir("ed_0.2-20_i386.changes.mismatched-arch-unsigned"), |
275 | @@ -229,84 +226,70 @@ |
276 | |
277 | >>> for f in ed_mismatched_upload.changes.files: |
278 | ... print f.filename, f |
279 | - ed_0.2-20.dsc <...DSCFile...> |
280 | - ed_0.2-20.diff.gz <...SourceUploadFile...> |
281 | ed_0.2-20_i386.deb <...DebBinaryUploadFile...> |
282 | |
283 | >>> [a for a in ed_mismatched_upload.changes.architectures] |
284 | - ['source', 'amd64'] |
285 | + ['amd64'] |
286 | |
287 | -Since the changesfile specify that only 'source' (pseudo-architecture |
288 | -to represent source in debian format) and 'amd64' will be used and |
289 | +Since the changesfile specify that only 'amd64' will be used and |
290 | there is a file that depends on 'i386' the upload is rejected: |
291 | |
292 | >>> print ed_mismatched_upload.rejection_message |
293 | ed_0.2-20_i386.deb: control file lists arch as 'i386' which isn't in the changes file. |
294 | |
295 | |
296 | -=== Mixed Uploads === |
297 | - |
298 | -Uploads can also contain sources and binaries together and we call it |
299 | -'mixed' mode. This feature is specially useful for uploading security |
300 | -fixed into ubuntu since they are assembled and built in a external |
301 | -system. |
302 | - |
303 | -XXX cprov 20070404: we need a policy that accepts mixed uploads to |
304 | -RELEASE pocket ... |
305 | - |
306 | - >>> modified_insecure_policy = getPolicy( |
307 | +=== Uploads missing ORIG files === |
308 | + |
309 | +Uploads don't need to include the ORIG files when they're known to be in the |
310 | +archive already. |
311 | + |
312 | + >>> insecure_policy_changed = getPolicy( |
313 | ... name='insecure', distro='ubuntu', distroseries='hoary') |
314 | - >>> modified_insecure_policy.can_upload_binaries = True |
315 | - >>> modified_insecure_policy.can_upload_mixed = True |
316 | - |
317 | - >>> ed_mixed_upload = NascentUpload.from_changesfile_path( |
318 | - ... datadir("ed_0.2-20_i386.changes"), |
319 | - ... modified_insecure_policy, mock_logger_quiet) |
320 | - |
321 | - >>> ed_mixed_upload.process() |
322 | - >>> ed_mixed_upload.is_rejected |
323 | - False |
324 | - |
325 | -The NascentUpload can tell us if it is sourceful or not, (ditto binaryful) |
326 | - |
327 | - >>> ed_mixed_upload.sourceful |
328 | - True |
329 | - >>> ed_mixed_upload.binaryful |
330 | - True |
331 | - |
332 | -Also provide architecture dependent status: |
333 | - |
334 | - >>> ed_mixed_upload.archindep |
335 | - False |
336 | - >>> ed_mixed_upload.archdep |
337 | - True |
338 | - |
339 | -This mixed upload explores another feature in Soyuz, it does not |
340 | -upload the ORIG files assuming it is already published by its |
341 | -ancestries (it saves a lot of bandwidth). So, the upload is not |
342 | -'native', neither 'hasorig': |
343 | - |
344 | - >>> has_native(ed_mixed_upload) |
345 | - False |
346 | - >>> has_orig(ed_mixed_upload) |
347 | + |
348 | + # Copy the .orig so that NascentUpload has access to it, although it |
349 | + # wouldn't have been uploaded in practice because (as you can see below) the |
350 | + # .orig was not included in the .changes file. |
351 | + >>> import shutil |
352 | + >>> shutil.copy(datadir("ed_0.2.orig.tar.gz"), datadir("ed-0.2-21/")) |
353 | + |
354 | + >>> ed_upload = NascentUpload.from_changesfile_path( |
355 | + ... datadir("ed-0.2-21/ed_0.2-21_source.changes"), |
356 | + ... insecure_policy_changed, mock_logger_quiet) |
357 | + |
358 | + >>> ed_upload.process() |
359 | + >>> ed_upload.is_rejected |
360 | + False |
361 | + >>> ed_upload.rejection_message |
362 | + '' |
363 | + |
364 | +As we see here, the ORIG files were not included. |
365 | + |
366 | + >>> has_orig(ed_upload) |
367 | + False |
368 | + |
369 | +And because of that it's not considered native. |
370 | + |
371 | + >>> has_native(ed_upload) |
372 | False |
373 | |
374 | But if we check the DSC we will find the reference to the already |
375 | known ORIG file: |
376 | |
377 | - >>> [f.filename for f in ed_mixed_upload.changes.dsc.files] |
378 | - ['ed_0.2.orig.tar.gz', 'ed_0.2-20.diff.gz'] |
379 | + >>> [f.filename for f in ed_upload.changes.dsc.files] |
380 | + ['ed_0.2.orig.tar.gz', 'ed_0.2-21.diff.gz'] |
381 | |
382 | - >>> success = ed_mixed_upload.do_accept() |
383 | + >>> success = ed_upload.do_accept() |
384 | >>> success |
385 | True |
386 | |
387 | The notification message generated is described in more detail in |
388 | doc/nascentupload-announcements.txt. |
389 | |
390 | -Roll back everything related with ed_mixed_upload: |
391 | +Roll back everything related with ed_upload: |
392 | |
393 | >>> transaction.abort() |
394 | + >>> import os |
395 | + >>> os.remove(datadir("ed-0.2-21/ed_0.2.orig.tar.gz")) |
396 | |
397 | |
398 | == Acceptance Work-flow == |
399 | |
400 | === modified file 'lib/lp/archiveuploader/tests/nascentuploadfile.txt' |
401 | --- lib/lp/archiveuploader/tests/nascentuploadfile.txt 2010-07-24 05:41:31 +0000 |
402 | +++ lib/lp/archiveuploader/tests/nascentuploadfile.txt 2010-08-20 13:31:08 +0000 |
403 | @@ -63,70 +63,77 @@ |
404 | |
405 | >>> modified_insecure_policy = getPolicy( |
406 | ... name='insecure', distro='ubuntu', distroseries='hoary') |
407 | - >>> modified_insecure_policy.can_upload_binaries = True |
408 | - >>> modified_insecure_policy.can_upload_mixed = True |
409 | |
410 | >>> from lp.archiveuploader.changesfile import ChangesFile |
411 | |
412 | - >>> ed_mixed_changes = ChangesFile( |
413 | - ... datadir('ed_0.2-20_i386.changes'), |
414 | + >>> ed_binary_changes = ChangesFile( |
415 | + ... datadir('ed_0.2-20_i386.changes.binary-only'), |
416 | + ... modified_insecure_policy, mock_logger_quiet) |
417 | + |
418 | + >>> ed_source_changes = ChangesFile( |
419 | + ... datadir('ed_0.2-20_source.changes'), |
420 | ... modified_insecure_policy, mock_logger_quiet) |
421 | |
422 | Make sure we are not getting any exceptions due to a malformed changes |
423 | file name. |
424 | |
425 | - >>> len(list(ed_mixed_changes.checkFileName())) |
426 | + >>> len(list(ed_binary_changes.checkFileName())) |
427 | 0 |
428 | |
429 | At this point the changesfile content is already parsed: |
430 | |
431 | - >>> ed_mixed_changes.source |
432 | + >>> ed_binary_changes.source |
433 | 'ed' |
434 | |
435 | - >>> ed_mixed_changes.version |
436 | + >>> ed_binary_changes.version |
437 | '0.2-20' |
438 | |
439 | - >>> ed_mixed_changes.architectures |
440 | - set(['source', 'i386']) |
441 | + >>> ed_binary_changes.architectures |
442 | + set(['i386']) |
443 | |
444 | - >>> ed_mixed_changes.suite_name |
445 | + >>> ed_binary_changes.suite_name |
446 | 'unstable' |
447 | |
448 | Push upload targeted suite into policy before the checks, nomally done |
449 | by NascentUpload object: |
450 | |
451 | >>> modified_insecure_policy.setDistroSeriesAndPocket( |
452 | - ... ed_mixed_changes.suite_name) |
453 | + ... ed_binary_changes.suite_name) |
454 | |
455 | |
456 | Build contained objects, any error during this process will be stored |
457 | in the returned generator. This way all the checks are performed and |
458 | we can deal with the errors later: |
459 | |
460 | - >>> errors = ed_mixed_changes.processFiles() |
461 | + >>> errors = ed_binary_changes.processFiles() |
462 | >>> errors |
463 | <generator ...> |
464 | - >>> len(list(errors)) |
465 | - 0 |
466 | + >>> list(errors) |
467 | + [] |
468 | + |
469 | + >>> list(ed_source_changes.processFiles()) |
470 | + [] |
471 | |
472 | At this point we can inspect the list of files contained in the upload. |
473 | |
474 | - >>> for uploaded_file in ed_mixed_changes.files: |
475 | + >>> for uploaded_file in ed_binary_changes.files: |
476 | ... print uploaded_file.filename |
477 | - ed_0.2-20.dsc |
478 | - ed_0.2-20.diff.gz |
479 | ed_0.2-20_i386.deb |
480 | |
481 | - >>> [f.filename for f in ed_mixed_changes.binary_package_files] |
482 | + >>> [f.filename for f in ed_binary_changes.binary_package_files] |
483 | ['ed_0.2-20_i386.deb'] |
484 | + >>> [f.filename for f in ed_binary_changes.source_package_files] |
485 | + [] |
486 | |
487 | - >>> [f.filename for f in ed_mixed_changes.source_package_files] |
488 | - ['ed_0.2-20.dsc', 'ed_0.2-20.diff.gz'] |
489 | + >>> [f.filename for f in ed_source_changes.binary_package_files] |
490 | + [] |
491 | + >>> [f.filename for f in ed_source_changes.source_package_files] |
492 | + ['ed_0.2-20.dsc', 'ed_0.2-20.diff.gz', 'ed_0.2.orig.tar.gz'] |
493 | |
494 | Similar to what we have in 'processFiles' ChangesFile.verify is also |
495 | a error generator |
496 | |
497 | - >>> errors = ed_mixed_changes.verify() |
498 | + >>> errors = ed_binary_changes.verify() |
499 | >>> len(list(errors)) |
500 | 0 |
501 | |
502 | @@ -135,7 +142,7 @@ |
503 | We first create a misnamed copy of the changes file. |
504 | |
505 | >>> import os, shutil |
506 | - >>> originalp = datadir('ed_0.2-20_i386.changes') |
507 | + >>> originalp = datadir('ed_0.2-20_i386.changes.binary-only') |
508 | >>> copyp = datadir('p-m_0.4.12-2~ppa2.changes') |
509 | >>> shutil.copyfile(originalp, copyp) |
510 | |
511 | @@ -187,19 +194,19 @@ |
512 | sanity, it'll be done later on, this method only checks if the |
513 | section_name startswith 'raw-': |
514 | |
515 | - >>> ed_mixed_changes.isCustom('foo-bar') |
516 | - False |
517 | - >>> ed_mixed_changes.isCustom('drops/foo-bar') |
518 | - False |
519 | - >>> ed_mixed_changes.isCustom('drops/raw-biscuit') |
520 | - True |
521 | - >>> ed_mixed_changes.isCustom('drops/rawbiscuit') |
522 | - False |
523 | - >>> ed_mixed_changes.isCustom('drops/raw-biscuit/something') |
524 | - True |
525 | - >>> ed_mixed_changes.isCustom('main/raw-installer') |
526 | - True |
527 | - >>> ed_mixed_changes.isCustom('main/law-installer') |
528 | + >>> ed_binary_changes.isCustom('foo-bar') |
529 | + False |
530 | + >>> ed_binary_changes.isCustom('drops/foo-bar') |
531 | + False |
532 | + >>> ed_binary_changes.isCustom('drops/raw-biscuit') |
533 | + True |
534 | + >>> ed_binary_changes.isCustom('drops/rawbiscuit') |
535 | + False |
536 | + >>> ed_binary_changes.isCustom('drops/raw-biscuit/something') |
537 | + True |
538 | + >>> ed_binary_changes.isCustom('main/raw-installer') |
539 | + True |
540 | + >>> ed_binary_changes.isCustom('main/law-installer') |
541 | False |
542 | |
543 | See the CustomUploadFile checks below for specific checks on custom |
544 | @@ -305,10 +312,10 @@ |
545 | On ChangesFile objects we can have access to the enhanced address_structure |
546 | corresponding to the RFC-822 mentioned after performing 'processAddress': |
547 | |
548 | - >>> ed_mixed_changes.maintainer is None |
549 | + >>> ed_binary_changes.maintainer is None |
550 | True |
551 | |
552 | - >>> errors = ed_mixed_changes.processAddresses() |
553 | + >>> errors = ed_binary_changes.processAddresses() |
554 | >>> len(list(errors)) |
555 | 0 |
556 | |
557 | @@ -317,15 +324,15 @@ |
558 | The built address_structure contains values that will be used during |
559 | the upload processing: |
560 | |
561 | - >>> ed_mixed_changes.maintainer['rfc822'] |
562 | - 'James Troup <james@nocrew.org>' |
563 | - >>> ed_mixed_changes.maintainer['rfc2047'] |
564 | - 'James Troup <james@nocrew.org>' |
565 | - >>> ed_mixed_changes.maintainer['name'] |
566 | + >>> ed_binary_changes.maintainer['rfc822'] |
567 | + 'James Troup <james@nocrew.org>' |
568 | + >>> ed_binary_changes.maintainer['rfc2047'] |
569 | + 'James Troup <james@nocrew.org>' |
570 | + >>> ed_binary_changes.maintainer['name'] |
571 | 'James Troup' |
572 | - >>> ed_mixed_changes.maintainer['email'] |
573 | + >>> ed_binary_changes.maintainer['email'] |
574 | 'james@nocrew.org' |
575 | - >>> ed_mixed_changes.maintainer['person'] |
576 | + >>> ed_binary_changes.maintainer['person'] |
577 | <Person ...> |
578 | |
579 | |
580 | @@ -338,18 +345,18 @@ |
581 | The ChangesFile signer IPerson, used to checks upload ACL, normally |
582 | know as 'sponsor' or 'mentor': |
583 | |
584 | - >>> ed_mixed_changes.signer.displayname |
585 | + >>> ed_binary_changes.signer.displayname |
586 | u'Foo Bar' |
587 | |
588 | The IGPGKey used to sign this ChangesFile: |
589 | |
590 | - >>> ed_mixed_changes.signingkey.displayname |
591 | - u'1024D/6C64A8C5' |
592 | + >>> ed_binary_changes.signingkey.displayname |
593 | + u'1024D/5D147547' |
594 | |
595 | The IGPGKey fingerprint used to sign this ChangesFile: |
596 | |
597 | - >>> print ed_mixed_changes.fingerprint |
598 | - 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
599 | + >>> print ed_binary_changes.fingerprint |
600 | + FD311613D941C6DE55737D310E3498675D147547 |
601 | |
602 | |
603 | == DSCFile == |
604 | @@ -363,60 +370,60 @@ |
605 | >>> from lp.archiveuploader.dscfile import ( |
606 | ... DSCFile, DSCUploadedFile) |
607 | |
608 | - >>> ed_mixed_dsc = DSCFile( |
609 | + >>> ed_source_dsc = DSCFile( |
610 | ... datadir('ed_0.2-20.dsc'), |
611 | ... 'de8b206f8fc57bd931f6226feac6644a', 578, 'editors', |
612 | - ... 'important', 'ed', '0.2-20', ed_mixed_changes, |
613 | + ... 'important', 'ed', '0.2-20', ed_source_changes, |
614 | ... modified_insecure_policy, mock_logger_quiet) |
615 | |
616 | - >>> ed_mixed_dsc |
617 | + >>> ed_source_dsc |
618 | <lp.archiveuploader.dscfile.DSCFile ...> |
619 | |
620 | So this object is exactly the same than what we already have created |
621 | in the ChangesFile instance. |
622 | |
623 | - >>> ed_mixed_changes.dsc |
624 | + >>> ed_source_changes.dsc |
625 | <lp.archiveuploader.dscfile.DSCFile ...> |
626 | |
627 | The DSCFile also presents a similar behaviour to access its parsed |
628 | contents: |
629 | |
630 | - >>> ed_mixed_dsc.source |
631 | + >>> ed_source_dsc.source |
632 | 'ed' |
633 | - >>> ed_mixed_dsc.version |
634 | + >>> ed_source_dsc.version |
635 | '0.2-20' |
636 | - >>> ed_mixed_dsc.architecture |
637 | + >>> ed_source_dsc.architecture |
638 | 'any' |
639 | - >>> ed_mixed_dsc.binary |
640 | + >>> ed_source_dsc.binary |
641 | 'ed' |
642 | |
643 | The DSC is GPG-signed most of the time, so we can guarantee who was |
644 | the author. The DSCFile class implements the same address parsing |
645 | methods found in ChangesFile: |
646 | |
647 | - >>> ed_mixed_dsc.maintainer['rfc822'] |
648 | + >>> ed_source_dsc.maintainer['rfc822'] |
649 | 'James Troup <james@nocrew.org>' |
650 | |
651 | The DSC signer IPerson: |
652 | |
653 | - >>> ed_mixed_dsc.signer.displayname |
654 | + >>> ed_source_dsc.signer.displayname |
655 | u'Foo Bar' |
656 | |
657 | The IGPGKey used to sign this DSC, which will be stored as the |
658 | ISourcePackageRelease.dscsiginingkey: |
659 | |
660 | - >>> ed_mixed_dsc.signingkey.displayname |
661 | + >>> ed_source_dsc.signingkey.displayname |
662 | u'1024D/6C64A8C5' |
663 | |
664 | The IGPGKey fingerprint used to sign this DSC: |
665 | |
666 | - >>> print ed_mixed_dsc.fingerprint |
667 | + >>> print ed_source_dsc.fingerprint |
668 | 340CA3BB270E2716C9EE0B768E7EB7086C64A8C5 |
669 | |
670 | A DSCFile provides a verification API similiar to what we have in |
671 | ChangesFile itself: |
672 | |
673 | - >>> errors = ed_mixed_dsc.verify() |
674 | + >>> errors = ed_source_dsc.verify() |
675 | >>> errors |
676 | <generator ...> |
677 | >>> len(list(errors)) |
678 | @@ -429,7 +436,7 @@ |
679 | >>> ed_broken_dsc = DSCFile( |
680 | ... datadir('ed_0.2-20.dsc'), |
681 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', 500, 'editors', |
682 | - ... 'important', 'ed', '0.2-20', ed_mixed_changes, |
683 | + ... 'important', 'ed', '0.2-20', ed_source_changes, |
684 | ... modified_insecure_policy, mock_logger_quiet) |
685 | |
686 | >>> errors = ed_broken_dsc.verify() |
687 | @@ -441,7 +448,7 @@ |
688 | >>> ed_broken_dsc = DSCFile( |
689 | ... datadir('ed_0.2-20.dsc'), |
690 | ... 'de8b206f8fc57bd931f6226feac6644a', 500, 'editors', |
691 | - ... 'important', 'ed', '0.2-20', ed_mixed_changes, |
692 | + ... 'important', 'ed', '0.2-20', ed_source_changes, |
693 | ... modified_insecure_policy, mock_logger_quiet) |
694 | |
695 | >>> errors = ed_broken_dsc.verify() |
696 | @@ -453,12 +460,12 @@ |
697 | |
698 | Sub-DSCFiles are DSCUploadedFile objects. |
699 | |
700 | - >>> ed_mixed_dsc.files[0] |
701 | + >>> ed_source_dsc.files[0] |
702 | <lp.archiveuploader.dscfile.DSCUploadedFile ...> |
703 | |
704 | We can also inspect the list of files declared in this DSC: |
705 | |
706 | - >>> for dsc_file in ed_mixed_dsc.files: |
707 | + >>> for dsc_file in ed_source_dsc.files: |
708 | ... print dsc_file.filename |
709 | ed_0.2.orig.tar.gz |
710 | ed_0.2-20.diff.gz |
711 | @@ -490,7 +497,7 @@ |
712 | >>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path, |
713 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', |
714 | ... 15, 'main/editors', 'important', 'foo', '1.2', |
715 | - ... ed_mixed_changes, modified_insecure_policy, |
716 | + ... ed_binary_changes, modified_insecure_policy, |
717 | ... mock_logger_quiet) |
718 | |
719 | Like the other files it can be verified: |
720 | @@ -504,7 +511,7 @@ |
721 | >>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path, |
722 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', |
723 | ... 15, 'main/net', 'important', 'foo', '1.2', |
724 | - ... ed_mixed_changes, modified_insecure_policy, |
725 | + ... ed_binary_changes, modified_insecure_policy, |
726 | ... mock_logger_quiet) |
727 | >>> list(ed_binary_deb.verify()) |
728 | [UploadError('ed_0.2-20_i386.deb control file lists section as |
729 | @@ -515,7 +522,7 @@ |
730 | >>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path, |
731 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', |
732 | ... 15, 'main/editors', 'extra', 'foo', '1.2', |
733 | - ... ed_mixed_changes, modified_insecure_policy, |
734 | + ... ed_binary_changes, modified_insecure_policy, |
735 | ... mock_logger_quiet) |
736 | >>> list(ed_binary_deb.verify()) |
737 | [UploadError('ed_0.2-20_i386.deb control file lists priority as important |
738 | @@ -532,7 +539,7 @@ |
739 | >>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path, |
740 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', |
741 | ... 15, 'main/editors', 'important', 'foo', '1.2', |
742 | - ... ed_mixed_changes, old_only_policy, |
743 | + ... ed_binary_changes, old_only_policy, |
744 | ... mock_logger_quiet) |
745 | >>> list(ed_binary_deb.verifyDebTimestamp()) |
746 | [UploadError('ed_0.2-20_i386.deb: has 26 file(s) with a time stamp too |
747 | @@ -547,7 +554,7 @@ |
748 | >>> ed_binary_deb = DebBinaryUploadFile(ed_deb_path, |
749 | ... 'e31eeb0b6b3b87e1ea79378df864ffff', |
750 | ... 15, 'main/editors', 'important', 'foo', '1.2', |
751 | - ... ed_mixed_changes, new_only_policy, |
752 | + ... ed_binary_changes, new_only_policy, |
753 | ... mock_logger_quiet) |
754 | >>> list(ed_binary_deb.verify()) |
755 | [UploadError('ed_0.2-20_i386.deb: has 26 file(s) with a time stamp too |
756 | |
757 | === modified file 'lib/lp/archiveuploader/tests/test_nascentupload_documentation.py' |
758 | --- lib/lp/archiveuploader/tests/test_nascentupload_documentation.py 2010-08-04 00:16:44 +0000 |
759 | +++ lib/lp/archiveuploader/tests/test_nascentupload_documentation.py 2010-08-20 13:31:08 +0000 |
760 | @@ -42,7 +42,6 @@ |
761 | """Return a NascentUpload object for binaries.""" |
762 | policy = getPolicy(name='sync', distro='ubuntu', distroseries='hoary') |
763 | policy.can_upload_binaries = True |
764 | - policy.can_upload_mixed = True |
765 | return NascentUpload.from_changesfile_path( |
766 | datadir(upload_path), policy, mock_logger_quiet) |
767 | |
768 | |
769 | === modified file 'lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt' |
770 | --- lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt 2010-08-04 00:16:44 +0000 |
771 | +++ lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt 2010-08-20 13:31:08 +0000 |
772 | @@ -247,6 +247,12 @@ |
773 | |
774 | Now that "foo" is published in Hoary, we can upload a new build. |
775 | |
776 | + # First we'll need to create a source publication for the foo-1.0-2, |
777 | + # though, as our upload will only include binaries. |
778 | + >>> foo_source_1_0_2 = stp.getPubSource( |
779 | + ... sourcename="foo", distroseries=hoary, version="1.0-2", |
780 | + ... status=PackagePublishingStatus.PUBLISHED) |
781 | + |
782 | >>> from canonical.launchpad.ftests import import_public_test_keys |
783 | >>> from canonical.launchpad.interfaces import IComponentSet |
784 | >>> from lp.soyuz.model.component import ComponentSelection |
785 | @@ -259,7 +265,6 @@ |
786 | >>> sync_policy = getPolicy(name='sync', distro='ubuntu', |
787 | ... distroseries='hoary') |
788 | >>> sync_policy.can_upload_binaries = True |
789 | - >>> sync_policy.can_upload_mixed = True |
790 | >>> foo_upload = NascentUpload.from_changesfile_path( |
791 | ... datadir('suite/foo_1.0-2_multi_binary/foo_1.0-2_i386.changes'), |
792 | ... sync_policy, mock_logger_quiet) |
793 | |
794 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt' |
795 | --- lib/lp/soyuz/doc/distroseriesqueue.txt 2010-08-04 00:16:44 +0000 |
796 | +++ lib/lp/soyuz/doc/distroseriesqueue.txt 2010-08-20 13:31:08 +0000 |
797 | @@ -65,12 +65,10 @@ |
798 | Construct an upload. |
799 | |
800 | >>> anything_policy = getPolicy( |
801 | - ... name='anything', distro='ubuntu', distroseries='hoary') |
802 | - >>> anything_policy.can_upload_binaries = True |
803 | - >>> anything_policy.can_upload_mixed = True |
804 | + ... name='absolutely-anything', distro='ubuntu', distroseries='hoary') |
805 | |
806 | >>> ed_upload = NascentUpload.from_changesfile_path( |
807 | - ... datadir('ed_0.2-20_i386.changes'), |
808 | + ... datadir("ed_0.2-20_i386.changes.source-only-unsigned"), |
809 | ... anything_policy, mock_logger_quiet) |
810 | |
811 | >>> ed_upload.process() |
812 | @@ -110,8 +108,6 @@ |
813 | ... pub_records = item.realiseUpload(mock_logger) |
814 | ed |
815 | DEBUG: Publishing source ed/0.2-20 to ubuntu/hoary in the primary archive |
816 | - DEBUG: Publishing build to ubuntu/hoary/i386 |
817 | - DEBUG: ... ed/0.2-20 (Arch Specific) |
818 | |
819 | |
820 | Confirm we can now find ed published in hoary. |