Merge lp:~leonardr/launchpad/help-me-gary into lp:launchpad/db-devel
- help-me-gary
- Merge into db-devel
Proposed by
Leonard Richardson
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~leonardr/launchpad/help-me-gary |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
830 lines 19 files modified
Makefile (+1/-4) lib/lp/registry/model/person.py (+3/-8) lib/lp/soyuz/browser/archive.py (+13/-3) lib/lp/soyuz/browser/tests/archive-views.txt (+2/-22) lib/lp/soyuz/doc/archive.txt (+18/-1) lib/lp/soyuz/doc/distroseriesqueue.txt (+2/-23) lib/lp/soyuz/interfaces/archive.py (+17/-2) lib/lp/soyuz/interfaces/publishing.py (+1/-1) lib/lp/soyuz/model/archive.py (+14/-1) lib/lp/soyuz/model/queue.py (+22/-12) lib/lp/soyuz/scripts/tests/test_copypackage.py (+3/-20) lib/lp/soyuz/stories/ppa/xx-copy-packages.txt (+1/-1) lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt (+2/-2) lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt (+46/-30) lib/lp/soyuz/stories/webservice/xx-archive.txt (+4/-19) lib/lp/soyuz/templates/archive-activate.pt (+0/-4) lib/lp/soyuz/tests/test_packageupload.py (+11/-4) lib/lp/soyuz/tests/test_publishing.py (+35/-0) versions.cfg (+4/-1) |
To merge this branch: | bzr merge lp:~leonardr/launchpad/help-me-gary |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster (community) | Approve | ||
Review via email: mp+13245@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote : | # |
Revision history for this message
Gary Poster (gary) wrote : | # |
Looks good.
Thank you,
Gary
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' |
2 | --- Makefile 2009-10-09 15:26:50 +0000 |
3 | +++ Makefile 2009-10-13 12:21:15 +0000 |
4 | @@ -90,10 +90,7 @@ |
5 | @echo |
6 | @echo "Running the JavaScript integration test suite" |
7 | @echo |
8 | - bin/test $(VERBOSITY) --layer=BugsWindmillLayer |
9 | - bin/test $(VERBOSITY) --layer=CodeWindmillLayer |
10 | - bin/test $(VERBOSITY) --layer=RegistryWindmillLayer |
11 | - bin/test $(VERBOSITY) --layer=SoyuzWindmillLayer |
12 | + bin/test $(VERBOSITY) --layer=WindmillLayer |
13 | |
14 | jscheck_functest: build |
15 | # Run the old functest Windmill integration tests. The test runner |
16 | |
17 | === modified file 'lib/lp/registry/model/person.py' |
18 | --- lib/lp/registry/model/person.py 2009-09-30 01:20:39 +0000 |
19 | +++ lib/lp/registry/model/person.py 2009-10-13 12:21:15 +0000 |
20 | @@ -77,7 +77,7 @@ |
21 | from canonical.launchpad.interfaces.account import ( |
22 | AccountCreationRationale, AccountStatus, IAccount, IAccountSet, |
23 | INACTIVE_ACCOUNT_STATUSES) |
24 | -from lp.soyuz.interfaces.archive import ArchivePurpose, NoSuchPPA |
25 | +from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
26 | from lp.soyuz.interfaces.archivepermission import ( |
27 | IArchivePermissionSet) |
28 | from canonical.launchpad.interfaces.authtoken import LoginTokenType |
29 | @@ -2286,8 +2286,7 @@ |
30 | @property |
31 | def archive(self): |
32 | """See `IPerson`.""" |
33 | - return Archive.selectOneBy( |
34 | - owner=self, purpose=ArchivePurpose.PPA, name='ppa') |
35 | + return getUtility(IArchiveSet).getPPAOwnedByPerson(self) |
36 | |
37 | @property |
38 | def ppas(self): |
39 | @@ -2297,11 +2296,7 @@ |
40 | |
41 | def getPPAByName(self, name): |
42 | """See `IPerson`.""" |
43 | - ppa = Archive.selectOneBy( |
44 | - owner=self, purpose=ArchivePurpose.PPA, name=name) |
45 | - if ppa is None: |
46 | - raise NoSuchPPA(name) |
47 | - return ppa |
48 | + return getUtility(IArchiveSet).getPPAOwnedByPerson(self, name) |
49 | |
50 | def isBugContributor(self, user=None): |
51 | """See `IPerson`.""" |
52 | |
53 | === modified file 'lib/lp/soyuz/browser/archive.py' |
54 | --- lib/lp/soyuz/browser/archive.py 2009-10-07 13:39:14 +0000 |
55 | +++ lib/lp/soyuz/browser/archive.py 2009-10-13 12:21:15 +0000 |
56 | @@ -1625,17 +1625,27 @@ |
57 | |
58 | schema = IPPAActivateForm |
59 | custom_widget('description', TextAreaWidget, height=3) |
60 | + label = "Personal Package Archive Activation" |
61 | |
62 | @property |
63 | def ubuntu(self): |
64 | return getUtility(ILaunchpadCelebrities).ubuntu |
65 | |
66 | + @property |
67 | + def initial_values(self): |
68 | + """Set up default values for form fields.""" |
69 | + # Suggest a default value of "ppa" for the name for the |
70 | + # first PPA activation. |
71 | + if self.context.archive is None: |
72 | + return {'name': 'ppa'} |
73 | + return {} |
74 | + |
75 | def setUpFields(self): |
76 | """Override `LaunchpadFormView`. |
77 | |
78 | Reorder the fields in a way the make more sense to users and also |
79 | - omit 'name' and present a checkbox for acknowledging the PPA-ToS |
80 | - if the user is creating his first PPA. |
81 | + present a checkbox for acknowledging the PPA-ToS if the user is |
82 | + creating his first PPA. |
83 | """ |
84 | LaunchpadFormView.setUpFields(self) |
85 | |
86 | @@ -1644,7 +1654,7 @@ |
87 | 'name', 'displayname', 'description') |
88 | else: |
89 | self.form_fields = self.form_fields.select( |
90 | - 'displayname', 'accepted', 'description') |
91 | + 'name', 'displayname', 'accepted', 'description') |
92 | |
93 | def validate(self, data): |
94 | """Ensure user has checked the 'accepted' checkbox.""" |
95 | |
96 | === modified file 'lib/lp/soyuz/browser/tests/archive-views.txt' |
97 | --- lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-07 13:39:14 +0000 |
98 | +++ lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-13 12:21:14 +0000 |
99 | @@ -1284,28 +1284,8 @@ |
100 | >>> hoary = ubuntu.getSeries('hoary') |
101 | >>> test_publisher.addFakeChroots(hoary) |
102 | >>> unused = test_publisher.setUpDefaultDistroSeries(hoary) |
103 | - >>> def _create_source(): |
104 | - ... """Create source with meaningful '.changes' file.""" |
105 | - ... archive = cprov.archive |
106 | - ... version = '1.0-1' |
107 | - ... new_version = '2.0-1' |
108 | - ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) |
109 | - ... |
110 | - ... changesfile_content = '' |
111 | - ... handle = open(changesfile_path, 'r') |
112 | - ... try: |
113 | - ... changesfile_content = handle.read() |
114 | - ... finally: |
115 | - ... handle.close() |
116 | - ... |
117 | - ... changesfile_content = changesfile_content.replace( |
118 | - ... version, new_version) |
119 | - ... source = test_publisher.getPubSource( |
120 | - ... sourcename='foocomm', archive=archive, version=new_version, |
121 | - ... changes_file_content=changesfile_content, distroseries=hoary) |
122 | - ... |
123 | - ... return source |
124 | - >>> private_source = _create_source() |
125 | + >>> private_source = test_publisher.createSource( |
126 | + ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1') |
127 | >>> transaction.commit() |
128 | |
129 | Now, as Celso we will try to copy the just created 'private' source to |
130 | |
131 | === modified file 'lib/lp/soyuz/doc/archive.txt' |
132 | --- lib/lp/soyuz/doc/archive.txt 2009-10-10 11:01:24 +0000 |
133 | +++ lib/lp/soyuz/doc/archive.txt 2009-10-13 12:21:15 +0000 |
134 | @@ -1621,7 +1621,7 @@ |
135 | PPA for Celso Providelo |
136 | PPA for Launchpad Buildd Admins |
137 | |
138 | -The same happens for specific upload rights granted on 3rd-part |
139 | +The same happens for specific upload rights granted on 3rd-party |
140 | PPAs. When 'No Privileges' gets upload rights to Celso's PPA, |
141 | it gets listed by `getPPAsForUser`. |
142 | |
143 | @@ -1647,6 +1647,23 @@ |
144 | >>> jblack_ppas.count() |
145 | 0 |
146 | |
147 | +Another similar method, getPPAOwnedByPersonUser(), will return the named PPA |
148 | +owned by the person, or if the person is not supplied will default to the |
149 | +first PPA that the person created. |
150 | + |
151 | + >>> print archive_set.getPPAOwnedByPerson(cprov).displayname |
152 | + PPA for Celso Providelo |
153 | + |
154 | + >>> print archive_set.getPPAOwnedByPerson(cprov, name="ppa").displayname |
155 | + PPA for Celso Providelo |
156 | + |
157 | +If the named PPA does not exist, a NoSuchPPA exception is raised. |
158 | + |
159 | + >>> print archive_set.getPPAOwnedByPerson(cprov, name="goat").displayname |
160 | + Traceback (most recent call last): |
161 | + ... |
162 | + NoSuchPPA: No such ppa: 'goat'. |
163 | + |
164 | The method getPrivatePPAs() will return a result set of all PPAs that are |
165 | private. |
166 | |
167 | |
168 | === modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt' |
169 | --- lib/lp/soyuz/doc/distroseriesqueue.txt 2009-09-30 16:00:11 +0000 |
170 | +++ lib/lp/soyuz/doc/distroseriesqueue.txt 2009-10-13 12:21:15 +0000 |
171 | @@ -1042,28 +1042,6 @@ |
172 | >>> from lp.registry.interfaces.person import IPersonSet |
173 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
174 | |
175 | - >>> def _create_source(): |
176 | - ... """Create source with meaningful '.changes' file.""" |
177 | - ... archive = cprov.archive |
178 | - ... version = '1.0-1' |
179 | - ... new_version = '2.0-1' |
180 | - ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) |
181 | - ... |
182 | - ... changesfile_content = '' |
183 | - ... handle = open(changesfile_path, 'r') |
184 | - ... try: |
185 | - ... changesfile_content = handle.read() |
186 | - ... finally: |
187 | - ... handle.close() |
188 | - ... |
189 | - ... changesfile_content = changesfile_content.replace( |
190 | - ... version, new_version) |
191 | - ... source = test_publisher.getPubSource( |
192 | - ... sourcename='foocomm', archive=archive, version=new_version, |
193 | - ... changes_file_content=changesfile_content, distroseries=hoary) |
194 | - ... |
195 | - ... return source |
196 | - |
197 | A 'delayed-copy' is a PackageUpload record. |
198 | |
199 | >>> delayed_copy = getUtility(IPackageUploadSet).createDelayedCopy( |
200 | @@ -1115,7 +1093,8 @@ |
201 | Delayed copies are further manipulated exactly as normal uploads |
202 | are. Contents can be attached to it. |
203 | |
204 | - >>> a_source_package = _create_source() |
205 | + >>> a_source_package = test_publisher.createSource( |
206 | + ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1') |
207 | >>> transaction.commit() |
208 | >>> unused = delayed_copy.addSource(a_source_package.sourcepackagerelease) |
209 | |
210 | |
211 | === modified file 'lib/lp/soyuz/interfaces/archive.py' |
212 | --- lib/lp/soyuz/interfaces/archive.py 2009-10-07 14:50:04 +0000 |
213 | +++ lib/lp/soyuz/interfaces/archive.py 2009-10-13 12:21:15 +0000 |
214 | @@ -1087,11 +1087,14 @@ |
215 | |
216 | name = TextLine( |
217 | title=_("PPA name"), required=True, constraint=name_validator, |
218 | - description=_("A unique name used to identify this PPA.")) |
219 | + description=_("A unique name used to identify this PPA. It will " |
220 | + "form part of the URL to the archive repository.")) |
221 | |
222 | displayname = StrippedTextLine( |
223 | title=_("Displayname"), required=True, |
224 | - description=_("Displayname for this PPA.")) |
225 | + description=_("Displayname for this PPA. It will be used in " |
226 | + "the signing key's description if this is the " |
227 | + "first PPA for a person.")) |
228 | |
229 | description = Text( |
230 | title=_("PPA contents description"), required=False, |
231 | @@ -1182,6 +1185,18 @@ |
232 | def __iter__(): |
233 | """Iterates over existent archives, including the main_archives.""" |
234 | |
235 | + def getPPAOwnedByPerson(person, name=None): |
236 | + """Return the named PPA owned by person. |
237 | + |
238 | + :param person: An `IPerson` |
239 | + :param name: The PPA name required. |
240 | + |
241 | + If the person is not supplied it will default to the |
242 | + first PPA that the person created. |
243 | + |
244 | + :raises NoSuchPPA: if the named PPA does not exist. |
245 | + """ |
246 | + |
247 | def getPPAsForUser(user): |
248 | """Return all PPAs the given user can participate. |
249 | |
250 | |
251 | === modified file 'lib/lp/soyuz/interfaces/publishing.py' |
252 | --- lib/lp/soyuz/interfaces/publishing.py 2009-09-24 14:36:12 +0000 |
253 | +++ lib/lp/soyuz/interfaces/publishing.py 2009-10-13 12:21:15 +0000 |
254 | @@ -508,7 +508,7 @@ |
255 | "Return an ISourcePackage meta object correspondent to the " |
256 | "sourcepackagerelease attribute inside a specific distroseries") |
257 | meta_sourcepackagerelease = Attribute( |
258 | - "Return an IDistribuitionSourcePackageRelease meta object " |
259 | + "Return an IDistributionSourcePackageRelease meta object " |
260 | "correspondent to the sourcepackagerelease attribute") |
261 | meta_supersededby = Attribute( |
262 | "Return an IDistribuitionSourcePackageRelease meta object " |
263 | |
264 | === modified file 'lib/lp/soyuz/model/archive.py' |
265 | --- lib/lp/soyuz/model/archive.py 2009-10-10 11:01:24 +0000 |
266 | +++ lib/lp/soyuz/model/archive.py 2009-10-13 12:21:15 +0000 |
267 | @@ -56,7 +56,7 @@ |
268 | AlreadySubscribed, ArchiveDependencyError, ArchiveNotPrivate, |
269 | ArchivePurpose, DistroSeriesNotFound, IArchive, IArchiveSet, |
270 | IDistributionArchive, InvalidComponent, IPPA, MAIN_ARCHIVE_PURPOSES, |
271 | - PocketNotFound, VersionRequiresName, default_name_by_purpose) |
272 | + NoSuchPPA, PocketNotFound, VersionRequiresName, default_name_by_purpose) |
273 | from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet |
274 | from lp.soyuz.interfaces.archivepermission import ( |
275 | ArchivePermissionType, IArchivePermissionSet) |
276 | @@ -1405,6 +1405,19 @@ |
277 | return 0 |
278 | return int(size) |
279 | |
280 | + def getPPAOwnedByPerson(self, person, name=None): |
281 | + """See `IArchiveSet`.""" |
282 | + store = Store.of(person) |
283 | + clause = [ |
284 | + Archive.purpose == ArchivePurpose.PPA, |
285 | + Archive.owner == person] |
286 | + if name is not None: |
287 | + clause.append(Archive.name == name) |
288 | + result = store.find(Archive, *clause).order_by(Archive.id).first() |
289 | + if name is not None and result is None: |
290 | + raise NoSuchPPA(name) |
291 | + return result |
292 | + |
293 | def getPPAsForUser(self, user): |
294 | """See `IArchiveSet`.""" |
295 | # Avoiding circular imports. |
296 | |
297 | === modified file 'lib/lp/soyuz/model/queue.py' |
298 | --- lib/lp/soyuz/model/queue.py 2009-10-01 07:05:22 +0000 |
299 | +++ lib/lp/soyuz/model/queue.py 2009-10-13 12:21:14 +0000 |
300 | @@ -367,15 +367,6 @@ |
301 | assert self.sources.count() == 1, ( |
302 | 'Source is mandatory for delayed copies.') |
303 | self.setAccepted() |
304 | - # The second assert guarantees that we'll actually have a SPR. |
305 | - spr = self.mySourcePackageRelease() |
306 | - # Use the changesfile of the original upload. |
307 | - changes_file_object = StringIO.StringIO( |
308 | - spr.package_upload.changesfile.read()) |
309 | - self.notify( |
310 | - announce_list=self.distroseries.changeslist, |
311 | - changes_file_object=changes_file_object, allow_unsigned=True) |
312 | - self.syncUpdate() |
313 | |
314 | def rejectFromQueue(self, logger=None, dry_run=False): |
315 | """See `IPackageUpload`.""" |
316 | @@ -496,7 +487,8 @@ |
317 | else: |
318 | return None |
319 | |
320 | - def mySourcePackageRelease(self): |
321 | + @property |
322 | + def my_source_package_release(self): |
323 | """The source package release related to this queue item. |
324 | |
325 | al-maisan, Wed, 30 Sep 2009 17:58:31 +0200: |
326 | @@ -548,6 +540,13 @@ |
327 | if self.is_delayed_copy: |
328 | for pub_record in publishing_records: |
329 | pub_record.overrideFromAncestry() |
330 | + |
331 | + # Grab the .changes file of the original source package while |
332 | + # it's available. |
333 | + changes_file = None |
334 | + if ISourcePackagePublishingHistory.providedBy(pub_record): |
335 | + changes_file = pub_record.sourcepackagerelease.package_upload.changesfile |
336 | + |
337 | for new_file in update_files_privacy(pub_record): |
338 | debug(logger, |
339 | "Re-uploaded %s to librarian" % new_file.filename) |
340 | @@ -557,6 +556,17 @@ |
341 | pub_record.createMissingBuilds( |
342 | pas_verify=pas_verify, logger=logger) |
343 | |
344 | + if changes_file is not None: |
345 | + debug( |
346 | + logger, |
347 | + "sending email to %s" % self.distroseries.changeslist) |
348 | + changes_file_object = StringIO.StringIO(changes_file.read()) |
349 | + self.notify( |
350 | + announce_list=self.distroseries.changeslist, |
351 | + changes_file_object=changes_file_object, |
352 | + allow_unsigned=True, logger=logger) |
353 | + self.syncUpdate() |
354 | + |
355 | self.setDone() |
356 | |
357 | return publishing_records |
358 | @@ -726,7 +736,7 @@ |
359 | message.ORIGIN = '\nOrigin: %s' % changes['origin'] |
360 | |
361 | if self.sources or self.builds: |
362 | - message.SPR_URL = canonical_url(self.mySourcePackageRelease()) |
363 | + message.SPR_URL = canonical_url(self.my_source_package_release) |
364 | |
365 | def _sendRejectionNotification( |
366 | self, recipients, changes_lines, changes, summary_text, dry_run, |
367 | @@ -1123,7 +1133,7 @@ |
368 | # the section of the source package uploaded in order to facilitate |
369 | # filtering on the part of the email recipients. |
370 | if self.sources: |
371 | - spr = self.mySourcePackageRelease() |
372 | + spr = self.my_source_package_release |
373 | xlp_component_header = 'component=%s, section=%s' % ( |
374 | spr.component.name, spr.section.name) |
375 | extra_headers['X-Launchpad-Component'] = xlp_component_header |
376 | |
377 | === modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py' |
378 | --- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-09-29 17:27:52 +0000 |
379 | +++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-10-13 12:21:15 +0000 |
380 | @@ -50,24 +50,6 @@ |
381 | TestCase, TestCaseWithFactory) |
382 | |
383 | |
384 | -def _create_source(test_publisher, archive): |
385 | - """Create source with meaningful '.changes' file.""" |
386 | - changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-2_binary/foocomm_1.0-2_i386.changes' |
387 | - |
388 | - changesfile_content = '' |
389 | - handle = open(changesfile_path, 'r') |
390 | - try: |
391 | - changesfile_content = handle.read() |
392 | - finally: |
393 | - handle.close() |
394 | - |
395 | - source = test_publisher.getPubSource( |
396 | - sourcename='foocomm', archive=archive, version='1.0-2', |
397 | - changes_file_content=changesfile_content) |
398 | - |
399 | - return source |
400 | - |
401 | - |
402 | class ReUploadFileTestCase(TestCaseWithFactory): |
403 | """Test `ILibraryFileAlias` reupload helper. |
404 | |
405 | @@ -788,7 +770,8 @@ |
406 | purpose=ArchivePurpose.PPA) |
407 | private_archive.buildd_secret = 'x' |
408 | private_archive.private = True |
409 | - source = _create_source(self.test_publisher, private_archive) |
410 | + source = self.test_publisher.createSource( |
411 | + private_archive, 'foocomm', '1.0-2') |
412 | |
413 | archive = self.test_publisher.ubuntutest.main_archive |
414 | series = source.distroseries |
415 | @@ -917,7 +900,7 @@ |
416 | ppa.buildd_secret = 'x' |
417 | ppa.private = True |
418 | |
419 | - source = _create_source(self.test_publisher, ppa) |
420 | + source = self.test_publisher.createSource(ppa, 'foocomm', '1.0-2') |
421 | self.test_publisher.getPubBinaries(pub_source=source) |
422 | |
423 | [build] = source.getBuilds() |
424 | |
425 | === modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt' |
426 | --- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2009-09-23 10:29:52 +0000 |
427 | +++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2009-10-13 12:21:15 +0000 |
428 | @@ -68,7 +68,7 @@ |
429 | |
430 | >>> jblack_browser.getLink('Create a new PPA').click() |
431 | >>> print jblack_browser.title |
432 | - Activate Personal Package Archive... |
433 | + Personal Package Archive Activation : James Blackwell |
434 | |
435 | >>> jblack_browser.getControl( |
436 | ... name="field.displayname").value = 'PPA for James Blackwell' |
437 | |
438 | === modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt' |
439 | --- lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt 2009-09-18 15:24:30 +0000 |
440 | +++ lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt 2009-10-13 12:21:14 +0000 |
441 | @@ -33,8 +33,8 @@ |
442 | The form looks almost identical to that for a public team. |
443 | |
444 | >>> browser.getLink('Create a new PPA').click() |
445 | - >>> browser.title |
446 | - 'Activate Personal Package Archive... |
447 | + >>> print browser.title |
448 | + Personal Package Archive Activation : ...Private Team... |
449 | |
450 | There is, however, an extra bit of information indicating the new PPA |
451 | will be private. |
452 | |
453 | === modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt' |
454 | --- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-07 12:54:03 +0000 |
455 | +++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-13 12:21:14 +0000 |
456 | @@ -36,7 +36,7 @@ |
457 | >>> sample_browser.getLink("Create a new PPA").click() |
458 | |
459 | >>> print sample_browser.title |
460 | - Activate Personal Package Archive... |
461 | + Personal Package Archive Activation : Sample Person |
462 | |
463 | This page presents a pointer to the current PPA-ToS (terms of service) |
464 | with mandatory 'displayname' and checkbox ('accepted') fields. The |
465 | @@ -54,7 +54,11 @@ |
466 | Activating this PPA will block future renaming of Sample Person |
467 | ... |
468 | |
469 | -'Displayname' is required. |
470 | +'PPA name' and 'Displayname' are required fields. For the first activated |
471 | +PPA, the name is pre-filled with a suggestion of "ppa": |
472 | + |
473 | + >>> print sample_browser.getControl(name="field.name").value |
474 | + ppa |
475 | |
476 | >>> sample_browser.getControl("Activate").click() |
477 | |
478 | @@ -63,10 +67,12 @@ |
479 | There is 1 error. |
480 | Required input is missing. |
481 | |
482 | -By submitting the form without acknowledge the PPA-ToS results in a |
483 | +By submitting the form without acknowledging the PPA-ToS results in a |
484 | error with a specific message. |
485 | |
486 | >>> sample_browser.getControl( |
487 | + ... name="field.name").value = 'sampleppa' |
488 | + >>> sample_browser.getControl( |
489 | ... name="field.displayname").value = 'Sample PPA' |
490 | >>> sample_browser.getControl("Activate").click() |
491 | |
492 | @@ -116,7 +122,7 @@ |
493 | PPA description |
494 | Howdy, cowboys ! |
495 | |
496 | -Empty 'description' fields are not be rendered. |
497 | +Empty 'description' fields are not rendered. |
498 | |
499 | >>> sample_browser.getLink("Change details").click() |
500 | >>> sample_browser.getControl(name="field.description").value = ('') |
501 | @@ -143,7 +149,7 @@ |
502 | There is 1 error. |
503 | Required input is missing. |
504 | |
505 | -Once the PPA is activated, Sample user account cannot be renamed |
506 | +Once the PPA is activated, the Sample user account cannot be renamed |
507 | anymore. Changing the account name affects the PPA repository paths |
508 | and we don't have infrastructure in place to support that yet. See |
509 | more information about the feature in bug #87326. |
510 | @@ -193,10 +199,12 @@ |
511 | |
512 | >>> sample_browser.getLink('Create a new PPA').click() |
513 | |
514 | - >>> sample_browser.title |
515 | - 'Activate Personal Package Archive... |
516 | + >>> print sample_browser.title |
517 | + Personal Package Archive Activation : ... |
518 | |
519 | >>> sample_browser.getControl( |
520 | + ... name="field.name").value = 'develppa' |
521 | + >>> sample_browser.getControl( |
522 | ... name="field.displayname").value = 'Devel PPA' |
523 | >>> sample_browser.getControl(name="field.accepted").value = True |
524 | >>> sample_browser.getControl( |
525 | @@ -285,6 +293,7 @@ |
526 | Create a new PPA |
527 | |
528 | >>> admin_browser.getLink("Create a new PPA").click() |
529 | + >>> admin_browser.getControl(name="field.name").value = 'hackppa' |
530 | >>> admin_browser.getControl( |
531 | ... name="field.displayname").value = 'Hack PPA' |
532 | >>> admin_browser.getControl(name="field.accepted").value = True |
533 | @@ -330,7 +339,7 @@ |
534 | Trying to shortcut the URL as a non-privileged user does not work: |
535 | |
536 | >>> sample_browser.open( |
537 | - ... "http://launchpad.dev/~jblack/+archive/ppa/+admin") |
538 | + ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin") |
539 | Traceback (most recent call last): |
540 | ... |
541 | Unauthorized... |
542 | @@ -439,7 +448,8 @@ |
543 | |
544 | >>> limit = 2 ** 31 - 1 |
545 | |
546 | - >>> admin_browser.open("http://launchpad.dev/~jblack/+archive/ppa/+admin") |
547 | + >>> admin_browser.open( |
548 | + ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin") |
549 | >>> admin_browser.getControl( |
550 | ... name="field.authorized_size").value = str(limit) |
551 | >>> admin_browser.getControl("Save").click() |
552 | @@ -493,11 +503,13 @@ |
553 | Prepare the forms in both browsers to activate the default PPA for the |
554 | user 'Foo Bar'. |
555 | |
556 | + >>> browser1.getControl(name="field.name").value = 'boomppa' |
557 | >>> browser1.getControl(name="field.displayname").value = 'Boom PPA' |
558 | >>> browser1.getControl(name="field.accepted").value = True |
559 | >>> browser1.getControl( |
560 | ... name="field.description").value = 'PPA rocks!' |
561 | |
562 | + >>> browser2.getControl(name="field.name").value = 'boomppa' |
563 | >>> browser2.getControl(name="field.displayname").value = 'Boom PPA' |
564 | >>> browser2.getControl(name="field.accepted").value = True |
565 | >>> browser2.getControl( |
566 | @@ -523,18 +535,16 @@ |
567 | >>> for error in get_feedback_messages(browser2.contents): |
568 | ... print error |
569 | There is 1 error. |
570 | - The default PPA is already activated. |
571 | - Please specify a name for the new PPA and resubmit the form. |
572 | - |
573 | - >>> browser2.getControl(name="field.name").value |
574 | - '' |
575 | - |
576 | - |
577 | -== Activating a named PPA == |
578 | - |
579 | -Users who already have a PPA may as well activate a second one. |
580 | - |
581 | -That's the case for Celso. |
582 | + You already have a PPA named 'boomppa'. |
583 | + |
584 | + >>> print browser2.getControl(name="field.name").value |
585 | + boomppa |
586 | + |
587 | + |
588 | +== Activating an additional PPA == |
589 | + |
590 | +Users who already have a PPA may activate a second one. That's the case for |
591 | +Celso. |
592 | |
593 | >>> cprov_browser.open("http://launchpad.dev/~cprov") |
594 | |
595 | @@ -544,15 +554,15 @@ |
596 | Create a new PPA |
597 | |
598 | Celso can simply click on 'Create a new PPA' and will be presented to |
599 | -the usual PPA activation form where the checkbox for acknowledge the |
600 | -PPA-ToS is replaced by a 'name' field and a list of 'Existing PPAs'. |
601 | -Launchpad requires an user to acknowledge the PPA-ToS only once for |
602 | +the usual PPA activation form where the checkbox for acknowledging the |
603 | +PPA-ToS is no longer present and a list of 'Existing PPAs' is presented. |
604 | +Launchpad requires a user to acknowledge the PPA-ToS only once for |
605 | all his PPAs. |
606 | |
607 | >>> cprov_browser.getLink("Create a new PPA").click() |
608 | |
609 | >>> print cprov_browser.title |
610 | - Activate Personal Package Archive... |
611 | + Personal Package Archive Activation : Celso Providelo |
612 | |
613 | >>> print_tag_with_id(cprov_browser.contents, 'ppas') |
614 | Existing PPAs |
615 | @@ -566,12 +576,14 @@ |
616 | >>> print extract_text( |
617 | ... first_tag_by_class(cprov_browser.contents, 'form')) |
618 | PPA name: |
619 | - A unique name used to identify this PPA. |
620 | + A unique name used to identify this PPA. It will form part of the URL |
621 | + to the archive repository. |
622 | Displayname: |
623 | - Displayname for this PPA. |
624 | + Displayname for this PPA. It will be used in the signing key's |
625 | + description if this is the first PPA for a person. |
626 | PPA contents description: (Optional) |
627 | - A short description of this PPA. URLs are allowed and will be |
628 | - rendered as links. |
629 | + A short description of this PPA. URLs are allowed and will be rendered |
630 | + as links. |
631 | |
632 | Note that, differently than the time when the first PPA was activated, |
633 | this time there is no warning about the fact that the context renaming |
634 | @@ -582,7 +594,11 @@ |
635 | ... first_tag_by_class(cprov_browser.contents, 'actions')) |
636 | or Cancel |
637 | |
638 | -If Celso does not fill 'PPA name' an error is raised. |
639 | +The 'PPA name' field is not pre-filled and if Celso does not fill it then |
640 | +an error is raised. |
641 | + |
642 | + >>> print cprov_browser.getControl(name="field.name").value |
643 | + <BLANKLINE> |
644 | |
645 | >>> cprov_browser.getControl( |
646 | ... name="field.displayname").value = 'Edge PPA' |
647 | |
648 | === modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt' |
649 | --- lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-09-30 10:43:08 +0000 |
650 | +++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-10-13 12:21:14 +0000 |
651 | @@ -735,29 +735,13 @@ |
652 | |
653 | Make Celso's PPA private and create a private source publication. |
654 | |
655 | - >>> def _create_source(archive, version): |
656 | - ... """Create source with meaningful '.changes' file.""" |
657 | - ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) |
658 | - ... |
659 | - ... changesfile_content = '' |
660 | - ... handle = open(changesfile_path, 'r') |
661 | - ... try: |
662 | - ... changesfile_content = handle.read() |
663 | - ... finally: |
664 | - ... handle.close() |
665 | - ... |
666 | - ... source = test_publisher.getPubSource( |
667 | - ... sourcename='foocomm', archive=archive, version=version, |
668 | - ... changes_file_content=changesfile_content) |
669 | - ... |
670 | - ... return source |
671 | - |
672 | >>> login('foo.bar@canonical.com') |
673 | |
674 | >>> cprov.archive.buildd_secret = 'boing' |
675 | >>> cprov.archive.private = True |
676 | |
677 | - >>> private_publication = _create_source(cprov.archive, '1.0-1') |
678 | + >>> private_publication = test_publisher.createSource( |
679 | + ... cprov.archive, 'foocomm', '1.0-1') |
680 | |
681 | >>> logout() |
682 | |
683 | @@ -924,7 +908,8 @@ |
684 | version. |
685 | |
686 | >>> login('foo.bar@canonical.com') |
687 | - >>> unused = _create_source(cprov.archive, '1.0-2') |
688 | + >>> unused = test_publisher.createSource( |
689 | + ... cprov.archive, 'foocomm', '1.0-2') |
690 | >>> logout() |
691 | |
692 | >>> print cprov_webservice.named_post( |
693 | |
694 | === modified file 'lib/lp/soyuz/templates/archive-activate.pt' |
695 | --- lib/lp/soyuz/templates/archive-activate.pt 2009-08-15 11:59:38 +0000 |
696 | +++ lib/lp/soyuz/templates/archive-activate.pt 2009-10-13 12:21:14 +0000 |
697 | @@ -8,10 +8,6 @@ |
698 | > |
699 | <body> |
700 | |
701 | -<div metal:fill-slot="heading"> |
702 | - <h1>Personal Package Archive Activation</h1> |
703 | -</div> |
704 | - |
705 | <div metal:fill-slot="main"> |
706 | <div class="top-portlet"> |
707 | A PPA is a place where you can build and publish your own packages. |
708 | |
709 | === modified file 'lib/lp/soyuz/tests/test_packageupload.py' |
710 | --- lib/lp/soyuz/tests/test_packageupload.py 2009-09-29 17:16:01 +0000 |
711 | +++ lib/lp/soyuz/tests/test_packageupload.py 2009-10-13 12:21:15 +0000 |
712 | @@ -198,6 +198,9 @@ |
713 | self.assertEquals( |
714 | PackageUploadStatus.ACCEPTED, delayed_copy.status) |
715 | |
716 | + # Make sure no announcement email was sent at this point. |
717 | + self.assertEquals(len(stub.test_emails), 0) |
718 | + |
719 | self.layer.txn.commit() |
720 | self.layer.switchDbUser(self.dbuser) |
721 | |
722 | @@ -210,21 +213,25 @@ |
723 | |
724 | # Check the announcement email. |
725 | from_addr, to_addrs, raw_msg = stub.test_emails.pop() |
726 | - # This is now a MIMEMultipart message. |
727 | msg = message_from_string(raw_msg) |
728 | body = msg.get_payload(0) |
729 | body = body.get_payload(decode=True) |
730 | |
731 | - self.assertEquals(from_addr, 'bounces@canonical.com') |
732 | self.assertEquals( |
733 | - to_addrs, ['breezy-autotest-changes@lists.ubuntu.com']) |
734 | + str(to_addrs), "['breezy-autotest-changes@lists.ubuntu.com']") |
735 | |
736 | expected_subject = ( |
737 | '[ubuntutest/breezy-autotest-security]\n\t' |
738 | 'dist-upgrader_20060302.0120_all.tar.gz, foocomm 1.0-2 (Accepted)') |
739 | self.assertEquals(msg['Subject'], expected_subject) |
740 | |
741 | - self.assertTrue(body.startswith('foocomm (1.0-2) breezy; urgency=low')) |
742 | + self.assertEquals(body, |
743 | + 'foocomm (1.0-2) breezy; urgency=low\n\n' |
744 | + ' * Initial version\n\n' |
745 | + 'Date: Thu, 16 Feb 2006 15:34:09 +0000\n' |
746 | + 'Changed-By: Foo Bar <foo.bar@canonical.com>\n' |
747 | + 'Maintainer: Launchpad team <launchpad@lists.canonical.com>\n' |
748 | + 'http://launchpad.dev/ubuntutest/breezy-autotest/+source/foocomm/1.0-2\n') |
749 | |
750 | self.layer.switchDbUser('launchpad') |
751 | |
752 | |
753 | === modified file 'lib/lp/soyuz/tests/test_publishing.py' |
754 | --- lib/lp/soyuz/tests/test_publishing.py 2009-09-10 08:56:15 +0000 |
755 | +++ lib/lp/soyuz/tests/test_publishing.py 2009-10-13 12:21:14 +0000 |
756 | @@ -385,6 +385,41 @@ |
757 | return [BinaryPackagePublishingHistory.get(pub.id) |
758 | for pub in secure_pub_binaries] |
759 | |
760 | + def _findChangesFile(self, top, name_fragment): |
761 | + """File with given name fragment in directory tree starting at top.""" |
762 | + for root, dirs, files in os.walk(top, topdown=False): |
763 | + for name in files: |
764 | + if name.endswith('.changes') and name.find(name_fragment) > -1: |
765 | + return os.path.join(root, name) |
766 | + return None |
767 | + |
768 | + def createSource( |
769 | + self, archive, sourcename, version, distroseries=None, |
770 | + new_version=None): |
771 | + """Create source with meaningful '.changes' file.""" |
772 | + top = 'lib/lp/archiveuploader/tests/data/suite' |
773 | + name_fragment = '%s_%s' % (sourcename, version) |
774 | + changesfile_path = self._findChangesFile(top, name_fragment) |
775 | + |
776 | + source = None |
777 | + |
778 | + if changesfile_path is not None: |
779 | + if new_version is None: |
780 | + new_version = version |
781 | + changesfile_content = '' |
782 | + handle = open(changesfile_path, 'r') |
783 | + try: |
784 | + changesfile_content = handle.read() |
785 | + finally: |
786 | + handle.close() |
787 | + |
788 | + source = self.getPubSource( |
789 | + sourcename=sourcename, archive=archive, version=new_version, |
790 | + changes_file_content=changesfile_content, |
791 | + distroseries=distroseries) |
792 | + |
793 | + return source |
794 | + |
795 | |
796 | class TestNativePublishingBase(unittest.TestCase, SoyuzTestPublisher): |
797 | layer = LaunchpadZopelessLayer |
798 | |
799 | === modified file 'versions.cfg' |
800 | --- versions.cfg 2009-10-07 10:57:23 +0000 |
801 | +++ versions.cfg 2009-10-13 12:21:15 +0000 |
802 | @@ -19,6 +19,7 @@ |
803 | feedvalidator = 0.0.0DEV-r1049 |
804 | functest = 0.8.7 |
805 | funkload = 1.10.0 |
806 | +grokcore.component = 1.6 |
807 | httplib2 = 0.4.0 |
808 | ipython = 0.9.1 |
809 | launchpadlib = 1.5.1 |
810 | @@ -27,10 +28,11 @@ |
811 | lazr.delegates = 1.1.0 |
812 | lazr.enum = 1.1.2 |
813 | lazr.lifecycle = 1.0 |
814 | -lazr.restful = 0.9.5 |
815 | +lazr.restful = 0.9.11 |
816 | lazr.restfulclient = 0.9.5 |
817 | lazr.smtptest = 1.1 |
818 | lazr.uri = 1.0.2 |
819 | +martian = 0.11 |
820 | mechanize = 0.1.7b |
821 | mocker = 0.10.1 |
822 | mozrunner = 1.3.4 |
823 | @@ -62,6 +64,7 @@ |
824 | wsgi-intercept = 0.4 |
825 | wsgi-jsonrpc = 0.2.8 |
826 | wsgi-xmlrpc = 0.2.7 |
827 | +wsgiref = 0.1.2 |
828 | z3c.coverage = 1.1.2 |
829 | z3c.csvvocabulary = 1.0.0 |
830 | z3c.etestbrowser = 1.0.4 |
This branch adds versions.cfg entries for the new dependencies of lazr.restful, and updates lazr.restful's version number.