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 | 90 | @echo | 90 | @echo |
6 | 91 | @echo "Running the JavaScript integration test suite" | 91 | @echo "Running the JavaScript integration test suite" |
7 | 92 | @echo | 92 | @echo |
12 | 93 | bin/test $(VERBOSITY) --layer=BugsWindmillLayer | 93 | bin/test $(VERBOSITY) --layer=WindmillLayer |
9 | 94 | bin/test $(VERBOSITY) --layer=CodeWindmillLayer | ||
10 | 95 | bin/test $(VERBOSITY) --layer=RegistryWindmillLayer | ||
11 | 96 | bin/test $(VERBOSITY) --layer=SoyuzWindmillLayer | ||
13 | 97 | 94 | ||
14 | 98 | jscheck_functest: build | 95 | jscheck_functest: build |
15 | 99 | # Run the old functest Windmill integration tests. The test runner | 96 | # Run the old functest Windmill integration tests. The test runner |
16 | 100 | 97 | ||
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 | 77 | from canonical.launchpad.interfaces.account import ( | 77 | from canonical.launchpad.interfaces.account import ( |
22 | 78 | AccountCreationRationale, AccountStatus, IAccount, IAccountSet, | 78 | AccountCreationRationale, AccountStatus, IAccount, IAccountSet, |
23 | 79 | INACTIVE_ACCOUNT_STATUSES) | 79 | INACTIVE_ACCOUNT_STATUSES) |
25 | 80 | from lp.soyuz.interfaces.archive import ArchivePurpose, NoSuchPPA | 80 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
26 | 81 | from lp.soyuz.interfaces.archivepermission import ( | 81 | from lp.soyuz.interfaces.archivepermission import ( |
27 | 82 | IArchivePermissionSet) | 82 | IArchivePermissionSet) |
28 | 83 | from canonical.launchpad.interfaces.authtoken import LoginTokenType | 83 | from canonical.launchpad.interfaces.authtoken import LoginTokenType |
29 | @@ -2286,8 +2286,7 @@ | |||
30 | 2286 | @property | 2286 | @property |
31 | 2287 | def archive(self): | 2287 | def archive(self): |
32 | 2288 | """See `IPerson`.""" | 2288 | """See `IPerson`.""" |
35 | 2289 | return Archive.selectOneBy( | 2289 | return getUtility(IArchiveSet).getPPAOwnedByPerson(self) |
34 | 2290 | owner=self, purpose=ArchivePurpose.PPA, name='ppa') | ||
36 | 2291 | 2290 | ||
37 | 2292 | @property | 2291 | @property |
38 | 2293 | def ppas(self): | 2292 | def ppas(self): |
39 | @@ -2297,11 +2296,7 @@ | |||
40 | 2297 | 2296 | ||
41 | 2298 | def getPPAByName(self, name): | 2297 | def getPPAByName(self, name): |
42 | 2299 | """See `IPerson`.""" | 2298 | """See `IPerson`.""" |
48 | 2300 | ppa = Archive.selectOneBy( | 2299 | return getUtility(IArchiveSet).getPPAOwnedByPerson(self, name) |
44 | 2301 | owner=self, purpose=ArchivePurpose.PPA, name=name) | ||
45 | 2302 | if ppa is None: | ||
46 | 2303 | raise NoSuchPPA(name) | ||
47 | 2304 | return ppa | ||
49 | 2305 | 2300 | ||
50 | 2306 | def isBugContributor(self, user=None): | 2301 | def isBugContributor(self, user=None): |
51 | 2307 | """See `IPerson`.""" | 2302 | """See `IPerson`.""" |
52 | 2308 | 2303 | ||
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 | 1625 | 1625 | ||
58 | 1626 | schema = IPPAActivateForm | 1626 | schema = IPPAActivateForm |
59 | 1627 | custom_widget('description', TextAreaWidget, height=3) | 1627 | custom_widget('description', TextAreaWidget, height=3) |
60 | 1628 | label = "Personal Package Archive Activation" | ||
61 | 1628 | 1629 | ||
62 | 1629 | @property | 1630 | @property |
63 | 1630 | def ubuntu(self): | 1631 | def ubuntu(self): |
64 | 1631 | return getUtility(ILaunchpadCelebrities).ubuntu | 1632 | return getUtility(ILaunchpadCelebrities).ubuntu |
65 | 1632 | 1633 | ||
66 | 1634 | @property | ||
67 | 1635 | def initial_values(self): | ||
68 | 1636 | """Set up default values for form fields.""" | ||
69 | 1637 | # Suggest a default value of "ppa" for the name for the | ||
70 | 1638 | # first PPA activation. | ||
71 | 1639 | if self.context.archive is None: | ||
72 | 1640 | return {'name': 'ppa'} | ||
73 | 1641 | return {} | ||
74 | 1642 | |||
75 | 1633 | def setUpFields(self): | 1643 | def setUpFields(self): |
76 | 1634 | """Override `LaunchpadFormView`. | 1644 | """Override `LaunchpadFormView`. |
77 | 1635 | 1645 | ||
78 | 1636 | Reorder the fields in a way the make more sense to users and also | 1646 | Reorder the fields in a way the make more sense to users and also |
81 | 1637 | omit 'name' and present a checkbox for acknowledging the PPA-ToS | 1647 | present a checkbox for acknowledging the PPA-ToS if the user is |
82 | 1638 | if the user is creating his first PPA. | 1648 | creating his first PPA. |
83 | 1639 | """ | 1649 | """ |
84 | 1640 | LaunchpadFormView.setUpFields(self) | 1650 | LaunchpadFormView.setUpFields(self) |
85 | 1641 | 1651 | ||
86 | @@ -1644,7 +1654,7 @@ | |||
87 | 1644 | 'name', 'displayname', 'description') | 1654 | 'name', 'displayname', 'description') |
88 | 1645 | else: | 1655 | else: |
89 | 1646 | self.form_fields = self.form_fields.select( | 1656 | self.form_fields = self.form_fields.select( |
91 | 1647 | 'displayname', 'accepted', 'description') | 1657 | 'name', 'displayname', 'accepted', 'description') |
92 | 1648 | 1658 | ||
93 | 1649 | def validate(self, data): | 1659 | def validate(self, data): |
94 | 1650 | """Ensure user has checked the 'accepted' checkbox.""" | 1660 | """Ensure user has checked the 'accepted' checkbox.""" |
95 | 1651 | 1661 | ||
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 | 1284 | >>> hoary = ubuntu.getSeries('hoary') | 1284 | >>> hoary = ubuntu.getSeries('hoary') |
101 | 1285 | >>> test_publisher.addFakeChroots(hoary) | 1285 | >>> test_publisher.addFakeChroots(hoary) |
102 | 1286 | >>> unused = test_publisher.setUpDefaultDistroSeries(hoary) | 1286 | >>> unused = test_publisher.setUpDefaultDistroSeries(hoary) |
125 | 1287 | >>> def _create_source(): | 1287 | >>> private_source = test_publisher.createSource( |
126 | 1288 | ... """Create source with meaningful '.changes' file.""" | 1288 | ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1') |
105 | 1289 | ... archive = cprov.archive | ||
106 | 1290 | ... version = '1.0-1' | ||
107 | 1291 | ... new_version = '2.0-1' | ||
108 | 1292 | ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) | ||
109 | 1293 | ... | ||
110 | 1294 | ... changesfile_content = '' | ||
111 | 1295 | ... handle = open(changesfile_path, 'r') | ||
112 | 1296 | ... try: | ||
113 | 1297 | ... changesfile_content = handle.read() | ||
114 | 1298 | ... finally: | ||
115 | 1299 | ... handle.close() | ||
116 | 1300 | ... | ||
117 | 1301 | ... changesfile_content = changesfile_content.replace( | ||
118 | 1302 | ... version, new_version) | ||
119 | 1303 | ... source = test_publisher.getPubSource( | ||
120 | 1304 | ... sourcename='foocomm', archive=archive, version=new_version, | ||
121 | 1305 | ... changes_file_content=changesfile_content, distroseries=hoary) | ||
122 | 1306 | ... | ||
123 | 1307 | ... return source | ||
124 | 1308 | >>> private_source = _create_source() | ||
127 | 1309 | >>> transaction.commit() | 1289 | >>> transaction.commit() |
128 | 1310 | 1290 | ||
129 | 1311 | Now, as Celso we will try to copy the just created 'private' source to | 1291 | Now, as Celso we will try to copy the just created 'private' source to |
130 | 1312 | 1292 | ||
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 | 1621 | PPA for Celso Providelo | 1621 | PPA for Celso Providelo |
136 | 1622 | PPA for Launchpad Buildd Admins | 1622 | PPA for Launchpad Buildd Admins |
137 | 1623 | 1623 | ||
139 | 1624 | The same happens for specific upload rights granted on 3rd-part | 1624 | The same happens for specific upload rights granted on 3rd-party |
140 | 1625 | PPAs. When 'No Privileges' gets upload rights to Celso's PPA, | 1625 | PPAs. When 'No Privileges' gets upload rights to Celso's PPA, |
141 | 1626 | it gets listed by `getPPAsForUser`. | 1626 | it gets listed by `getPPAsForUser`. |
142 | 1627 | 1627 | ||
143 | @@ -1647,6 +1647,23 @@ | |||
144 | 1647 | >>> jblack_ppas.count() | 1647 | >>> jblack_ppas.count() |
145 | 1648 | 0 | 1648 | 0 |
146 | 1649 | 1649 | ||
147 | 1650 | Another similar method, getPPAOwnedByPersonUser(), will return the named PPA | ||
148 | 1651 | owned by the person, or if the person is not supplied will default to the | ||
149 | 1652 | first PPA that the person created. | ||
150 | 1653 | |||
151 | 1654 | >>> print archive_set.getPPAOwnedByPerson(cprov).displayname | ||
152 | 1655 | PPA for Celso Providelo | ||
153 | 1656 | |||
154 | 1657 | >>> print archive_set.getPPAOwnedByPerson(cprov, name="ppa").displayname | ||
155 | 1658 | PPA for Celso Providelo | ||
156 | 1659 | |||
157 | 1660 | If the named PPA does not exist, a NoSuchPPA exception is raised. | ||
158 | 1661 | |||
159 | 1662 | >>> print archive_set.getPPAOwnedByPerson(cprov, name="goat").displayname | ||
160 | 1663 | Traceback (most recent call last): | ||
161 | 1664 | ... | ||
162 | 1665 | NoSuchPPA: No such ppa: 'goat'. | ||
163 | 1666 | |||
164 | 1650 | The method getPrivatePPAs() will return a result set of all PPAs that are | 1667 | The method getPrivatePPAs() will return a result set of all PPAs that are |
165 | 1651 | private. | 1668 | private. |
166 | 1652 | 1669 | ||
167 | 1653 | 1670 | ||
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 | 1042 | >>> from lp.registry.interfaces.person import IPersonSet | 1042 | >>> from lp.registry.interfaces.person import IPersonSet |
173 | 1043 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | 1043 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
174 | 1044 | 1044 | ||
175 | 1045 | >>> def _create_source(): | ||
176 | 1046 | ... """Create source with meaningful '.changes' file.""" | ||
177 | 1047 | ... archive = cprov.archive | ||
178 | 1048 | ... version = '1.0-1' | ||
179 | 1049 | ... new_version = '2.0-1' | ||
180 | 1050 | ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) | ||
181 | 1051 | ... | ||
182 | 1052 | ... changesfile_content = '' | ||
183 | 1053 | ... handle = open(changesfile_path, 'r') | ||
184 | 1054 | ... try: | ||
185 | 1055 | ... changesfile_content = handle.read() | ||
186 | 1056 | ... finally: | ||
187 | 1057 | ... handle.close() | ||
188 | 1058 | ... | ||
189 | 1059 | ... changesfile_content = changesfile_content.replace( | ||
190 | 1060 | ... version, new_version) | ||
191 | 1061 | ... source = test_publisher.getPubSource( | ||
192 | 1062 | ... sourcename='foocomm', archive=archive, version=new_version, | ||
193 | 1063 | ... changes_file_content=changesfile_content, distroseries=hoary) | ||
194 | 1064 | ... | ||
195 | 1065 | ... return source | ||
196 | 1066 | |||
197 | 1067 | A 'delayed-copy' is a PackageUpload record. | 1045 | A 'delayed-copy' is a PackageUpload record. |
198 | 1068 | 1046 | ||
199 | 1069 | >>> delayed_copy = getUtility(IPackageUploadSet).createDelayedCopy( | 1047 | >>> delayed_copy = getUtility(IPackageUploadSet).createDelayedCopy( |
200 | @@ -1115,7 +1093,8 @@ | |||
201 | 1115 | Delayed copies are further manipulated exactly as normal uploads | 1093 | Delayed copies are further manipulated exactly as normal uploads |
202 | 1116 | are. Contents can be attached to it. | 1094 | are. Contents can be attached to it. |
203 | 1117 | 1095 | ||
205 | 1118 | >>> a_source_package = _create_source() | 1096 | >>> a_source_package = test_publisher.createSource( |
206 | 1097 | ... cprov.archive, 'foocomm', '1.0-1', new_version='2.0-1') | ||
207 | 1119 | >>> transaction.commit() | 1098 | >>> transaction.commit() |
208 | 1120 | >>> unused = delayed_copy.addSource(a_source_package.sourcepackagerelease) | 1099 | >>> unused = delayed_copy.addSource(a_source_package.sourcepackagerelease) |
209 | 1121 | 1100 | ||
210 | 1122 | 1101 | ||
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 | 1087 | 1087 | ||
216 | 1088 | name = TextLine( | 1088 | name = TextLine( |
217 | 1089 | title=_("PPA name"), required=True, constraint=name_validator, | 1089 | title=_("PPA name"), required=True, constraint=name_validator, |
219 | 1090 | description=_("A unique name used to identify this PPA.")) | 1090 | description=_("A unique name used to identify this PPA. It will " |
220 | 1091 | "form part of the URL to the archive repository.")) | ||
221 | 1091 | 1092 | ||
222 | 1092 | displayname = StrippedTextLine( | 1093 | displayname = StrippedTextLine( |
223 | 1093 | title=_("Displayname"), required=True, | 1094 | title=_("Displayname"), required=True, |
225 | 1094 | description=_("Displayname for this PPA.")) | 1095 | description=_("Displayname for this PPA. It will be used in " |
226 | 1096 | "the signing key's description if this is the " | ||
227 | 1097 | "first PPA for a person.")) | ||
228 | 1095 | 1098 | ||
229 | 1096 | description = Text( | 1099 | description = Text( |
230 | 1097 | title=_("PPA contents description"), required=False, | 1100 | title=_("PPA contents description"), required=False, |
231 | @@ -1182,6 +1185,18 @@ | |||
232 | 1182 | def __iter__(): | 1185 | def __iter__(): |
233 | 1183 | """Iterates over existent archives, including the main_archives.""" | 1186 | """Iterates over existent archives, including the main_archives.""" |
234 | 1184 | 1187 | ||
235 | 1188 | def getPPAOwnedByPerson(person, name=None): | ||
236 | 1189 | """Return the named PPA owned by person. | ||
237 | 1190 | |||
238 | 1191 | :param person: An `IPerson` | ||
239 | 1192 | :param name: The PPA name required. | ||
240 | 1193 | |||
241 | 1194 | If the person is not supplied it will default to the | ||
242 | 1195 | first PPA that the person created. | ||
243 | 1196 | |||
244 | 1197 | :raises NoSuchPPA: if the named PPA does not exist. | ||
245 | 1198 | """ | ||
246 | 1199 | |||
247 | 1185 | def getPPAsForUser(user): | 1200 | def getPPAsForUser(user): |
248 | 1186 | """Return all PPAs the given user can participate. | 1201 | """Return all PPAs the given user can participate. |
249 | 1187 | 1202 | ||
250 | 1188 | 1203 | ||
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 | 508 | "Return an ISourcePackage meta object correspondent to the " | 508 | "Return an ISourcePackage meta object correspondent to the " |
256 | 509 | "sourcepackagerelease attribute inside a specific distroseries") | 509 | "sourcepackagerelease attribute inside a specific distroseries") |
257 | 510 | meta_sourcepackagerelease = Attribute( | 510 | meta_sourcepackagerelease = Attribute( |
259 | 511 | "Return an IDistribuitionSourcePackageRelease meta object " | 511 | "Return an IDistributionSourcePackageRelease meta object " |
260 | 512 | "correspondent to the sourcepackagerelease attribute") | 512 | "correspondent to the sourcepackagerelease attribute") |
261 | 513 | meta_supersededby = Attribute( | 513 | meta_supersededby = Attribute( |
262 | 514 | "Return an IDistribuitionSourcePackageRelease meta object " | 514 | "Return an IDistribuitionSourcePackageRelease meta object " |
263 | 515 | 515 | ||
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 | 56 | AlreadySubscribed, ArchiveDependencyError, ArchiveNotPrivate, | 56 | AlreadySubscribed, ArchiveDependencyError, ArchiveNotPrivate, |
269 | 57 | ArchivePurpose, DistroSeriesNotFound, IArchive, IArchiveSet, | 57 | ArchivePurpose, DistroSeriesNotFound, IArchive, IArchiveSet, |
270 | 58 | IDistributionArchive, InvalidComponent, IPPA, MAIN_ARCHIVE_PURPOSES, | 58 | IDistributionArchive, InvalidComponent, IPPA, MAIN_ARCHIVE_PURPOSES, |
272 | 59 | PocketNotFound, VersionRequiresName, default_name_by_purpose) | 59 | NoSuchPPA, PocketNotFound, VersionRequiresName, default_name_by_purpose) |
273 | 60 | from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet | 60 | from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet |
274 | 61 | from lp.soyuz.interfaces.archivepermission import ( | 61 | from lp.soyuz.interfaces.archivepermission import ( |
275 | 62 | ArchivePermissionType, IArchivePermissionSet) | 62 | ArchivePermissionType, IArchivePermissionSet) |
276 | @@ -1405,6 +1405,19 @@ | |||
277 | 1405 | return 0 | 1405 | return 0 |
278 | 1406 | return int(size) | 1406 | return int(size) |
279 | 1407 | 1407 | ||
280 | 1408 | def getPPAOwnedByPerson(self, person, name=None): | ||
281 | 1409 | """See `IArchiveSet`.""" | ||
282 | 1410 | store = Store.of(person) | ||
283 | 1411 | clause = [ | ||
284 | 1412 | Archive.purpose == ArchivePurpose.PPA, | ||
285 | 1413 | Archive.owner == person] | ||
286 | 1414 | if name is not None: | ||
287 | 1415 | clause.append(Archive.name == name) | ||
288 | 1416 | result = store.find(Archive, *clause).order_by(Archive.id).first() | ||
289 | 1417 | if name is not None and result is None: | ||
290 | 1418 | raise NoSuchPPA(name) | ||
291 | 1419 | return result | ||
292 | 1420 | |||
293 | 1408 | def getPPAsForUser(self, user): | 1421 | def getPPAsForUser(self, user): |
294 | 1409 | """See `IArchiveSet`.""" | 1422 | """See `IArchiveSet`.""" |
295 | 1410 | # Avoiding circular imports. | 1423 | # Avoiding circular imports. |
296 | 1411 | 1424 | ||
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 | 367 | assert self.sources.count() == 1, ( | 367 | assert self.sources.count() == 1, ( |
302 | 368 | 'Source is mandatory for delayed copies.') | 368 | 'Source is mandatory for delayed copies.') |
303 | 369 | self.setAccepted() | 369 | self.setAccepted() |
304 | 370 | # The second assert guarantees that we'll actually have a SPR. | ||
305 | 371 | spr = self.mySourcePackageRelease() | ||
306 | 372 | # Use the changesfile of the original upload. | ||
307 | 373 | changes_file_object = StringIO.StringIO( | ||
308 | 374 | spr.package_upload.changesfile.read()) | ||
309 | 375 | self.notify( | ||
310 | 376 | announce_list=self.distroseries.changeslist, | ||
311 | 377 | changes_file_object=changes_file_object, allow_unsigned=True) | ||
312 | 378 | self.syncUpdate() | ||
313 | 379 | 370 | ||
314 | 380 | def rejectFromQueue(self, logger=None, dry_run=False): | 371 | def rejectFromQueue(self, logger=None, dry_run=False): |
315 | 381 | """See `IPackageUpload`.""" | 372 | """See `IPackageUpload`.""" |
316 | @@ -496,7 +487,8 @@ | |||
317 | 496 | else: | 487 | else: |
318 | 497 | return None | 488 | return None |
319 | 498 | 489 | ||
321 | 499 | def mySourcePackageRelease(self): | 490 | @property |
322 | 491 | def my_source_package_release(self): | ||
323 | 500 | """The source package release related to this queue item. | 492 | """The source package release related to this queue item. |
324 | 501 | 493 | ||
325 | 502 | al-maisan, Wed, 30 Sep 2009 17:58:31 +0200: | 494 | al-maisan, Wed, 30 Sep 2009 17:58:31 +0200: |
326 | @@ -548,6 +540,13 @@ | |||
327 | 548 | if self.is_delayed_copy: | 540 | if self.is_delayed_copy: |
328 | 549 | for pub_record in publishing_records: | 541 | for pub_record in publishing_records: |
329 | 550 | pub_record.overrideFromAncestry() | 542 | pub_record.overrideFromAncestry() |
330 | 543 | |||
331 | 544 | # Grab the .changes file of the original source package while | ||
332 | 545 | # it's available. | ||
333 | 546 | changes_file = None | ||
334 | 547 | if ISourcePackagePublishingHistory.providedBy(pub_record): | ||
335 | 548 | changes_file = pub_record.sourcepackagerelease.package_upload.changesfile | ||
336 | 549 | |||
337 | 551 | for new_file in update_files_privacy(pub_record): | 550 | for new_file in update_files_privacy(pub_record): |
338 | 552 | debug(logger, | 551 | debug(logger, |
339 | 553 | "Re-uploaded %s to librarian" % new_file.filename) | 552 | "Re-uploaded %s to librarian" % new_file.filename) |
340 | @@ -557,6 +556,17 @@ | |||
341 | 557 | pub_record.createMissingBuilds( | 556 | pub_record.createMissingBuilds( |
342 | 558 | pas_verify=pas_verify, logger=logger) | 557 | pas_verify=pas_verify, logger=logger) |
343 | 559 | 558 | ||
344 | 559 | if changes_file is not None: | ||
345 | 560 | debug( | ||
346 | 561 | logger, | ||
347 | 562 | "sending email to %s" % self.distroseries.changeslist) | ||
348 | 563 | changes_file_object = StringIO.StringIO(changes_file.read()) | ||
349 | 564 | self.notify( | ||
350 | 565 | announce_list=self.distroseries.changeslist, | ||
351 | 566 | changes_file_object=changes_file_object, | ||
352 | 567 | allow_unsigned=True, logger=logger) | ||
353 | 568 | self.syncUpdate() | ||
354 | 569 | |||
355 | 560 | self.setDone() | 570 | self.setDone() |
356 | 561 | 571 | ||
357 | 562 | return publishing_records | 572 | return publishing_records |
358 | @@ -726,7 +736,7 @@ | |||
359 | 726 | message.ORIGIN = '\nOrigin: %s' % changes['origin'] | 736 | message.ORIGIN = '\nOrigin: %s' % changes['origin'] |
360 | 727 | 737 | ||
361 | 728 | if self.sources or self.builds: | 738 | if self.sources or self.builds: |
363 | 729 | message.SPR_URL = canonical_url(self.mySourcePackageRelease()) | 739 | message.SPR_URL = canonical_url(self.my_source_package_release) |
364 | 730 | 740 | ||
365 | 731 | def _sendRejectionNotification( | 741 | def _sendRejectionNotification( |
366 | 732 | self, recipients, changes_lines, changes, summary_text, dry_run, | 742 | self, recipients, changes_lines, changes, summary_text, dry_run, |
367 | @@ -1123,7 +1133,7 @@ | |||
368 | 1123 | # the section of the source package uploaded in order to facilitate | 1133 | # the section of the source package uploaded in order to facilitate |
369 | 1124 | # filtering on the part of the email recipients. | 1134 | # filtering on the part of the email recipients. |
370 | 1125 | if self.sources: | 1135 | if self.sources: |
372 | 1126 | spr = self.mySourcePackageRelease() | 1136 | spr = self.my_source_package_release |
373 | 1127 | xlp_component_header = 'component=%s, section=%s' % ( | 1137 | xlp_component_header = 'component=%s, section=%s' % ( |
374 | 1128 | spr.component.name, spr.section.name) | 1138 | spr.component.name, spr.section.name) |
375 | 1129 | extra_headers['X-Launchpad-Component'] = xlp_component_header | 1139 | extra_headers['X-Launchpad-Component'] = xlp_component_header |
376 | 1130 | 1140 | ||
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 | 50 | TestCase, TestCaseWithFactory) | 50 | TestCase, TestCaseWithFactory) |
382 | 51 | 51 | ||
383 | 52 | 52 | ||
384 | 53 | def _create_source(test_publisher, archive): | ||
385 | 54 | """Create source with meaningful '.changes' file.""" | ||
386 | 55 | changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-2_binary/foocomm_1.0-2_i386.changes' | ||
387 | 56 | |||
388 | 57 | changesfile_content = '' | ||
389 | 58 | handle = open(changesfile_path, 'r') | ||
390 | 59 | try: | ||
391 | 60 | changesfile_content = handle.read() | ||
392 | 61 | finally: | ||
393 | 62 | handle.close() | ||
394 | 63 | |||
395 | 64 | source = test_publisher.getPubSource( | ||
396 | 65 | sourcename='foocomm', archive=archive, version='1.0-2', | ||
397 | 66 | changes_file_content=changesfile_content) | ||
398 | 67 | |||
399 | 68 | return source | ||
400 | 69 | |||
401 | 70 | |||
402 | 71 | class ReUploadFileTestCase(TestCaseWithFactory): | 53 | class ReUploadFileTestCase(TestCaseWithFactory): |
403 | 72 | """Test `ILibraryFileAlias` reupload helper. | 54 | """Test `ILibraryFileAlias` reupload helper. |
404 | 73 | 55 | ||
405 | @@ -788,7 +770,8 @@ | |||
406 | 788 | purpose=ArchivePurpose.PPA) | 770 | purpose=ArchivePurpose.PPA) |
407 | 789 | private_archive.buildd_secret = 'x' | 771 | private_archive.buildd_secret = 'x' |
408 | 790 | private_archive.private = True | 772 | private_archive.private = True |
410 | 791 | source = _create_source(self.test_publisher, private_archive) | 773 | source = self.test_publisher.createSource( |
411 | 774 | private_archive, 'foocomm', '1.0-2') | ||
412 | 792 | 775 | ||
413 | 793 | archive = self.test_publisher.ubuntutest.main_archive | 776 | archive = self.test_publisher.ubuntutest.main_archive |
414 | 794 | series = source.distroseries | 777 | series = source.distroseries |
415 | @@ -917,7 +900,7 @@ | |||
416 | 917 | ppa.buildd_secret = 'x' | 900 | ppa.buildd_secret = 'x' |
417 | 918 | ppa.private = True | 901 | ppa.private = True |
418 | 919 | 902 | ||
420 | 920 | source = _create_source(self.test_publisher, ppa) | 903 | source = self.test_publisher.createSource(ppa, 'foocomm', '1.0-2') |
421 | 921 | self.test_publisher.getPubBinaries(pub_source=source) | 904 | self.test_publisher.getPubBinaries(pub_source=source) |
422 | 922 | 905 | ||
423 | 923 | [build] = source.getBuilds() | 906 | [build] = source.getBuilds() |
424 | 924 | 907 | ||
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 | 68 | 68 | ||
430 | 69 | >>> jblack_browser.getLink('Create a new PPA').click() | 69 | >>> jblack_browser.getLink('Create a new PPA').click() |
431 | 70 | >>> print jblack_browser.title | 70 | >>> print jblack_browser.title |
433 | 71 | Activate Personal Package Archive... | 71 | Personal Package Archive Activation : James Blackwell |
434 | 72 | 72 | ||
435 | 73 | >>> jblack_browser.getControl( | 73 | >>> jblack_browser.getControl( |
436 | 74 | ... name="field.displayname").value = 'PPA for James Blackwell' | 74 | ... name="field.displayname").value = 'PPA for James Blackwell' |
437 | 75 | 75 | ||
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 | 33 | The form looks almost identical to that for a public team. | 33 | The form looks almost identical to that for a public team. |
443 | 34 | 34 | ||
444 | 35 | >>> browser.getLink('Create a new PPA').click() | 35 | >>> browser.getLink('Create a new PPA').click() |
447 | 36 | >>> browser.title | 36 | >>> print browser.title |
448 | 37 | 'Activate Personal Package Archive... | 37 | Personal Package Archive Activation : ...Private Team... |
449 | 38 | 38 | ||
450 | 39 | There is, however, an extra bit of information indicating the new PPA | 39 | There is, however, an extra bit of information indicating the new PPA |
451 | 40 | will be private. | 40 | will be private. |
452 | 41 | 41 | ||
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 | 36 | >>> sample_browser.getLink("Create a new PPA").click() | 36 | >>> sample_browser.getLink("Create a new PPA").click() |
458 | 37 | 37 | ||
459 | 38 | >>> print sample_browser.title | 38 | >>> print sample_browser.title |
461 | 39 | Activate Personal Package Archive... | 39 | Personal Package Archive Activation : Sample Person |
462 | 40 | 40 | ||
463 | 41 | This page presents a pointer to the current PPA-ToS (terms of service) | 41 | This page presents a pointer to the current PPA-ToS (terms of service) |
464 | 42 | with mandatory 'displayname' and checkbox ('accepted') fields. The | 42 | with mandatory 'displayname' and checkbox ('accepted') fields. The |
465 | @@ -54,7 +54,11 @@ | |||
466 | 54 | Activating this PPA will block future renaming of Sample Person | 54 | Activating this PPA will block future renaming of Sample Person |
467 | 55 | ... | 55 | ... |
468 | 56 | 56 | ||
470 | 57 | 'Displayname' is required. | 57 | 'PPA name' and 'Displayname' are required fields. For the first activated |
471 | 58 | PPA, the name is pre-filled with a suggestion of "ppa": | ||
472 | 59 | |||
473 | 60 | >>> print sample_browser.getControl(name="field.name").value | ||
474 | 61 | ppa | ||
475 | 58 | 62 | ||
476 | 59 | >>> sample_browser.getControl("Activate").click() | 63 | >>> sample_browser.getControl("Activate").click() |
477 | 60 | 64 | ||
478 | @@ -63,10 +67,12 @@ | |||
479 | 63 | There is 1 error. | 67 | There is 1 error. |
480 | 64 | Required input is missing. | 68 | Required input is missing. |
481 | 65 | 69 | ||
483 | 66 | By submitting the form without acknowledge the PPA-ToS results in a | 70 | By submitting the form without acknowledging the PPA-ToS results in a |
484 | 67 | error with a specific message. | 71 | error with a specific message. |
485 | 68 | 72 | ||
486 | 69 | >>> sample_browser.getControl( | 73 | >>> sample_browser.getControl( |
487 | 74 | ... name="field.name").value = 'sampleppa' | ||
488 | 75 | >>> sample_browser.getControl( | ||
489 | 70 | ... name="field.displayname").value = 'Sample PPA' | 76 | ... name="field.displayname").value = 'Sample PPA' |
490 | 71 | >>> sample_browser.getControl("Activate").click() | 77 | >>> sample_browser.getControl("Activate").click() |
491 | 72 | 78 | ||
492 | @@ -116,7 +122,7 @@ | |||
493 | 116 | PPA description | 122 | PPA description |
494 | 117 | Howdy, cowboys ! | 123 | Howdy, cowboys ! |
495 | 118 | 124 | ||
497 | 119 | Empty 'description' fields are not be rendered. | 125 | Empty 'description' fields are not rendered. |
498 | 120 | 126 | ||
499 | 121 | >>> sample_browser.getLink("Change details").click() | 127 | >>> sample_browser.getLink("Change details").click() |
500 | 122 | >>> sample_browser.getControl(name="field.description").value = ('') | 128 | >>> sample_browser.getControl(name="field.description").value = ('') |
501 | @@ -143,7 +149,7 @@ | |||
502 | 143 | There is 1 error. | 149 | There is 1 error. |
503 | 144 | Required input is missing. | 150 | Required input is missing. |
504 | 145 | 151 | ||
506 | 146 | Once the PPA is activated, Sample user account cannot be renamed | 152 | Once the PPA is activated, the Sample user account cannot be renamed |
507 | 147 | anymore. Changing the account name affects the PPA repository paths | 153 | anymore. Changing the account name affects the PPA repository paths |
508 | 148 | and we don't have infrastructure in place to support that yet. See | 154 | and we don't have infrastructure in place to support that yet. See |
509 | 149 | more information about the feature in bug #87326. | 155 | more information about the feature in bug #87326. |
510 | @@ -193,10 +199,12 @@ | |||
511 | 193 | 199 | ||
512 | 194 | >>> sample_browser.getLink('Create a new PPA').click() | 200 | >>> sample_browser.getLink('Create a new PPA').click() |
513 | 195 | 201 | ||
516 | 196 | >>> sample_browser.title | 202 | >>> print sample_browser.title |
517 | 197 | 'Activate Personal Package Archive... | 203 | Personal Package Archive Activation : ... |
518 | 198 | 204 | ||
519 | 199 | >>> sample_browser.getControl( | 205 | >>> sample_browser.getControl( |
520 | 206 | ... name="field.name").value = 'develppa' | ||
521 | 207 | >>> sample_browser.getControl( | ||
522 | 200 | ... name="field.displayname").value = 'Devel PPA' | 208 | ... name="field.displayname").value = 'Devel PPA' |
523 | 201 | >>> sample_browser.getControl(name="field.accepted").value = True | 209 | >>> sample_browser.getControl(name="field.accepted").value = True |
524 | 202 | >>> sample_browser.getControl( | 210 | >>> sample_browser.getControl( |
525 | @@ -285,6 +293,7 @@ | |||
526 | 285 | Create a new PPA | 293 | Create a new PPA |
527 | 286 | 294 | ||
528 | 287 | >>> admin_browser.getLink("Create a new PPA").click() | 295 | >>> admin_browser.getLink("Create a new PPA").click() |
529 | 296 | >>> admin_browser.getControl(name="field.name").value = 'hackppa' | ||
530 | 288 | >>> admin_browser.getControl( | 297 | >>> admin_browser.getControl( |
531 | 289 | ... name="field.displayname").value = 'Hack PPA' | 298 | ... name="field.displayname").value = 'Hack PPA' |
532 | 290 | >>> admin_browser.getControl(name="field.accepted").value = True | 299 | >>> admin_browser.getControl(name="field.accepted").value = True |
533 | @@ -330,7 +339,7 @@ | |||
534 | 330 | Trying to shortcut the URL as a non-privileged user does not work: | 339 | Trying to shortcut the URL as a non-privileged user does not work: |
535 | 331 | 340 | ||
536 | 332 | >>> sample_browser.open( | 341 | >>> sample_browser.open( |
538 | 333 | ... "http://launchpad.dev/~jblack/+archive/ppa/+admin") | 342 | ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin") |
539 | 334 | Traceback (most recent call last): | 343 | Traceback (most recent call last): |
540 | 335 | ... | 344 | ... |
541 | 336 | Unauthorized... | 345 | Unauthorized... |
542 | @@ -439,7 +448,8 @@ | |||
543 | 439 | 448 | ||
544 | 440 | >>> limit = 2 ** 31 - 1 | 449 | >>> limit = 2 ** 31 - 1 |
545 | 441 | 450 | ||
547 | 442 | >>> admin_browser.open("http://launchpad.dev/~jblack/+archive/ppa/+admin") | 451 | >>> admin_browser.open( |
548 | 452 | ... "http://launchpad.dev/~jblack/+archive/hackppa/+admin") | ||
549 | 443 | >>> admin_browser.getControl( | 453 | >>> admin_browser.getControl( |
550 | 444 | ... name="field.authorized_size").value = str(limit) | 454 | ... name="field.authorized_size").value = str(limit) |
551 | 445 | >>> admin_browser.getControl("Save").click() | 455 | >>> admin_browser.getControl("Save").click() |
552 | @@ -493,11 +503,13 @@ | |||
553 | 493 | Prepare the forms in both browsers to activate the default PPA for the | 503 | Prepare the forms in both browsers to activate the default PPA for the |
554 | 494 | user 'Foo Bar'. | 504 | user 'Foo Bar'. |
555 | 495 | 505 | ||
556 | 506 | >>> browser1.getControl(name="field.name").value = 'boomppa' | ||
557 | 496 | >>> browser1.getControl(name="field.displayname").value = 'Boom PPA' | 507 | >>> browser1.getControl(name="field.displayname").value = 'Boom PPA' |
558 | 497 | >>> browser1.getControl(name="field.accepted").value = True | 508 | >>> browser1.getControl(name="field.accepted").value = True |
559 | 498 | >>> browser1.getControl( | 509 | >>> browser1.getControl( |
560 | 499 | ... name="field.description").value = 'PPA rocks!' | 510 | ... name="field.description").value = 'PPA rocks!' |
561 | 500 | 511 | ||
562 | 512 | >>> browser2.getControl(name="field.name").value = 'boomppa' | ||
563 | 501 | >>> browser2.getControl(name="field.displayname").value = 'Boom PPA' | 513 | >>> browser2.getControl(name="field.displayname").value = 'Boom PPA' |
564 | 502 | >>> browser2.getControl(name="field.accepted").value = True | 514 | >>> browser2.getControl(name="field.accepted").value = True |
565 | 503 | >>> browser2.getControl( | 515 | >>> browser2.getControl( |
566 | @@ -523,18 +535,16 @@ | |||
567 | 523 | >>> for error in get_feedback_messages(browser2.contents): | 535 | >>> for error in get_feedback_messages(browser2.contents): |
568 | 524 | ... print error | 536 | ... print error |
569 | 525 | There is 1 error. | 537 | There is 1 error. |
582 | 526 | The default PPA is already activated. | 538 | You already have a PPA named 'boomppa'. |
583 | 527 | Please specify a name for the new PPA and resubmit the form. | 539 | |
584 | 528 | 540 | >>> print browser2.getControl(name="field.name").value | |
585 | 529 | >>> browser2.getControl(name="field.name").value | 541 | boomppa |
586 | 530 | '' | 542 | |
587 | 531 | 543 | ||
588 | 532 | 544 | == Activating an additional PPA == | |
589 | 533 | == Activating a named PPA == | 545 | |
590 | 534 | 546 | Users who already have a PPA may activate a second one. That's the case for | |
591 | 535 | Users who already have a PPA may as well activate a second one. | 547 | Celso. |
580 | 536 | |||
581 | 537 | That's the case for Celso. | ||
592 | 538 | 548 | ||
593 | 539 | >>> cprov_browser.open("http://launchpad.dev/~cprov") | 549 | >>> cprov_browser.open("http://launchpad.dev/~cprov") |
594 | 540 | 550 | ||
595 | @@ -544,15 +554,15 @@ | |||
596 | 544 | Create a new PPA | 554 | Create a new PPA |
597 | 545 | 555 | ||
598 | 546 | Celso can simply click on 'Create a new PPA' and will be presented to | 556 | Celso can simply click on 'Create a new PPA' and will be presented to |
602 | 547 | the usual PPA activation form where the checkbox for acknowledge the | 557 | the usual PPA activation form where the checkbox for acknowledging the |
603 | 548 | PPA-ToS is replaced by a 'name' field and a list of 'Existing PPAs'. | 558 | PPA-ToS is no longer present and a list of 'Existing PPAs' is presented. |
604 | 549 | Launchpad requires an user to acknowledge the PPA-ToS only once for | 559 | Launchpad requires a user to acknowledge the PPA-ToS only once for |
605 | 550 | all his PPAs. | 560 | all his PPAs. |
606 | 551 | 561 | ||
607 | 552 | >>> cprov_browser.getLink("Create a new PPA").click() | 562 | >>> cprov_browser.getLink("Create a new PPA").click() |
608 | 553 | 563 | ||
609 | 554 | >>> print cprov_browser.title | 564 | >>> print cprov_browser.title |
611 | 555 | Activate Personal Package Archive... | 565 | Personal Package Archive Activation : Celso Providelo |
612 | 556 | 566 | ||
613 | 557 | >>> print_tag_with_id(cprov_browser.contents, 'ppas') | 567 | >>> print_tag_with_id(cprov_browser.contents, 'ppas') |
614 | 558 | Existing PPAs | 568 | Existing PPAs |
615 | @@ -566,12 +576,14 @@ | |||
616 | 566 | >>> print extract_text( | 576 | >>> print extract_text( |
617 | 567 | ... first_tag_by_class(cprov_browser.contents, 'form')) | 577 | ... first_tag_by_class(cprov_browser.contents, 'form')) |
618 | 568 | PPA name: | 578 | PPA name: |
620 | 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 |
621 | 580 | to the archive repository. | ||
622 | 570 | Displayname: | 581 | Displayname: |
624 | 571 | Displayname for this PPA. | 582 | Displayname for this PPA. It will be used in the signing key's |
625 | 583 | description if this is the first PPA for a person. | ||
626 | 572 | PPA contents description: (Optional) | 584 | PPA contents description: (Optional) |
629 | 573 | A short description of this PPA. URLs are allowed and will be | 585 | A short description of this PPA. URLs are allowed and will be rendered |
630 | 574 | rendered as links. | 586 | as links. |
631 | 575 | 587 | ||
632 | 576 | Note that, differently than the time when the first PPA was activated, | 588 | Note that, differently than the time when the first PPA was activated, |
633 | 577 | this time there is no warning about the fact that the context renaming | 589 | this time there is no warning about the fact that the context renaming |
634 | @@ -582,7 +594,11 @@ | |||
635 | 582 | ... first_tag_by_class(cprov_browser.contents, 'actions')) | 594 | ... first_tag_by_class(cprov_browser.contents, 'actions')) |
636 | 583 | or Cancel | 595 | or Cancel |
637 | 584 | 596 | ||
639 | 585 | If Celso does not fill 'PPA name' an error is raised. | 597 | The 'PPA name' field is not pre-filled and if Celso does not fill it then |
640 | 598 | an error is raised. | ||
641 | 599 | |||
642 | 600 | >>> print cprov_browser.getControl(name="field.name").value | ||
643 | 601 | <BLANKLINE> | ||
644 | 586 | 602 | ||
645 | 587 | >>> cprov_browser.getControl( | 603 | >>> cprov_browser.getControl( |
646 | 588 | ... name="field.displayname").value = 'Edge PPA' | 604 | ... name="field.displayname").value = 'Edge PPA' |
647 | 589 | 605 | ||
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 | 735 | 735 | ||
653 | 736 | Make Celso's PPA private and create a private source publication. | 736 | Make Celso's PPA private and create a private source publication. |
654 | 737 | 737 | ||
655 | 738 | >>> def _create_source(archive, version): | ||
656 | 739 | ... """Create source with meaningful '.changes' file.""" | ||
657 | 740 | ... changesfile_path = 'lib/lp/archiveuploader/tests/data/suite/foocomm_%s_binary/foocomm_%s_i386.changes' % ((version,)*2) | ||
658 | 741 | ... | ||
659 | 742 | ... changesfile_content = '' | ||
660 | 743 | ... handle = open(changesfile_path, 'r') | ||
661 | 744 | ... try: | ||
662 | 745 | ... changesfile_content = handle.read() | ||
663 | 746 | ... finally: | ||
664 | 747 | ... handle.close() | ||
665 | 748 | ... | ||
666 | 749 | ... source = test_publisher.getPubSource( | ||
667 | 750 | ... sourcename='foocomm', archive=archive, version=version, | ||
668 | 751 | ... changes_file_content=changesfile_content) | ||
669 | 752 | ... | ||
670 | 753 | ... return source | ||
671 | 754 | |||
672 | 755 | >>> login('foo.bar@canonical.com') | 738 | >>> login('foo.bar@canonical.com') |
673 | 756 | 739 | ||
674 | 757 | >>> cprov.archive.buildd_secret = 'boing' | 740 | >>> cprov.archive.buildd_secret = 'boing' |
675 | 758 | >>> cprov.archive.private = True | 741 | >>> cprov.archive.private = True |
676 | 759 | 742 | ||
678 | 760 | >>> private_publication = _create_source(cprov.archive, '1.0-1') | 743 | >>> private_publication = test_publisher.createSource( |
679 | 744 | ... cprov.archive, 'foocomm', '1.0-1') | ||
680 | 761 | 745 | ||
681 | 762 | >>> logout() | 746 | >>> logout() |
682 | 763 | 747 | ||
683 | @@ -924,7 +908,8 @@ | |||
684 | 924 | version. | 908 | version. |
685 | 925 | 909 | ||
686 | 926 | >>> login('foo.bar@canonical.com') | 910 | >>> login('foo.bar@canonical.com') |
688 | 927 | >>> unused = _create_source(cprov.archive, '1.0-2') | 911 | >>> unused = test_publisher.createSource( |
689 | 912 | ... cprov.archive, 'foocomm', '1.0-2') | ||
690 | 928 | >>> logout() | 913 | >>> logout() |
691 | 929 | 914 | ||
692 | 930 | >>> print cprov_webservice.named_post( | 915 | >>> print cprov_webservice.named_post( |
693 | 931 | 916 | ||
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 | 8 | > | 8 | > |
699 | 9 | <body> | 9 | <body> |
700 | 10 | 10 | ||
701 | 11 | <div metal:fill-slot="heading"> | ||
702 | 12 | <h1>Personal Package Archive Activation</h1> | ||
703 | 13 | </div> | ||
704 | 14 | |||
705 | 15 | <div metal:fill-slot="main"> | 11 | <div metal:fill-slot="main"> |
706 | 16 | <div class="top-portlet"> | 12 | <div class="top-portlet"> |
707 | 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. |
708 | 18 | 14 | ||
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 | 198 | self.assertEquals( | 198 | self.assertEquals( |
714 | 199 | PackageUploadStatus.ACCEPTED, delayed_copy.status) | 199 | PackageUploadStatus.ACCEPTED, delayed_copy.status) |
715 | 200 | 200 | ||
716 | 201 | # Make sure no announcement email was sent at this point. | ||
717 | 202 | self.assertEquals(len(stub.test_emails), 0) | ||
718 | 203 | |||
719 | 201 | self.layer.txn.commit() | 204 | self.layer.txn.commit() |
720 | 202 | self.layer.switchDbUser(self.dbuser) | 205 | self.layer.switchDbUser(self.dbuser) |
721 | 203 | 206 | ||
722 | @@ -210,21 +213,25 @@ | |||
723 | 210 | 213 | ||
724 | 211 | # Check the announcement email. | 214 | # Check the announcement email. |
725 | 212 | from_addr, to_addrs, raw_msg = stub.test_emails.pop() | 215 | from_addr, to_addrs, raw_msg = stub.test_emails.pop() |
726 | 213 | # This is now a MIMEMultipart message. | ||
727 | 214 | msg = message_from_string(raw_msg) | 216 | msg = message_from_string(raw_msg) |
728 | 215 | body = msg.get_payload(0) | 217 | body = msg.get_payload(0) |
729 | 216 | body = body.get_payload(decode=True) | 218 | body = body.get_payload(decode=True) |
730 | 217 | 219 | ||
731 | 218 | self.assertEquals(from_addr, 'bounces@canonical.com') | ||
732 | 219 | self.assertEquals( | 220 | self.assertEquals( |
734 | 220 | to_addrs, ['breezy-autotest-changes@lists.ubuntu.com']) | 221 | str(to_addrs), "['breezy-autotest-changes@lists.ubuntu.com']") |
735 | 221 | 222 | ||
736 | 222 | expected_subject = ( | 223 | expected_subject = ( |
737 | 223 | '[ubuntutest/breezy-autotest-security]\n\t' | 224 | '[ubuntutest/breezy-autotest-security]\n\t' |
738 | 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)') |
739 | 225 | self.assertEquals(msg['Subject'], expected_subject) | 226 | self.assertEquals(msg['Subject'], expected_subject) |
740 | 226 | 227 | ||
742 | 227 | self.assertTrue(body.startswith('foocomm (1.0-2) breezy; urgency=low')) | 228 | self.assertEquals(body, |
743 | 229 | 'foocomm (1.0-2) breezy; urgency=low\n\n' | ||
744 | 230 | ' * Initial version\n\n' | ||
745 | 231 | 'Date: Thu, 16 Feb 2006 15:34:09 +0000\n' | ||
746 | 232 | 'Changed-By: Foo Bar <foo.bar@canonical.com>\n' | ||
747 | 233 | 'Maintainer: Launchpad team <launchpad@lists.canonical.com>\n' | ||
748 | 234 | 'http://launchpad.dev/ubuntutest/breezy-autotest/+source/foocomm/1.0-2\n') | ||
749 | 228 | 235 | ||
750 | 229 | self.layer.switchDbUser('launchpad') | 236 | self.layer.switchDbUser('launchpad') |
751 | 230 | 237 | ||
752 | 231 | 238 | ||
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 | 385 | return [BinaryPackagePublishingHistory.get(pub.id) | 385 | return [BinaryPackagePublishingHistory.get(pub.id) |
758 | 386 | for pub in secure_pub_binaries] | 386 | for pub in secure_pub_binaries] |
759 | 387 | 387 | ||
760 | 388 | def _findChangesFile(self, top, name_fragment): | ||
761 | 389 | """File with given name fragment in directory tree starting at top.""" | ||
762 | 390 | for root, dirs, files in os.walk(top, topdown=False): | ||
763 | 391 | for name in files: | ||
764 | 392 | if name.endswith('.changes') and name.find(name_fragment) > -1: | ||
765 | 393 | return os.path.join(root, name) | ||
766 | 394 | return None | ||
767 | 395 | |||
768 | 396 | def createSource( | ||
769 | 397 | self, archive, sourcename, version, distroseries=None, | ||
770 | 398 | new_version=None): | ||
771 | 399 | """Create source with meaningful '.changes' file.""" | ||
772 | 400 | top = 'lib/lp/archiveuploader/tests/data/suite' | ||
773 | 401 | name_fragment = '%s_%s' % (sourcename, version) | ||
774 | 402 | changesfile_path = self._findChangesFile(top, name_fragment) | ||
775 | 403 | |||
776 | 404 | source = None | ||
777 | 405 | |||
778 | 406 | if changesfile_path is not None: | ||
779 | 407 | if new_version is None: | ||
780 | 408 | new_version = version | ||
781 | 409 | changesfile_content = '' | ||
782 | 410 | handle = open(changesfile_path, 'r') | ||
783 | 411 | try: | ||
784 | 412 | changesfile_content = handle.read() | ||
785 | 413 | finally: | ||
786 | 414 | handle.close() | ||
787 | 415 | |||
788 | 416 | source = self.getPubSource( | ||
789 | 417 | sourcename=sourcename, archive=archive, version=new_version, | ||
790 | 418 | changes_file_content=changesfile_content, | ||
791 | 419 | distroseries=distroseries) | ||
792 | 420 | |||
793 | 421 | return source | ||
794 | 422 | |||
795 | 388 | 423 | ||
796 | 389 | class TestNativePublishingBase(unittest.TestCase, SoyuzTestPublisher): | 424 | class TestNativePublishingBase(unittest.TestCase, SoyuzTestPublisher): |
797 | 390 | layer = LaunchpadZopelessLayer | 425 | layer = LaunchpadZopelessLayer |
798 | 391 | 426 | ||
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 | 19 | feedvalidator = 0.0.0DEV-r1049 | 19 | feedvalidator = 0.0.0DEV-r1049 |
804 | 20 | functest = 0.8.7 | 20 | functest = 0.8.7 |
805 | 21 | funkload = 1.10.0 | 21 | funkload = 1.10.0 |
806 | 22 | grokcore.component = 1.6 | ||
807 | 22 | httplib2 = 0.4.0 | 23 | httplib2 = 0.4.0 |
808 | 23 | ipython = 0.9.1 | 24 | ipython = 0.9.1 |
809 | 24 | launchpadlib = 1.5.1 | 25 | launchpadlib = 1.5.1 |
810 | @@ -27,10 +28,11 @@ | |||
811 | 27 | lazr.delegates = 1.1.0 | 28 | lazr.delegates = 1.1.0 |
812 | 28 | lazr.enum = 1.1.2 | 29 | lazr.enum = 1.1.2 |
813 | 29 | lazr.lifecycle = 1.0 | 30 | lazr.lifecycle = 1.0 |
815 | 30 | lazr.restful = 0.9.5 | 31 | lazr.restful = 0.9.11 |
816 | 31 | lazr.restfulclient = 0.9.5 | 32 | lazr.restfulclient = 0.9.5 |
817 | 32 | lazr.smtptest = 1.1 | 33 | lazr.smtptest = 1.1 |
818 | 33 | lazr.uri = 1.0.2 | 34 | lazr.uri = 1.0.2 |
819 | 35 | martian = 0.11 | ||
820 | 34 | mechanize = 0.1.7b | 36 | mechanize = 0.1.7b |
821 | 35 | mocker = 0.10.1 | 37 | mocker = 0.10.1 |
822 | 36 | mozrunner = 1.3.4 | 38 | mozrunner = 1.3.4 |
823 | @@ -62,6 +64,7 @@ | |||
824 | 62 | wsgi-intercept = 0.4 | 64 | wsgi-intercept = 0.4 |
825 | 63 | wsgi-jsonrpc = 0.2.8 | 65 | wsgi-jsonrpc = 0.2.8 |
826 | 64 | wsgi-xmlrpc = 0.2.7 | 66 | wsgi-xmlrpc = 0.2.7 |
827 | 67 | wsgiref = 0.1.2 | ||
828 | 65 | z3c.coverage = 1.1.2 | 68 | z3c.coverage = 1.1.2 |
829 | 66 | z3c.csvvocabulary = 1.0.0 | 69 | z3c.csvvocabulary = 1.0.0 |
830 | 67 | z3c.etestbrowser = 1.0.4 | 70 | 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.