Merge lp:~leonardr/launchpad/help-me-gary into lp:launchpad/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
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Review via email: mp+13245@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote :

This branch adds versions.cfg entries for the new dependencies of lazr.restful, and updates lazr.restful's version number.

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
=== modified file 'Makefile'
--- Makefile 2009-10-09 15:26:50 +0000
+++ Makefile 2009-10-13 12:21:15 +0000
@@ -90,10 +90,7 @@
90 @echo90 @echo
91 @echo "Running the JavaScript integration test suite"91 @echo "Running the JavaScript integration test suite"
92 @echo92 @echo
93 bin/test $(VERBOSITY) --layer=BugsWindmillLayer93 bin/test $(VERBOSITY) --layer=WindmillLayer
94 bin/test $(VERBOSITY) --layer=CodeWindmillLayer
95 bin/test $(VERBOSITY) --layer=RegistryWindmillLayer
96 bin/test $(VERBOSITY) --layer=SoyuzWindmillLayer
9794
98jscheck_functest: build95jscheck_functest: build
99 # Run the old functest Windmill integration tests. The test runner96 # Run the old functest Windmill integration tests. The test runner
10097
=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py 2009-09-30 01:20:39 +0000
+++ lib/lp/registry/model/person.py 2009-10-13 12:21:15 +0000
@@ -77,7 +77,7 @@
77from canonical.launchpad.interfaces.account import (77from canonical.launchpad.interfaces.account import (
78 AccountCreationRationale, AccountStatus, IAccount, IAccountSet,78 AccountCreationRationale, AccountStatus, IAccount, IAccountSet,
79 INACTIVE_ACCOUNT_STATUSES)79 INACTIVE_ACCOUNT_STATUSES)
80from lp.soyuz.interfaces.archive import ArchivePurpose, NoSuchPPA80from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet
81from lp.soyuz.interfaces.archivepermission import (81from lp.soyuz.interfaces.archivepermission import (
82 IArchivePermissionSet)82 IArchivePermissionSet)
83from canonical.launchpad.interfaces.authtoken import LoginTokenType83from canonical.launchpad.interfaces.authtoken import LoginTokenType
@@ -2286,8 +2286,7 @@
2286 @property2286 @property
2287 def archive(self):2287 def archive(self):
2288 """See `IPerson`."""2288 """See `IPerson`."""
2289 return Archive.selectOneBy(2289 return getUtility(IArchiveSet).getPPAOwnedByPerson(self)
2290 owner=self, purpose=ArchivePurpose.PPA, name='ppa')
22912290
2292 @property2291 @property
2293 def ppas(self):2292 def ppas(self):
@@ -2297,11 +2296,7 @@
22972296
2298 def getPPAByName(self, name):2297 def getPPAByName(self, name):
2299 """See `IPerson`."""2298 """See `IPerson`."""
2300 ppa = Archive.selectOneBy(2299 return getUtility(IArchiveSet).getPPAOwnedByPerson(self, name)
2301 owner=self, purpose=ArchivePurpose.PPA, name=name)
2302 if ppa is None:
2303 raise NoSuchPPA(name)
2304 return ppa
23052300
2306 def isBugContributor(self, user=None):2301 def isBugContributor(self, user=None):
2307 """See `IPerson`."""2302 """See `IPerson`."""
23082303
=== modified file 'lib/lp/soyuz/browser/archive.py'
--- lib/lp/soyuz/browser/archive.py 2009-10-07 13:39:14 +0000
+++ lib/lp/soyuz/browser/archive.py 2009-10-13 12:21:15 +0000
@@ -1625,17 +1625,27 @@
16251625
1626 schema = IPPAActivateForm1626 schema = IPPAActivateForm
1627 custom_widget('description', TextAreaWidget, height=3)1627 custom_widget('description', TextAreaWidget, height=3)
1628 label = "Personal Package Archive Activation"
16281629
1629 @property1630 @property
1630 def ubuntu(self):1631 def ubuntu(self):
1631 return getUtility(ILaunchpadCelebrities).ubuntu1632 return getUtility(ILaunchpadCelebrities).ubuntu
16321633
1634 @property
1635 def initial_values(self):
1636 """Set up default values for form fields."""
1637 # Suggest a default value of "ppa" for the name for the
1638 # first PPA activation.
1639 if self.context.archive is None:
1640 return {'name': 'ppa'}
1641 return {}
1642
1633 def setUpFields(self):1643 def setUpFields(self):
1634 """Override `LaunchpadFormView`.1644 """Override `LaunchpadFormView`.
16351645
1636 Reorder the fields in a way the make more sense to users and also1646 Reorder the fields in a way the make more sense to users and also
1637 omit 'name' and present a checkbox for acknowledging the PPA-ToS1647 present a checkbox for acknowledging the PPA-ToS if the user is
1638 if the user is creating his first PPA.1648 creating his first PPA.
1639 """1649 """
1640 LaunchpadFormView.setUpFields(self)1650 LaunchpadFormView.setUpFields(self)
16411651
@@ -1644,7 +1654,7 @@
1644 'name', 'displayname', 'description')1654 'name', 'displayname', 'description')
1645 else:1655 else:
1646 self.form_fields = self.form_fields.select(1656 self.form_fields = self.form_fields.select(
1647 'displayname', 'accepted', 'description')1657 'name', 'displayname', 'accepted', 'description')
16481658
1649 def validate(self, data):1659 def validate(self, data):
1650 """Ensure user has checked the 'accepted' checkbox."""1660 """Ensure user has checked the 'accepted' checkbox."""
16511661
=== modified file 'lib/lp/soyuz/browser/tests/archive-views.txt'
--- lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-07 13:39:14 +0000
+++ lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-13 12:21:14 +0000
@@ -1284,28 +1284,8 @@
1284 >>> hoary = ubuntu.getSeries('hoary')1284 >>> hoary = ubuntu.getSeries('hoary')
1285 >>> test_publisher.addFakeChroots(hoary)1285 >>> test_publisher.addFakeChroots(hoary)
1286 >>> unused = test_publisher.setUpDefaultDistroSeries(hoary)1286 >>> unused = test_publisher.setUpDefaultDistroSeries(hoary)
1287 >>> def _create_source():1287 >>> private_source = test_publisher.createSource(
1288 ... """Create source with meaningful '.changes' file."""1288 ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1')
1289 ... archive = cprov.archive
1290 ... version = '1.0-1'
1291 ... new_version = '2.0-1'
1292 ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2)
1293 ...
1294 ... changesfile_content = ''
1295 ... handle = open(changesfile_path, 'r')
1296 ... try:
1297 ... changesfile_content = handle.read()
1298 ... finally:
1299 ... handle.close()
1300 ...
1301 ... changesfile_content = changesfile_content.replace(
1302 ... version, new_version)
1303 ... source = test_publisher.getPubSource(
1304 ... sourcename='foocomm', archive=archive, version=new_version,
1305 ... changes_file_content=changesfile_content, distroseries=hoary)
1306 ...
1307 ... return source
1308 >>> private_source = _create_source()
1309 >>> transaction.commit()1289 >>> transaction.commit()
13101290
1311Now, as Celso we will try to copy the just created 'private' source to1291Now, as Celso we will try to copy the just created 'private' source to
13121292
=== modified file 'lib/lp/soyuz/doc/archive.txt'
--- lib/lp/soyuz/doc/archive.txt 2009-10-10 11:01:24 +0000
+++ lib/lp/soyuz/doc/archive.txt 2009-10-13 12:21:15 +0000
@@ -1621,7 +1621,7 @@
1621 PPA for Celso Providelo1621 PPA for Celso Providelo
1622 PPA for Launchpad Buildd Admins1622 PPA for Launchpad Buildd Admins
16231623
1624The same happens for specific upload rights granted on 3rd-part1624The same happens for specific upload rights granted on 3rd-party
1625PPAs. When 'No Privileges' gets upload rights to Celso's PPA,1625PPAs. When 'No Privileges' gets upload rights to Celso's PPA,
1626it gets listed by `getPPAsForUser`.1626it gets listed by `getPPAsForUser`.
16271627
@@ -1647,6 +1647,23 @@
1647 >>> jblack_ppas.count()1647 >>> jblack_ppas.count()
1648 01648 0
16491649
1650Another similar method, getPPAOwnedByPersonUser(), will return the named PPA
1651owned by the person, or if the person is not supplied will default to the
1652first PPA that the person created.
1653
1654 >>> print archive_set.getPPAOwnedByPerson(cprov).displayname
1655 PPA for Celso Providelo
1656
1657 >>> print archive_set.getPPAOwnedByPerson(cprov, name="ppa").displayname
1658 PPA for Celso Providelo
1659
1660If the named PPA does not exist, a NoSuchPPA exception is raised.
1661
1662 >>> print archive_set.getPPAOwnedByPerson(cprov, name="goat").displayname
1663 Traceback (most recent call last):
1664 ...
1665 NoSuchPPA: No such ppa: 'goat'.
1666
1650The method getPrivatePPAs() will return a result set of all PPAs that are1667The method getPrivatePPAs() will return a result set of all PPAs that are
1651private.1668private.
16521669
16531670
=== modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt'
--- lib/lp/soyuz/doc/distroseriesqueue.txt 2009-09-30 16:00:11 +0000
+++ lib/lp/soyuz/doc/distroseriesqueue.txt 2009-10-13 12:21:15 +0000
@@ -1042,28 +1042,6 @@
1042 >>> from lp.registry.interfaces.person import IPersonSet1042 >>> from lp.registry.interfaces.person import IPersonSet
1043 >>> cprov = getUtility(IPersonSet).getByName('cprov')1043 >>> cprov = getUtility(IPersonSet).getByName('cprov')
10441044
1045 >>> def _create_source():
1046 ... """Create source with meaningful '.changes' file."""
1047 ... archive = cprov.archive
1048 ... version = '1.0-1'
1049 ... new_version = '2.0-1'
1050 ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2)
1051 ...
1052 ... changesfile_content = ''
1053 ... handle = open(changesfile_path, 'r')
1054 ... try:
1055 ... changesfile_content = handle.read()
1056 ... finally:
1057 ... handle.close()
1058 ...
1059 ... changesfile_content = changesfile_content.replace(
1060 ... version, new_version)
1061 ... source = test_publisher.getPubSource(
1062 ... sourcename='foocomm', archive=archive, version=new_version,
1063 ... changes_file_content=changesfile_content, distroseries=hoary)
1064 ...
1065 ... return source
1066
1067A 'delayed-copy' is a PackageUpload record.1045A 'delayed-copy' is a PackageUpload record.
10681046
1069 >>> delayed_copy = getUtility(IPackageUploadSet).createDelayedCopy(1047 >>> delayed_copy = getUtility(IPackageUploadSet).createDelayedCopy(
@@ -1115,7 +1093,8 @@
1115Delayed copies are further manipulated exactly as normal uploads1093Delayed copies are further manipulated exactly as normal uploads
1116are. Contents can be attached to it.1094are. Contents can be attached to it.
11171095
1118 >>> a_source_package = _create_source()1096 >>> a_source_package = test_publisher.createSource(
1097 ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1')
1119 >>> transaction.commit()1098 >>> transaction.commit()
1120 >>> unused = delayed_copy.addSource(a_source_package.sourcepackagerelease)1099 >>> unused = delayed_copy.addSource(a_source_package.sourcepackagerelease)
11211100
11221101
=== modified file 'lib/lp/soyuz/interfaces/archive.py'
--- lib/lp/soyuz/interfaces/archive.py 2009-10-07 14:50:04 +0000
+++ lib/lp/soyuz/interfaces/archive.py 2009-10-13 12:21:15 +0000
@@ -1087,11 +1087,14 @@
10871087
1088 name = TextLine(1088 name = TextLine(
1089 title=_("PPA name"), required=True, constraint=name_validator,1089 title=_("PPA name"), required=True, constraint=name_validator,
1090 description=_("A unique name used to identify this PPA."))1090 description=_("A unique name used to identify this PPA. It will "
1091 "form part of the URL to the archive repository."))
10911092
1092 displayname = StrippedTextLine(1093 displayname = StrippedTextLine(
1093 title=_("Displayname"), required=True,1094 title=_("Displayname"), required=True,
1094 description=_("Displayname for this PPA."))1095 description=_("Displayname for this PPA. It will be used in "
1096 "the signing key's description if this is the "
1097 "first PPA for a person."))
10951098
1096 description = Text(1099 description = Text(
1097 title=_("PPA contents description"), required=False,1100 title=_("PPA contents description"), required=False,
@@ -1182,6 +1185,18 @@
1182 def __iter__():1185 def __iter__():
1183 """Iterates over existent archives, including the main_archives."""1186 """Iterates over existent archives, including the main_archives."""
11841187
1188 def getPPAOwnedByPerson(person, name=None):
1189 """Return the named PPA owned by person.
1190
1191 :param person: An `IPerson`
1192 :param name: The PPA name required.
1193
1194 If the person is not supplied it will default to the
1195 first PPA that the person created.
1196
1197 :raises NoSuchPPA: if the named PPA does not exist.
1198 """
1199
1185 def getPPAsForUser(user):1200 def getPPAsForUser(user):
1186 """Return all PPAs the given user can participate.1201 """Return all PPAs the given user can participate.
11871202
11881203
=== modified file 'lib/lp/soyuz/interfaces/publishing.py'
--- lib/lp/soyuz/interfaces/publishing.py 2009-09-24 14:36:12 +0000
+++ lib/lp/soyuz/interfaces/publishing.py 2009-10-13 12:21:15 +0000
@@ -508,7 +508,7 @@
508 "Return an ISourcePackage meta object correspondent to the "508 "Return an ISourcePackage meta object correspondent to the "
509 "sourcepackagerelease attribute inside a specific distroseries")509 "sourcepackagerelease attribute inside a specific distroseries")
510 meta_sourcepackagerelease = Attribute(510 meta_sourcepackagerelease = Attribute(
511 "Return an IDistribuitionSourcePackageRelease meta object "511 "Return an IDistributionSourcePackageRelease meta object "
512 "correspondent to the sourcepackagerelease attribute")512 "correspondent to the sourcepackagerelease attribute")
513 meta_supersededby = Attribute(513 meta_supersededby = Attribute(
514 "Return an IDistribuitionSourcePackageRelease meta object "514 "Return an IDistribuitionSourcePackageRelease meta object "
515515
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py 2009-10-10 11:01:24 +0000
+++ lib/lp/soyuz/model/archive.py 2009-10-13 12:21:15 +0000
@@ -56,7 +56,7 @@
56 AlreadySubscribed, ArchiveDependencyError, ArchiveNotPrivate,56 AlreadySubscribed, ArchiveDependencyError, ArchiveNotPrivate,
57 ArchivePurpose, DistroSeriesNotFound, IArchive, IArchiveSet,57 ArchivePurpose, DistroSeriesNotFound, IArchive, IArchiveSet,
58 IDistributionArchive, InvalidComponent, IPPA, MAIN_ARCHIVE_PURPOSES,58 IDistributionArchive, InvalidComponent, IPPA, MAIN_ARCHIVE_PURPOSES,
59 PocketNotFound, VersionRequiresName, default_name_by_purpose)59 NoSuchPPA, PocketNotFound, VersionRequiresName, default_name_by_purpose)
60from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet60from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet
61from lp.soyuz.interfaces.archivepermission import (61from lp.soyuz.interfaces.archivepermission import (
62 ArchivePermissionType, IArchivePermissionSet)62 ArchivePermissionType, IArchivePermissionSet)
@@ -1405,6 +1405,19 @@
1405 return 01405 return 0
1406 return int(size)1406 return int(size)
14071407
1408 def getPPAOwnedByPerson(self, person, name=None):
1409 """See `IArchiveSet`."""
1410 store = Store.of(person)
1411 clause = [
1412 Archive.purpose == ArchivePurpose.PPA,
1413 Archive.owner == person]
1414 if name is not None:
1415 clause.append(Archive.name == name)
1416 result = store.find(Archive, *clause).order_by(Archive.id).first()
1417 if name is not None and result is None:
1418 raise NoSuchPPA(name)
1419 return result
1420
1408 def getPPAsForUser(self, user):1421 def getPPAsForUser(self, user):
1409 """See `IArchiveSet`."""1422 """See `IArchiveSet`."""
1410 # Avoiding circular imports.1423 # Avoiding circular imports.
14111424
=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py 2009-10-01 07:05:22 +0000
+++ lib/lp/soyuz/model/queue.py 2009-10-13 12:21:14 +0000
@@ -367,15 +367,6 @@
367 assert self.sources.count() == 1, (367 assert self.sources.count() == 1, (
368 'Source is mandatory for delayed copies.')368 'Source is mandatory for delayed copies.')
369 self.setAccepted()369 self.setAccepted()
370 # The second assert guarantees that we'll actually have a SPR.
371 spr = self.mySourcePackageRelease()
372 # Use the changesfile of the original upload.
373 changes_file_object = StringIO.StringIO(
374 spr.package_upload.changesfile.read())
375 self.notify(
376 announce_list=self.distroseries.changeslist,
377 changes_file_object=changes_file_object, allow_unsigned=True)
378 self.syncUpdate()
379370
380 def rejectFromQueue(self, logger=None, dry_run=False):371 def rejectFromQueue(self, logger=None, dry_run=False):
381 """See `IPackageUpload`."""372 """See `IPackageUpload`."""
@@ -496,7 +487,8 @@
496 else:487 else:
497 return None488 return None
498489
499 def mySourcePackageRelease(self):490 @property
491 def my_source_package_release(self):
500 """The source package release related to this queue item.492 """The source package release related to this queue item.
501493
502 al-maisan, Wed, 30 Sep 2009 17:58:31 +0200:494 al-maisan, Wed, 30 Sep 2009 17:58:31 +0200:
@@ -548,6 +540,13 @@
548 if self.is_delayed_copy:540 if self.is_delayed_copy:
549 for pub_record in publishing_records:541 for pub_record in publishing_records:
550 pub_record.overrideFromAncestry()542 pub_record.overrideFromAncestry()
543
544 # Grab the .changes file of the original source package while
545 # it's available.
546 changes_file = None
547 if ISourcePackagePublishingHistory.providedBy(pub_record):
548 changes_file = pub_record.sourcepackagerelease.package_upload.changesfile
549
551 for new_file in update_files_privacy(pub_record):550 for new_file in update_files_privacy(pub_record):
552 debug(logger,551 debug(logger,
553 "Re-uploaded %s to librarian" % new_file.filename)552 "Re-uploaded %s to librarian" % new_file.filename)
@@ -557,6 +556,17 @@
557 pub_record.createMissingBuilds(556 pub_record.createMissingBuilds(
558 pas_verify=pas_verify, logger=logger)557 pas_verify=pas_verify, logger=logger)
559558
559 if changes_file is not None:
560 debug(
561 logger,
562 "sending email to %s" % self.distroseries.changeslist)
563 changes_file_object = StringIO.StringIO(changes_file.read())
564 self.notify(
565 announce_list=self.distroseries.changeslist,
566 changes_file_object=changes_file_object,
567 allow_unsigned=True, logger=logger)
568 self.syncUpdate()
569
560 self.setDone()570 self.setDone()
561571
562 return publishing_records572 return publishing_records
@@ -726,7 +736,7 @@
726 message.ORIGIN = '\nOrigin: %s' % changes['origin']736 message.ORIGIN = '\nOrigin: %s' % changes['origin']
727737
728 if self.sources or self.builds:738 if self.sources or self.builds:
729 message.SPR_URL = canonical_url(self.mySourcePackageRelease())739 message.SPR_URL = canonical_url(self.my_source_package_release)
730740
731 def _sendRejectionNotification(741 def _sendRejectionNotification(
732 self, recipients, changes_lines, changes, summary_text, dry_run,742 self, recipients, changes_lines, changes, summary_text, dry_run,
@@ -1123,7 +1133,7 @@
1123 # the section of the source package uploaded in order to facilitate1133 # the section of the source package uploaded in order to facilitate
1124 # filtering on the part of the email recipients.1134 # filtering on the part of the email recipients.
1125 if self.sources:1135 if self.sources:
1126 spr = self.mySourcePackageRelease()1136 spr = self.my_source_package_release
1127 xlp_component_header = 'component=%s, section=%s' % (1137 xlp_component_header = 'component=%s, section=%s' % (
1128 spr.component.name, spr.section.name)1138 spr.component.name, spr.section.name)
1129 extra_headers['X-Launchpad-Component'] = xlp_component_header1139 extra_headers['X-Launchpad-Component'] = xlp_component_header
11301140
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-09-29 17:27:52 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-10-13 12:21:15 +0000
@@ -50,24 +50,6 @@
50 TestCase, TestCaseWithFactory)50 TestCase, TestCaseWithFactory)
5151
5252
53def _create_source(test_publisher, archive):
54 """Create source with meaningful '.changes' file."""
55 changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-2_binary/foocomm_1.0-2_i386.changes'
56
57 changesfile_content = ''
58 handle = open(changesfile_path, 'r')
59 try:
60 changesfile_content = handle.read()
61 finally:
62 handle.close()
63
64 source = test_publisher.getPubSource(
65 sourcename='foocomm', archive=archive, version='1.0-2',
66 changes_file_content=changesfile_content)
67
68 return source
69
70
71class ReUploadFileTestCase(TestCaseWithFactory):53class ReUploadFileTestCase(TestCaseWithFactory):
72 """Test `ILibraryFileAlias` reupload helper.54 """Test `ILibraryFileAlias` reupload helper.
7355
@@ -788,7 +770,8 @@
788 purpose=ArchivePurpose.PPA)770 purpose=ArchivePurpose.PPA)
789 private_archive.buildd_secret = 'x'771 private_archive.buildd_secret = 'x'
790 private_archive.private = True772 private_archive.private = True
791 source = _create_source(self.test_publisher, private_archive)773 source = self.test_publisher.createSource(
774 private_archive, 'foocomm', '1.0-2')
792775
793 archive = self.test_publisher.ubuntutest.main_archive776 archive = self.test_publisher.ubuntutest.main_archive
794 series = source.distroseries777 series = source.distroseries
@@ -917,7 +900,7 @@
917 ppa.buildd_secret = 'x'900 ppa.buildd_secret = 'x'
918 ppa.private = True901 ppa.private = True
919902
920 source = _create_source(self.test_publisher, ppa)903 source = self.test_publisher.createSource(ppa, 'foocomm', '1.0-2')
921 self.test_publisher.getPubBinaries(pub_source=source)904 self.test_publisher.getPubBinaries(pub_source=source)
922905
923 [build] = source.getBuilds()906 [build] = source.getBuilds()
924907
=== modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt'
--- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2009-09-23 10:29:52 +0000
+++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2009-10-13 12:21:15 +0000
@@ -68,7 +68,7 @@
6868
69 >>> jblack_browser.getLink('Create a new PPA').click()69 >>> jblack_browser.getLink('Create a new PPA').click()
70 >>> print jblack_browser.title70 >>> print jblack_browser.title
71 Activate Personal Package Archive...71 Personal Package Archive Activation : James Blackwell
7272
73 >>> jblack_browser.getControl(73 >>> jblack_browser.getControl(
74 ... name="field.displayname").value = 'PPA for James Blackwell'74 ... name="field.displayname").value = 'PPA for James Blackwell'
7575
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt 2009-09-18 15:24:30 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt 2009-10-13 12:21:14 +0000
@@ -33,8 +33,8 @@
33The form looks almost identical to that for a public team.33The form looks almost identical to that for a public team.
3434
35 >>> browser.getLink('Create a new PPA').click()35 >>> browser.getLink('Create a new PPA').click()
36 >>> browser.title36 >>> print browser.title
37 'Activate Personal Package Archive...37 Personal Package Archive Activation : ...Private Team...
3838
39There is, however, an extra bit of information indicating the new PPA39There is, however, an extra bit of information indicating the new PPA
40will be private.40will be private.
4141
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-07 12:54:03 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt 2009-10-13 12:21:14 +0000
@@ -36,7 +36,7 @@
36 >>> sample_browser.getLink("Create a new PPA").click()36 >>> sample_browser.getLink("Create a new PPA").click()
3737
38 >>> print sample_browser.title38 >>> print sample_browser.title
39 Activate Personal Package Archive...39 Personal Package Archive Activation : Sample Person
4040
41This page presents a pointer to the current PPA-ToS (terms of service)41This page presents a pointer to the current PPA-ToS (terms of service)
42with mandatory 'displayname' and checkbox ('accepted') fields. The42with mandatory 'displayname' and checkbox ('accepted') fields. The
@@ -54,7 +54,11 @@
54 Activating this PPA will block future renaming of Sample Person54 Activating this PPA will block future renaming of Sample Person
55 ...55 ...
5656
57'Displayname' is required.57'PPA name' and 'Displayname' are required fields. For the first activated
58PPA, the name is pre-filled with a suggestion of "ppa":
59
60 >>> print sample_browser.getControl(name="field.name").value
61 ppa
5862
59 >>> sample_browser.getControl("Activate").click()63 >>> sample_browser.getControl("Activate").click()
6064
@@ -63,10 +67,12 @@
63 There is 1 error.67 There is 1 error.
64 Required input is missing.68 Required input is missing.
6569
66By submitting the form without acknowledge the PPA-ToS results in a70By submitting the form without acknowledging the PPA-ToS results in a
67error with a specific message.71error with a specific message.
6872
69 >>> sample_browser.getControl(73 >>> sample_browser.getControl(
74 ... name="field.name").value = 'sampleppa'
75 >>> sample_browser.getControl(
70 ... name="field.displayname").value = 'Sample PPA'76 ... name="field.displayname").value = 'Sample PPA'
71 >>> sample_browser.getControl("Activate").click()77 >>> sample_browser.getControl("Activate").click()
7278
@@ -116,7 +122,7 @@
116 PPA description122 PPA description
117 Howdy, cowboys !123 Howdy, cowboys !
118124
119Empty 'description' fields are not be rendered.125Empty 'description' fields are not rendered.
120126
121 >>> sample_browser.getLink("Change details").click()127 >>> sample_browser.getLink("Change details").click()
122 >>> sample_browser.getControl(name="field.description").value = ('')128 >>> sample_browser.getControl(name="field.description").value = ('')
@@ -143,7 +149,7 @@
143 There is 1 error.149 There is 1 error.
144 Required input is missing.150 Required input is missing.
145151
146Once the PPA is activated, Sample user account cannot be renamed152Once the PPA is activated, the Sample user account cannot be renamed
147anymore. Changing the account name affects the PPA repository paths153anymore. Changing the account name affects the PPA repository paths
148and we don't have infrastructure in place to support that yet. See154and we don't have infrastructure in place to support that yet. See
149more information about the feature in bug #87326.155more information about the feature in bug #87326.
@@ -193,10 +199,12 @@
193199
194 >>> sample_browser.getLink('Create a new PPA').click()200 >>> sample_browser.getLink('Create a new PPA').click()
195201
196 >>> sample_browser.title202 >>> print sample_browser.title
197 'Activate Personal Package Archive...203 Personal Package Archive Activation : ...
198204
199 >>> sample_browser.getControl(205 >>> sample_browser.getControl(
206 ... name="field.name").value = 'develppa'
207 >>> sample_browser.getControl(
200 ... name="field.displayname").value = 'Devel PPA'208 ... name="field.displayname").value = 'Devel PPA'
201 >>> sample_browser.getControl(name="field.accepted").value = True209 >>> sample_browser.getControl(name="field.accepted").value = True
202 >>> sample_browser.getControl(210 >>> sample_browser.getControl(
@@ -285,6 +293,7 @@
285 Create a new PPA293 Create a new PPA
286294
287 >>> admin_browser.getLink("Create a new PPA").click()295 >>> admin_browser.getLink("Create a new PPA").click()
296 >>> admin_browser.getControl(name="field.name").value = 'hackppa'
288 >>> admin_browser.getControl(297 >>> admin_browser.getControl(
289 ... name="field.displayname").value = 'Hack PPA'298 ... name="field.displayname").value = 'Hack PPA'
290 >>> admin_browser.getControl(name="field.accepted").value = True299 >>> admin_browser.getControl(name="field.accepted").value = True
@@ -330,7 +339,7 @@
330Trying to shortcut the URL as a non-privileged user does not work:339Trying to shortcut the URL as a non-privileged user does not work:
331340
332 >>> sample_browser.open(341 >>> sample_browser.open(
333 ... "http://launchpad.dev/~jblack/+archive/ppa/+admin")342 ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin")
334 Traceback (most recent call last):343 Traceback (most recent call last):
335 ...344 ...
336 Unauthorized...345 Unauthorized...
@@ -439,7 +448,8 @@
439448
440 >>> limit = 2 ** 31 - 1449 >>> limit = 2 ** 31 - 1
441450
442 >>> admin_browser.open("http://launchpad.dev/~jblack/+archive/ppa/+admin")451 >>> admin_browser.open(
452 ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin")
443 >>> admin_browser.getControl(453 >>> admin_browser.getControl(
444 ... name="field.authorized_size").value = str(limit)454 ... name="field.authorized_size").value = str(limit)
445 >>> admin_browser.getControl("Save").click()455 >>> admin_browser.getControl("Save").click()
@@ -493,11 +503,13 @@
493Prepare the forms in both browsers to activate the default PPA for the503Prepare the forms in both browsers to activate the default PPA for the
494user 'Foo Bar'.504user 'Foo Bar'.
495505
506 >>> browser1.getControl(name="field.name").value = 'boomppa'
496 >>> browser1.getControl(name="field.displayname").value = 'Boom PPA'507 >>> browser1.getControl(name="field.displayname").value = 'Boom PPA'
497 >>> browser1.getControl(name="field.accepted").value = True508 >>> browser1.getControl(name="field.accepted").value = True
498 >>> browser1.getControl(509 >>> browser1.getControl(
499 ... name="field.description").value = 'PPA rocks!'510 ... name="field.description").value = 'PPA rocks!'
500511
512 >>> browser2.getControl(name="field.name").value = 'boomppa'
501 >>> browser2.getControl(name="field.displayname").value = 'Boom PPA'513 >>> browser2.getControl(name="field.displayname").value = 'Boom PPA'
502 >>> browser2.getControl(name="field.accepted").value = True514 >>> browser2.getControl(name="field.accepted").value = True
503 >>> browser2.getControl(515 >>> browser2.getControl(
@@ -523,18 +535,16 @@
523 >>> for error in get_feedback_messages(browser2.contents):535 >>> for error in get_feedback_messages(browser2.contents):
524 ... print error536 ... print error
525 There is 1 error.537 There is 1 error.
526 The default PPA is already activated.538 You already have a PPA named 'boomppa'.
527 Please specify a name for the new PPA and resubmit the form.539
528540 >>> print browser2.getControl(name="field.name").value
529 >>> browser2.getControl(name="field.name").value541 boomppa
530 ''542
531543
532544== Activating an additional PPA ==
533== Activating a named PPA ==545
534546Users who already have a PPA may activate a second one. That's the case for
535Users who already have a PPA may as well activate a second one.547Celso.
536
537That's the case for Celso.
538548
539 >>> cprov_browser.open("http://launchpad.dev/~cprov")549 >>> cprov_browser.open("http://launchpad.dev/~cprov")
540550
@@ -544,15 +554,15 @@
544 Create a new PPA554 Create a new PPA
545555
546Celso can simply click on 'Create a new PPA' and will be presented to556Celso can simply click on 'Create a new PPA' and will be presented to
547the usual PPA activation form where the checkbox for acknowledge the557the usual PPA activation form where the checkbox for acknowledging the
548PPA-ToS is replaced by a 'name' field and a list of 'Existing PPAs'.558PPA-ToS is no longer present and a list of 'Existing PPAs' is presented.
549Launchpad requires an user to acknowledge the PPA-ToS only once for559Launchpad requires a user to acknowledge the PPA-ToS only once for
550all his PPAs.560all his PPAs.
551561
552 >>> cprov_browser.getLink("Create a new PPA").click()562 >>> cprov_browser.getLink("Create a new PPA").click()
553563
554 >>> print cprov_browser.title564 >>> print cprov_browser.title
555 Activate Personal Package Archive...565 Personal Package Archive Activation : Celso Providelo
556566
557 >>> print_tag_with_id(cprov_browser.contents, 'ppas')567 >>> print_tag_with_id(cprov_browser.contents, 'ppas')
558 Existing PPAs568 Existing PPAs
@@ -566,12 +576,14 @@
566 >>> print extract_text(576 >>> print extract_text(
567 ... first_tag_by_class(cprov_browser.contents, 'form'))577 ... first_tag_by_class(cprov_browser.contents, 'form'))
568 PPA name:578 PPA name:
569 A unique name used to identify this PPA.579 A unique name used to identify this PPA. It will form part of the URL
580 to the archive repository.
570 Displayname:581 Displayname:
571 Displayname for this PPA.582 Displayname for this PPA. It will be used in the signing key's
583 description if this is the first PPA for a person.
572 PPA contents description: (Optional)584 PPA contents description: (Optional)
573 A short description of this PPA. URLs are allowed and will be585 A short description of this PPA. URLs are allowed and will be rendered
574 rendered as links.586 as links.
575587
576Note that, differently than the time when the first PPA was activated,588Note that, differently than the time when the first PPA was activated,
577this time there is no warning about the fact that the context renaming589this time there is no warning about the fact that the context renaming
@@ -582,7 +594,11 @@
582 ... first_tag_by_class(cprov_browser.contents, 'actions'))594 ... first_tag_by_class(cprov_browser.contents, 'actions'))
583 or Cancel595 or Cancel
584596
585If Celso does not fill 'PPA name' an error is raised.597The 'PPA name' field is not pre-filled and if Celso does not fill it then
598an error is raised.
599
600 >>> print cprov_browser.getControl(name="field.name").value
601 <BLANKLINE>
586602
587 >>> cprov_browser.getControl(603 >>> cprov_browser.getControl(
588 ... name="field.displayname").value = 'Edge PPA'604 ... name="field.displayname").value = 'Edge PPA'
589605
=== modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt'
--- lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-09-30 10:43:08 +0000
+++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-10-13 12:21:14 +0000
@@ -735,29 +735,13 @@
735735
736Make Celso's PPA private and create a private source publication.736Make Celso's PPA private and create a private source publication.
737737
738 >>> def _create_source(archive, version):
739 ... """Create source with meaningful '.changes' file."""
740 ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2)
741 ...
742 ... changesfile_content = ''
743 ... handle = open(changesfile_path, 'r')
744 ... try:
745 ... changesfile_content = handle.read()
746 ... finally:
747 ... handle.close()
748 ...
749 ... source = test_publisher.getPubSource(
750 ... sourcename='foocomm', archive=archive, version=version,
751 ... changes_file_content=changesfile_content)
752 ...
753 ... return source
754
755 >>> login('foo.bar@canonical.com')738 >>> login('foo.bar@canonical.com')
756739
757 >>> cprov.archive.buildd_secret = 'boing'740 >>> cprov.archive.buildd_secret = 'boing'
758 >>> cprov.archive.private = True741 >>> cprov.archive.private = True
759742
760 >>> private_publication = _create_source(cprov.archive, '1.0-1')743 >>> private_publication = test_publisher.createSource(
744 ... cprov.archive, 'foocomm', '1.0-1')
761745
762 >>> logout()746 >>> logout()
763747
@@ -924,7 +908,8 @@
924version.908version.
925909
926 >>> login('foo.bar@canonical.com')910 >>> login('foo.bar@canonical.com')
927 >>> unused = _create_source(cprov.archive, '1.0-2')911 >>> unused = test_publisher.createSource(
912 ... cprov.archive, 'foocomm', '1.0-2')
928 >>> logout()913 >>> logout()
929914
930 >>> print cprov_webservice.named_post(915 >>> print cprov_webservice.named_post(
931916
=== modified file 'lib/lp/soyuz/templates/archive-activate.pt'
--- lib/lp/soyuz/templates/archive-activate.pt 2009-08-15 11:59:38 +0000
+++ lib/lp/soyuz/templates/archive-activate.pt 2009-10-13 12:21:14 +0000
@@ -8,10 +8,6 @@
8 >8 >
9<body>9<body>
1010
11<div metal:fill-slot="heading">
12 <h1>Personal Package Archive Activation</h1>
13</div>
14
15<div metal:fill-slot="main">11<div metal:fill-slot="main">
16 <div class="top-portlet">12 <div class="top-portlet">
17 A PPA is a place where you can build and publish your own packages.13 A PPA is a place where you can build and publish your own packages.
1814
=== modified file 'lib/lp/soyuz/tests/test_packageupload.py'
--- lib/lp/soyuz/tests/test_packageupload.py 2009-09-29 17:16:01 +0000
+++ lib/lp/soyuz/tests/test_packageupload.py 2009-10-13 12:21:15 +0000
@@ -198,6 +198,9 @@
198 self.assertEquals(198 self.assertEquals(
199 PackageUploadStatus.ACCEPTED, delayed_copy.status)199 PackageUploadStatus.ACCEPTED, delayed_copy.status)
200200
201 # Make sure no announcement email was sent at this point.
202 self.assertEquals(len(stub.test_emails), 0)
203
201 self.layer.txn.commit()204 self.layer.txn.commit()
202 self.layer.switchDbUser(self.dbuser)205 self.layer.switchDbUser(self.dbuser)
203206
@@ -210,21 +213,25 @@
210213
211 # Check the announcement email.214 # Check the announcement email.
212 from_addr, to_addrs, raw_msg = stub.test_emails.pop()215 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
213 # This is now a MIMEMultipart message.
214 msg = message_from_string(raw_msg)216 msg = message_from_string(raw_msg)
215 body = msg.get_payload(0)217 body = msg.get_payload(0)
216 body = body.get_payload(decode=True)218 body = body.get_payload(decode=True)
217219
218 self.assertEquals(from_addr, 'bounces@canonical.com')
219 self.assertEquals(220 self.assertEquals(
220 to_addrs, ['breezy-autotest-changes@lists.ubuntu.com'])221 str(to_addrs), "['breezy-autotest-changes@lists.ubuntu.com']")
221222
222 expected_subject = (223 expected_subject = (
223 '[ubuntutest/breezy-autotest-security]\n\t'224 '[ubuntutest/breezy-autotest-security]\n\t'
224 'dist-upgrader_20060302.0120_all.tar.gz, foocomm 1.0-2 (Accepted)')225 'dist-upgrader_20060302.0120_all.tar.gz, foocomm 1.0-2 (Accepted)')
225 self.assertEquals(msg['Subject'], expected_subject)226 self.assertEquals(msg['Subject'], expected_subject)
226227
227 self.assertTrue(body.startswith('foocomm (1.0-2) breezy; urgency=low'))228 self.assertEquals(body,
229 'foocomm (1.0-2) breezy; urgency=low\n\n'
230 ' * Initial version\n\n'
231 'Date: Thu, 16 Feb 2006 15:34:09 +0000\n'
232 'Changed-By: Foo Bar <foo.bar@canonical.com>\n'
233 'Maintainer: Launchpad team <launchpad@lists.canonical.com>\n'
234 'http://launchpad.dev/ubuntutest/breezy-autotest/+source/foocomm/1.0-2\n')
228235
229 self.layer.switchDbUser('launchpad')236 self.layer.switchDbUser('launchpad')
230237
231238
=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
--- lib/lp/soyuz/tests/test_publishing.py 2009-09-10 08:56:15 +0000
+++ lib/lp/soyuz/tests/test_publishing.py 2009-10-13 12:21:14 +0000
@@ -385,6 +385,41 @@
385 return [BinaryPackagePublishingHistory.get(pub.id)385 return [BinaryPackagePublishingHistory.get(pub.id)
386 for pub in secure_pub_binaries]386 for pub in secure_pub_binaries]
387387
388 def _findChangesFile(self, top, name_fragment):
389 """File with given name fragment in directory tree starting at top."""
390 for root, dirs, files in os.walk(top, topdown=False):
391 for name in files:
392 if name.endswith('.changes') and name.find(name_fragment) > -1:
393 return os.path.join(root, name)
394 return None
395
396 def createSource(
397 self, archive, sourcename, version, distroseries=None,
398 new_version=None):
399 """Create source with meaningful '.changes' file."""
400 top = 'lib/lp/archiveuploader/tests/data/suite'
401 name_fragment = '%s_%s' % (sourcename, version)
402 changesfile_path = self._findChangesFile(top, name_fragment)
403
404 source = None
405
406 if changesfile_path is not None:
407 if new_version is None:
408 new_version = version
409 changesfile_content = ''
410 handle = open(changesfile_path, 'r')
411 try:
412 changesfile_content = handle.read()
413 finally:
414 handle.close()
415
416 source = self.getPubSource(
417 sourcename=sourcename, archive=archive, version=new_version,
418 changes_file_content=changesfile_content,
419 distroseries=distroseries)
420
421 return source
422
388423
389class TestNativePublishingBase(unittest.TestCase, SoyuzTestPublisher):424class TestNativePublishingBase(unittest.TestCase, SoyuzTestPublisher):
390 layer = LaunchpadZopelessLayer425 layer = LaunchpadZopelessLayer
391426
=== modified file 'versions.cfg'
--- versions.cfg 2009-10-07 10:57:23 +0000
+++ versions.cfg 2009-10-13 12:21:15 +0000
@@ -19,6 +19,7 @@
19feedvalidator = 0.0.0DEV-r104919feedvalidator = 0.0.0DEV-r1049
20functest = 0.8.720functest = 0.8.7
21funkload = 1.10.021funkload = 1.10.0
22grokcore.component = 1.6
22httplib2 = 0.4.023httplib2 = 0.4.0
23ipython = 0.9.124ipython = 0.9.1
24launchpadlib = 1.5.125launchpadlib = 1.5.1
@@ -27,10 +28,11 @@
27lazr.delegates = 1.1.028lazr.delegates = 1.1.0
28lazr.enum = 1.1.229lazr.enum = 1.1.2
29lazr.lifecycle = 1.030lazr.lifecycle = 1.0
30lazr.restful = 0.9.531lazr.restful = 0.9.11
31lazr.restfulclient = 0.9.532lazr.restfulclient = 0.9.5
32lazr.smtptest = 1.133lazr.smtptest = 1.1
33lazr.uri = 1.0.234lazr.uri = 1.0.2
35martian = 0.11
34mechanize = 0.1.7b36mechanize = 0.1.7b
35mocker = 0.10.137mocker = 0.10.1
36mozrunner = 1.3.438mozrunner = 1.3.4
@@ -62,6 +64,7 @@
62wsgi-intercept = 0.464wsgi-intercept = 0.4
63wsgi-jsonrpc = 0.2.865wsgi-jsonrpc = 0.2.8
64wsgi-xmlrpc = 0.2.766wsgi-xmlrpc = 0.2.7
67wsgiref = 0.1.2
65z3c.coverage = 1.1.268z3c.coverage = 1.1.2
66z3c.csvvocabulary = 1.0.069z3c.csvvocabulary = 1.0.0
67z3c.etestbrowser = 1.0.470z3c.etestbrowser = 1.0.4

Subscribers

People subscribed via source and target branches

to status/vote changes: