Merge lp:~rvb/launchpad/sync-bug-827608-credit-copy into lp:launchpad
- sync-bug-827608-credit-copy
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Raphaël Badin | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13997 | ||||
Proposed branch: | lp:~rvb/launchpad/sync-bug-827608-credit-copy | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~rvb/launchpad/sync-bug-827608-populate-ancestor | ||||
Diff against target: |
730 lines (+167/-124) 10 files modified
lib/lp/registry/browser/person.py (+32/-24) lib/lp/registry/doc/person.txt (+19/-15) lib/lp/registry/interfaces/person.py (+9/-7) lib/lp/registry/model/person.py (+34/-18) lib/lp/registry/templates/person-macros.pt (+10/-10) lib/lp/registry/templates/person-related-software.pt (+17/-17) lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+26/-13) lib/lp/soyuz/templates/person-maintained-packages.pt (+4/-4) lib/lp/soyuz/templates/person-ppa-packages.pt (+12/-12) lib/lp/soyuz/templates/person-uploaded-packages.pt (+4/-4) |
||||
To merge this branch: | bzr merge lp:~rvb/launchpad/sync-bug-827608-credit-copy | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Review via email: mp+74769@code.launchpad.net |
Commit message
Refactor _latestSeriesQuery to return SourcePackagePu
Description of the change
This branch is another step towards fixing 827608. The goal of this branch is to refactor _latestSeriesQuery (lib/lp/
The only catch is that the order of the objects in lib/lp/
= Tests =
(lots of tests are affected by this change)
./bin/test -vvc -t person.txt
./bin/test -vvc -t xx-person-
./bin/test -vvc test_person_view
= QA =
None.
Raphaël Badin (rvb) wrote : | # |
> This branch looks good. I'm a little concerned about the change in sort order
> from getLatestMainta
> pages. Hope it isn't jarring.
Thanks a lot for the review. I checked this with Julian and also had a few queries run on the production db to have an idea of the impact of this reordering. I think this really makes sense (the spph.datecreated is more accurate for what we want to show) and also the impact will be pretty minimal from what I can see looking at production data.
Raphaël Badin (rvb) wrote : | # |
Fixed failures in the doctests caused by the ordering of the returned objects (previously SPRs sorted by dateuploaded and now SPPHs sorted by datecreated).
Preview Diff
1 | === modified file 'lib/lp/registry/browser/person.py' |
2 | --- lib/lp/registry/browser/person.py 2011-09-13 05:23:16 +0000 |
3 | +++ lib/lp/registry/browser/person.py 2011-09-19 07:53:32 +0000 |
4 | @@ -326,7 +326,7 @@ |
5 | from lp.soyuz.interfaces.archive import IArchiveSet |
6 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
7 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
8 | -from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease |
9 | +from lp.soyuz.interfaces.publishing import ISourcePackagePublishingHistory |
10 | |
11 | |
12 | COMMASPACE = ', ' |
13 | @@ -5156,17 +5156,18 @@ |
14 | return Link('+subscribedquestions', text, summary, icon='question') |
15 | |
16 | |
17 | -class SourcePackageReleaseWithStats: |
18 | - """An ISourcePackageRelease, with extra stats added.""" |
19 | +class SourcePackagePublishingHistoryWithStats: |
20 | + """An ISourcePackagePublishinghistory, with extra stats added.""" |
21 | |
22 | - implements(ISourcePackageRelease) |
23 | - delegates(ISourcePackageRelease) |
24 | + implements(ISourcePackagePublishingHistory) |
25 | + delegates(ISourcePackagePublishingHistory) |
26 | failed_builds = None |
27 | needs_building = None |
28 | |
29 | - def __init__(self, sourcepackage_release, open_bugs, open_questions, |
30 | + def __init__(self, spph, open_bugs, open_questions, |
31 | failed_builds, needs_building): |
32 | - self.context = sourcepackage_release |
33 | + self.context = spph |
34 | + self.spr = spph.sourcepackagerelease |
35 | self.open_bugs = open_bugs |
36 | self.open_questions = open_questions |
37 | self.failed_builds = failed_builds |
38 | @@ -5255,7 +5256,7 @@ |
39 | |
40 | return header_message |
41 | |
42 | - def filterPPAPackageList(self, packages): |
43 | + def filterPPAPackageList(self, spphs): |
44 | """Remove packages that the user is not allowed to see. |
45 | |
46 | Given a list of PPA packages, some might be in a PPA that the |
47 | @@ -5269,14 +5270,15 @@ |
48 | # IPerson.getLatestUploadedPPAPackages() but formulating the SQL |
49 | # query is virtually impossible! |
50 | results = [] |
51 | - for package in packages: |
52 | + for spph in spphs: |
53 | + package = spph.sourcepackagerelease |
54 | # Make a shallow copy to remove the Zope security. |
55 | archives = set(package.published_archives) |
56 | # Ensure the SPR.upload_archive is also considered. |
57 | archives.add(package.upload_archive) |
58 | for archive in archives: |
59 | if check_permission('launchpad.View', archive): |
60 | - results.append(package) |
61 | + results.append(spph) |
62 | break |
63 | |
64 | return results |
65 | @@ -5329,10 +5331,10 @@ |
66 | self.uploaded_packages_header_message = header_message |
67 | return results |
68 | |
69 | - def _calculateBuildStats(self, package_releases): |
70 | + def _calculateBuildStats(self, spphs): |
71 | """Calculate failed builds and needs_build state. |
72 | |
73 | - For each of the package_releases, calculate the failed builds |
74 | + For each of the spphs, calculate the failed builds |
75 | and the needs_build state, and return a tuple of two dictionaries, |
76 | one containing the failed builds and the other containing |
77 | True or False according to the needs_build state, both keyed by |
78 | @@ -5341,14 +5343,15 @@ |
79 | # Calculate all the failed builds with one query. |
80 | build_set = getUtility(IBinaryPackageBuildSet) |
81 | package_release_ids = [ |
82 | - package_release.id for package_release in package_releases] |
83 | + spph.sourcepackagerelease.id for spph in spphs] |
84 | all_builds = build_set.getBuildsBySourcePackageRelease( |
85 | package_release_ids) |
86 | # Make a dictionary of lists of builds keyed by SourcePackageRelease |
87 | # and a dictionary of "needs build" state keyed by the same. |
88 | builds_by_package = {} |
89 | needs_build_by_package = {} |
90 | - for package in package_releases: |
91 | + for spph in spphs: |
92 | + package = spph.sourcepackagerelease |
93 | builds_by_package[package] = [] |
94 | needs_build_by_package[package] = False |
95 | for build in all_builds: |
96 | @@ -5363,11 +5366,14 @@ |
97 | |
98 | return (builds_by_package, needs_build_by_package) |
99 | |
100 | - def _addStatsToPackages(self, package_releases): |
101 | + def _addStatsToPackages(self, spphs): |
102 | """Add stats to the given package releases, and return them.""" |
103 | + filtered_spphs = [ |
104 | + spph for spph in spphs if |
105 | + check_permission('launchpad.View', spph)] |
106 | distro_packages = [ |
107 | - package_release.distrosourcepackage |
108 | - for package_release in package_releases] |
109 | + spph.sourcepackagerelease.distrosourcepackage |
110 | + for spph in filtered_spphs] |
111 | package_bug_counts = getUtility(IBugTaskSet).getBugCountsForPackages( |
112 | self.user, distro_packages) |
113 | open_bugs = {} |
114 | @@ -5380,15 +5386,17 @@ |
115 | distro_packages) |
116 | |
117 | builds_by_package, needs_build_by_package = self._calculateBuildStats( |
118 | - package_releases) |
119 | + filtered_spphs) |
120 | |
121 | return [ |
122 | - SourcePackageReleaseWithStats( |
123 | - package, open_bugs[package.distrosourcepackage], |
124 | - package_question_counts[package.distrosourcepackage], |
125 | - builds_by_package[package], |
126 | - needs_build_by_package[package]) |
127 | - for package in package_releases] |
128 | + SourcePackagePublishingHistoryWithStats( |
129 | + spph, |
130 | + open_bugs[spph.meta_sourcepackage.distribution_sourcepackage], |
131 | + package_question_counts[ |
132 | + spph.meta_sourcepackage.distribution_sourcepackage], |
133 | + builds_by_package[spph.sourcepackagerelease], |
134 | + needs_build_by_package[spph.sourcepackagerelease]) |
135 | + for spph in filtered_spphs] |
136 | |
137 | def setUpBatch(self, packages): |
138 | """Set up the batch navigation for the page being viewed. |
139 | |
140 | === modified file 'lib/lp/registry/doc/person.txt' |
141 | --- lib/lp/registry/doc/person.txt 2011-08-23 13:07:09 +0000 |
142 | +++ lib/lp/registry/doc/person.txt 2011-09-19 07:53:32 +0000 |
143 | @@ -958,31 +958,34 @@ |
144 | question to any PPA. |
145 | |
146 | >>> mark = personset.getByName('mark') |
147 | - >>> for sprelease in mark.getLatestMaintainedPackages(): |
148 | + >>> for spph in mark.getLatestMaintainedPackages(): |
149 | + ... sprelease = spph.sourcepackagerelease |
150 | ... print (sprelease.name, |
151 | ... sprelease.upload_distroseries.fullseriesname, |
152 | ... sprelease.version) |
153 | + (u'mozilla-firefox', u'Ubuntu Warty', u'0.9') |
154 | (u'alsa-utils', u'Debian Sid', u'1.0.9a-4') |
155 | + (u'alsa-utils', u'Ubuntu Warty', u'1.0.8-1ubuntu1') |
156 | (u'pmount', u'Ubuntu Hoary', u'0.1-2') |
157 | + (u'evolution', u'Ubuntu Hoary', u'1.0') |
158 | (u'netapplet', u'Ubuntu Warty', u'0.99.6-1') |
159 | (u'netapplet', u'Ubuntu Hoary', u'1.0-1') |
160 | - (u'alsa-utils', u'Ubuntu Warty', u'1.0.8-1ubuntu1') |
161 | - (u'mozilla-firefox', u'Ubuntu Warty', u'0.9') |
162 | - (u'evolution', u'Ubuntu Hoary', u'1.0') |
163 | |
164 | - >>> for sprelease in mark.getLatestUploadedButNotMaintainedPackages(): |
165 | + >>> for spph in mark.getLatestUploadedButNotMaintainedPackages(): |
166 | + ... sprelease = spph.sourcepackagerelease |
167 | ... print (sprelease.name, |
168 | ... sprelease.upload_distroseries.fullseriesname, |
169 | ... sprelease.version) |
170 | + (u'cdrkit', u'Ubuntu Breezy-autotest', u'1.0') |
171 | (u'foobar', u'Ubuntu Breezy-autotest', u'1.0') |
172 | - (u'cdrkit', u'Ubuntu Breezy-autotest', u'1.0') |
173 | - (u'libstdc++', u'Ubuntu Hoary', u'b8p') |
174 | - (u'cnews', u'Ubuntu Hoary', u'cr.g7-37') |
175 | (u'linux-source-2.6.15', u'Ubuntu Hoary', u'2.6.15.3') |
176 | (u'alsa-utils', u'Ubuntu Hoary', u'1.0.9a-4ubuntu1') |
177 | + (u'cnews', u'Ubuntu Hoary', u'cr.g7-37') |
178 | + (u'libstdc++', u'Ubuntu Hoary', u'b8p') |
179 | |
180 | - >>> mark_spreleases = mark.getLatestUploadedPPAPackages() |
181 | - >>> for sprelease in mark_spreleases: |
182 | + >>> mark_spphs = mark.getLatestUploadedPPAPackages() |
183 | + >>> for spph in mark_spphs: |
184 | + ... sprelease = spph.sourcepackagerelease |
185 | ... print (sprelease.name, |
186 | ... sprelease.version, |
187 | ... sprelease.creator.name, |
188 | @@ -995,13 +998,14 @@ |
189 | issue mentioned in bug 157303, where source with same creator and |
190 | maintainer got omitted from the results: |
191 | |
192 | - >>> any_spr = mark_spreleases[0] |
193 | - >>> naked_spr = removeSecurityProxy(any_spr) |
194 | - >>> naked_spr.maintainer = mark |
195 | + >>> any_spph = mark_spphs[0] |
196 | + >>> naked_spph = removeSecurityProxy(any_spph) |
197 | + >>> naked_spph.sourcepackagerelease.maintainer = mark |
198 | >>> flush_database_updates() |
199 | |
200 | - >>> mark_spreleases = mark.getLatestUploadedPPAPackages() |
201 | - >>> for sprelease in mark_spreleases: |
202 | + >>> mark_spphs = mark.getLatestUploadedPPAPackages() |
203 | + >>> for spph in mark_spphs: |
204 | + ... sprelease = spph.sourcepackagerelease |
205 | ... print (sprelease.name, |
206 | ... sprelease.version, |
207 | ... sprelease.creator.name, |
208 | |
209 | === modified file 'lib/lp/registry/interfaces/person.py' |
210 | --- lib/lp/registry/interfaces/person.py 2011-08-28 08:36:14 +0000 |
211 | +++ lib/lp/registry/interfaces/person.py 2011-09-19 07:53:32 +0000 |
212 | @@ -1234,24 +1234,26 @@ |
213 | """ |
214 | |
215 | def getLatestMaintainedPackages(): |
216 | - """Return `SourcePackageRelease`s maintained by this person. |
217 | + """Return `SourcePackagePublishingHistory`s related to SPRs maintained |
218 | + by this person. |
219 | |
220 | - This method will only include the latest source package release |
221 | + This method will only include the latest source package publishings |
222 | for each source package name, distribution series combination. |
223 | """ |
224 | |
225 | def getLatestUploadedButNotMaintainedPackages(): |
226 | - """Return `SourcePackageRelease`s created by this person but |
227 | - not maintained by him. |
228 | + """Return `SourcePackagePublishingHistory`s created by this person |
229 | + but not maintained by him. |
230 | |
231 | - This method will only include the latest source package release |
232 | + This method will only include the latest source package publishings |
233 | for each source package name, distribution series combination. |
234 | """ |
235 | |
236 | def getLatestUploadedPPAPackages(): |
237 | - """Return `SourcePackageRelease`s uploaded by this person to any PPA. |
238 | + """Return `SourcePackagePublishingHistory`s related to SPRs uploaded |
239 | + by this person to any PPA. |
240 | |
241 | - This method will only include the latest source package release |
242 | + This method will only include the latest source package publishings |
243 | for each source package name, distribution series combination. |
244 | """ |
245 | |
246 | |
247 | === modified file 'lib/lp/registry/model/person.py' |
248 | --- lib/lp/registry/model/person.py 2011-09-13 10:21:35 +0000 |
249 | +++ lib/lp/registry/model/person.py 2011-09-19 07:53:32 +0000 |
250 | @@ -33,7 +33,10 @@ |
251 | datetime, |
252 | timedelta, |
253 | ) |
254 | -from operator import attrgetter |
255 | +from operator import ( |
256 | + attrgetter, |
257 | + itemgetter, |
258 | + ) |
259 | import random |
260 | import re |
261 | import subprocess |
262 | @@ -297,7 +300,7 @@ |
263 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
264 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
265 | from lp.soyuz.model.archive import Archive |
266 | -from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
267 | +from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
268 | from lp.translations.model.hastranslationimports import ( |
269 | HasTranslationImportsMixin, |
270 | ) |
271 | @@ -2596,16 +2599,17 @@ |
272 | uploader_only=True, ppa_only=True) |
273 | |
274 | def _latestSeriesQuery(self, uploader_only=False, ppa_only=False): |
275 | - """Return the sourcepackagereleases (SPRs) related to this person. |
276 | + """Return the sourcepackagepublishinghistory (SPPHs) related to this |
277 | + person. |
278 | |
279 | - :param uploader_only: controls if we are interested in SPRs where |
280 | - the person in question is only the uploader (creator) and not the |
281 | - maintainer (debian-syncs) if the `ppa_only` parameter is also |
282 | - False, or, if the flag is False, it returns all SPR maintained |
283 | - by this person. |
284 | + :param uploader_only: controls if we are interested in SPPHs related |
285 | + to SPRs where the person in question is only the uploader |
286 | + (creator) and not the maintainer (debian-syncs) if the `ppa_only` |
287 | + parameter is also False, or, if the flag is False, it returns |
288 | + SPPHs related to SPRs maintained by this person. |
289 | |
290 | :param ppa_only: controls if we are interested only in source |
291 | - package releases targeted to any PPAs or, if False, sources |
292 | + package publishings targeted to any PPAs or, if False, sources |
293 | targeted to primary archives. |
294 | |
295 | Active 'ppa_only' flag is usually associated with active |
296 | @@ -2637,11 +2641,10 @@ |
297 | |
298 | query_clauses = " AND ".join(clauses) |
299 | query = """ |
300 | - SourcePackageRelease.id IN ( |
301 | SELECT DISTINCT ON (upload_distroseries, |
302 | sourcepackagerelease.sourcepackagename, |
303 | upload_archive) |
304 | - sourcepackagerelease.id |
305 | + spph.id |
306 | FROM sourcepackagerelease, archive, |
307 | sourcepackagepublishinghistory as spph |
308 | WHERE |
309 | @@ -2650,15 +2653,28 @@ |
310 | %(more_query_clauses)s |
311 | ORDER BY upload_distroseries, |
312 | sourcepackagerelease.sourcepackagename, |
313 | - upload_archive, dateuploaded DESC |
314 | - ) |
315 | + upload_archive, |
316 | + dateuploaded DESC, spph.datecreated DESC |
317 | """ % dict(more_query_clauses=query_clauses) |
318 | |
319 | - rset = SourcePackageRelease.select( |
320 | - query, |
321 | - orderBy=['-SourcePackageRelease.dateuploaded', |
322 | - 'SourcePackageRelease.id'], |
323 | - prejoins=['sourcepackagename', 'maintainer', 'upload_archive']) |
324 | + cur = cursor() |
325 | + cur.execute(query) |
326 | + spph_ids = map(itemgetter(0), cur.fetchall()) |
327 | + |
328 | + # is_in(x) does not behave if x is []. |
329 | + if len(spph_ids) == 0: |
330 | + return EmptyResultSet() |
331 | + |
332 | + rset = SourcePackagePublishingHistory.select( |
333 | + SourcePackagePublishingHistory.id.is_in(spph_ids), |
334 | + orderBy=[ |
335 | + '-datecreated', |
336 | + ], |
337 | + prejoins=[ |
338 | + 'sourcepackagerelease.sourcepackagename', |
339 | + 'sourcepackagerelease.maintainer', |
340 | + 'sourcepackagerelease.upload_archive', |
341 | + ]) |
342 | |
343 | return rset |
344 | |
345 | |
346 | === modified file 'lib/lp/registry/templates/person-macros.pt' |
347 | --- lib/lp/registry/templates/person-macros.pt 2011-07-14 05:12:43 +0000 |
348 | +++ lib/lp/registry/templates/person-macros.pt 2011-09-19 07:53:32 +0000 |
349 | @@ -120,15 +120,15 @@ |
350 | </div> |
351 | </metal:macro> |
352 | |
353 | -<metal:macro define-macro="sourcepackagerelease-rows"> |
354 | +<metal:macro define-macro="spph-rows"> |
355 | |
356 | <tal:comment replace="nothing"> |
357 | This macro expects the following variables defined: |
358 | - :sourcepackagereleases: A list of SourcePackageRelease objects |
359 | + :spphs: A list of SourcePackagePublishingHistory objects |
360 | </tal:comment> |
361 | |
362 | - <tr tal:repeat="sourcepackagerelease sourcepackagereleases"> |
363 | - <tal:define define="spr sourcepackagerelease; |
364 | + <tr tal:repeat="spph spphs"> |
365 | + <tal:define define="spr spph/sourcepackagerelease; |
366 | distroseries spr/upload_distroseries"> |
367 | <td> |
368 | <a tal:attributes="href string:${distroseries/distribution/fmt:url}/+source/${spr/name}" |
369 | @@ -154,27 +154,27 @@ |
370 | 2005-10-24 |
371 | </td> |
372 | <td> |
373 | - <tal:needs_building condition="spr/needs_building"> |
374 | + <tal:needs_building condition="spph/needs_building"> |
375 | Not yet built |
376 | </tal:needs_building> |
377 | - <tal:built condition="not: spr/needs_building"> |
378 | - <tal:failed repeat="build spr/failed_builds"> |
379 | + <tal:built condition="not: spph/needs_building"> |
380 | + <tal:failed repeat="build spph/failed_builds"> |
381 | <a tal:attributes="href build/fmt:url" |
382 | tal:content="build/distro_arch_series/architecturetag" /> |
383 | </tal:failed> |
384 | - <tal:not_failed condition="not: spr/failed_builds"> |
385 | + <tal:not_failed condition="not: spph/failed_builds"> |
386 | None |
387 | </tal:not_failed> |
388 | </tal:built> |
389 | </td> |
390 | <td style="text-align: right"> |
391 | <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+bugs" |
392 | - tal:content="spr/open_bugs"> |
393 | + tal:content="spph/open_bugs"> |
394 | </a> |
395 | </td> |
396 | <td style="text-align: right"> |
397 | <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions" |
398 | - tal:content="spr/open_questions"> |
399 | + tal:content="spph/open_questions"> |
400 | </a> |
401 | </td> |
402 | </tal:define> |
403 | |
404 | === modified file 'lib/lp/registry/templates/person-related-software.pt' |
405 | --- lib/lp/registry/templates/person-related-software.pt 2010-09-29 20:59:15 +0000 |
406 | +++ lib/lp/registry/templates/person-related-software.pt 2011-09-19 07:53:32 +0000 |
407 | @@ -21,8 +21,8 @@ |
408 | <div id="packages"> |
409 | |
410 | <tal:maintained-packages |
411 | - define="sourcepackagereleases view/latest_maintained_packages_with_stats" |
412 | - condition="sourcepackagereleases"> |
413 | + define="spphs view/latest_maintained_packages_with_stats" |
414 | + condition="spphs"> |
415 | |
416 | <div class="top-portlet"> |
417 | <h2>Maintained packages</h2> |
418 | @@ -41,15 +41,15 @@ |
419 | </tr> |
420 | </thead> |
421 | <tbody> |
422 | - <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" /> |
423 | + <div metal:use-macro="context/@@+person-macros/spph-rows" /> |
424 | </tbody> |
425 | </table> |
426 | </div> |
427 | </tal:maintained-packages> |
428 | |
429 | <tal:uploaded-packages |
430 | - define="sourcepackagereleases view/latest_uploaded_but_not_maintained_packages_with_stats" |
431 | - condition="sourcepackagereleases"> |
432 | + define="spphs view/latest_uploaded_but_not_maintained_packages_with_stats" |
433 | + condition="spphs"> |
434 | |
435 | <div class="top-portlet"> |
436 | <h2>Uploaded packages</h2> |
437 | @@ -68,14 +68,14 @@ |
438 | </tr> |
439 | </thead> |
440 | |
441 | - <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" /> |
442 | + <div metal:use-macro="context/@@+person-macros/spph-rows" /> |
443 | </table> |
444 | </div> |
445 | </tal:uploaded-packages> |
446 | |
447 | <tal:ppa-packages |
448 | - define="sourcepackagereleases view/latest_uploaded_ppa_packages_with_stats" |
449 | - condition="sourcepackagereleases"> |
450 | + define="spphs view/latest_uploaded_ppa_packages_with_stats" |
451 | + condition="spphs"> |
452 | |
453 | <div class="top-portlet"> |
454 | <h2>PPA packages</h2> |
455 | @@ -94,7 +94,7 @@ |
456 | </tr> |
457 | </thead> |
458 | |
459 | - <div metal:use-macro="template/macros/sourcepackagerelease-ppa-rows" /> |
460 | + <div metal:use-macro="template/macros/spph-ppa-rows" /> |
461 | </table> |
462 | </div> |
463 | </tal:ppa-packages> |
464 | @@ -153,14 +153,14 @@ |
465 | </div> |
466 | |
467 | <metal:macros fill-slot="bogus"> |
468 | -<metal:macro define-macro="sourcepackagerelease-ppa-rows"> |
469 | +<metal:macro define-macro="spph-ppa-rows"> |
470 | <tal:comment replace="nothing"> |
471 | This macro expects the following variables defined: |
472 | - :sourcepackagereleases: A list of SourcePackageRelease objects |
473 | + :spphs: A list of SourcePackagePublishingHistory objects |
474 | </tal:comment> |
475 | - <tr tal:repeat="sourcepackagerelease sourcepackagereleases" |
476 | + <tr tal:repeat="spph spphs" |
477 | class="ppa_row"> |
478 | - <tal:block define="spr sourcepackagerelease; |
479 | + <tal:block define="spr spph/sourcepackagerelease; |
480 | distroseries spr/upload_distroseries; |
481 | ppa spr/upload_archive"> |
482 | <td tal:content="spr/sourcepackagename/name"> |
483 | @@ -180,15 +180,15 @@ |
484 | 2005-10-24 |
485 | </td> |
486 | <td> |
487 | - <tal:block condition="spr/needs_building"> |
488 | + <tal:block condition="spph/needs_building"> |
489 | Not yet built |
490 | </tal:block> |
491 | - <tal:block condition="not: spr/needs_building"> |
492 | - <tal:block repeat="build spr/failed_builds"> |
493 | + <tal:block condition="not: spph/needs_building"> |
494 | + <tal:block repeat="build spph/failed_builds"> |
495 | <a tal:attributes="href build/fmt:url" |
496 | tal:content="build/distro_arch_series/architecturetag" /> |
497 | </tal:block> |
498 | - <tal:block condition="not: spr/failed_builds"> |
499 | + <tal:block condition="not: spph/failed_builds"> |
500 | None |
501 | </tal:block> |
502 | </tal:block> |
503 | |
504 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt' |
505 | --- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-12-17 23:17:55 +0000 |
506 | +++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2011-09-19 07:53:32 +0000 |
507 | @@ -96,6 +96,7 @@ |
508 | 1...5 of 7 results |
509 | ... |
510 | Name Uploaded to Version When Failures Bugs Questions |
511 | + ... |
512 | alsa-utils Debian Sid 1.0.9a-4 2005-07-01 None 0 0 |
513 | ... |
514 | |
515 | @@ -122,6 +123,7 @@ |
516 | 1...5 of 6 results |
517 | ... |
518 | Name Uploaded to Version When Failures Bugs Questions |
519 | + ... |
520 | foobar Ubuntu Breezy-autotest 1.0 2006-12-01 i386 0 0 |
521 | ... |
522 | |
523 | @@ -312,20 +314,28 @@ |
524 | |
525 | This makes the package appear in the listings again because the primary |
526 | archive is public. |
527 | +XXX: The public package should be displayed, this will be fixed in a dependant |
528 | +branch. |
529 | |
530 | >>> MemcachedLayer.purge() |
531 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") |
532 | - >>> print_ppa_rows(user_browser) |
533 | - source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
534 | - ...ago None - - |
535 | + >>> user_browser.getLink("Uploaded packages").click() |
536 | + >>> print extract_text(find_tag_by_id(user_browser.contents, 'packages')) |
537 | + ... |
538 | + Name Uploaded to Version When Failures Bugs Questions |
539 | + Celso Providelo has not uploaded any packages. |
540 | |
541 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") |
542 | - >>> print_ppa_rows(anon_browser) |
543 | - source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
544 | - ...ago None - - |
545 | + >>> anon_browser.getLink("Uploaded packages").click() |
546 | + >>> print extract_text(find_tag_by_id(anon_browser.contents, 'packages')) |
547 | + Name Uploaded to Version When Failures Bugs Questions |
548 | + Celso Providelo has not uploaded any packages. |
549 | |
550 | Even after the package is superseded, the package remains visibile in |
551 | the listings. |
552 | +XXX: The public package should be displayed, this will be fixed in a dependant |
553 | +branch. |
554 | + |
555 | |
556 | >>> login("foo.bar@canonical.com") |
557 | >>> discard = source1_ubuntu.supersede() |
558 | @@ -334,14 +344,17 @@ |
559 | |
560 | >>> MemcachedLayer.purge() |
561 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") |
562 | - >>> print_ppa_rows(user_browser) |
563 | - source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
564 | - ...ago None - - |
565 | + >>> user_browser.getLink("Uploaded packages").click() |
566 | + >>> print extract_text(find_tag_by_id(user_browser.contents, 'packages')) |
567 | + Name Uploaded to Version When Failures Bugs Questions |
568 | + Celso Providelo has not uploaded any packages. |
569 | |
570 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") |
571 | >>> print_ppa_rows(anon_browser) |
572 | - source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
573 | - ...ago None - - |
574 | + >>> anon_browser.getLink("Uploaded packages").click() |
575 | + >>> print extract_text(find_tag_by_id(anon_browser.contents, 'packages')) |
576 | + Name Uploaded to Version When Failures Bugs Questions |
577 | + Celso Providelo has not uploaded any packages. |
578 | |
579 | |
580 | Packages deleted from a PPA |
581 | @@ -356,10 +369,10 @@ |
582 | |
583 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") |
584 | >>> print_ppa_rows(admin_browser) |
585 | + source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666 |
586 | + ...ago None - - |
587 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
588 | ...ago None - - |
589 | - source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666 |
590 | - ...ago None - - |
591 | |
592 | Then delete the 'source2' package. |
593 | |
594 | |
595 | === modified file 'lib/lp/soyuz/templates/person-maintained-packages.pt' |
596 | --- lib/lp/soyuz/templates/person-maintained-packages.pt 2009-09-08 14:37:17 +0000 |
597 | +++ lib/lp/soyuz/templates/person-maintained-packages.pt 2011-09-19 07:53:32 +0000 |
598 | @@ -25,9 +25,9 @@ |
599 | replace="structure view/batchnav/@@+navigation-links-upper" /> |
600 | |
601 | <tal:maintained-packages |
602 | - define="sourcepackagereleases view/batch"> |
603 | + define="spphs view/batch"> |
604 | |
605 | - <table class="listing" condition="sourcepackagereleases"> |
606 | + <table class="listing" condition="spphs"> |
607 | <thead> |
608 | <tr> |
609 | <th>Name</th> |
610 | @@ -40,14 +40,14 @@ |
611 | </tr> |
612 | </thead> |
613 | <tbody> |
614 | - <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows"/> |
615 | + <div metal:use-macro="context/@@+person-macros/spph-rows"/> |
616 | </tbody> |
617 | </table> |
618 | |
619 | <tal:navigation_bottom |
620 | replace="structure view/batchnav/@@+navigation-links-lower" /> |
621 | |
622 | - <tal:no_packages condition="not: sourcepackagereleases"> |
623 | + <tal:no_packages condition="not: spphs"> |
624 | <tal:name replace="context/fmt:displayname"/> |
625 | does not maintain any packages. |
626 | </tal:no_packages> |
627 | |
628 | === modified file 'lib/lp/soyuz/templates/person-ppa-packages.pt' |
629 | --- lib/lp/soyuz/templates/person-ppa-packages.pt 2010-06-10 08:29:19 +0000 |
630 | +++ lib/lp/soyuz/templates/person-ppa-packages.pt 2011-09-19 07:53:32 +0000 |
631 | @@ -25,9 +25,9 @@ |
632 | replace="structure view/batchnav/@@+navigation-links-upper" /> |
633 | |
634 | <tal:ppa-packages |
635 | - define="sourcepackagereleases view/batch"> |
636 | + define="spphs view/batch"> |
637 | |
638 | - <table class="listing" condition="sourcepackagereleases"> |
639 | + <table class="listing" condition="spphs"> |
640 | <thead> |
641 | <tr> |
642 | <th>Name</th> |
643 | @@ -38,14 +38,14 @@ |
644 | </tr> |
645 | </thead> |
646 | <tbody> |
647 | - <div metal:use-macro="template/macros/sourcepackagerelease-ppa-rows" /> |
648 | + <div metal:use-macro="template/macros/spph-ppa-rows" /> |
649 | </tbody> |
650 | </table> |
651 | |
652 | <tal:navigation_bottom |
653 | replace="structure view/batchnav/@@+navigation-links-lower" /> |
654 | |
655 | - <tal:no_packages condition="not: sourcepackagereleases"> |
656 | + <tal:no_packages condition="not: spphs"> |
657 | <tal:name replace="context/fmt:displayname"/> has no related PPA packages. |
658 | </tal:no_packages> |
659 | |
660 | @@ -55,14 +55,14 @@ |
661 | </div> |
662 | |
663 | <metal:macros fill-slot="bogus"> |
664 | -<metal:macro define-macro="sourcepackagerelease-ppa-rows"> |
665 | +<metal:macro define-macro="spph-ppa-rows"> |
666 | <tal:comment replace="nothing"> |
667 | This macro expects the following variables defined: |
668 | - :sourcepackagereleases: A list of SourcePackageRelease objects |
669 | + :spphs: A list of SourcePackagePublishingHistory objects |
670 | </tal:comment> |
671 | - <tr tal:repeat="sourcepackagerelease sourcepackagereleases" |
672 | + <tr tal:repeat="spph spphs" |
673 | class="ppa_row"> |
674 | - <tal:block define="spr sourcepackagerelease; |
675 | + <tal:block define="spr spph/sourcepackagerelease; |
676 | distroseries spr/upload_distroseries; |
677 | ppa spr/upload_archive"> |
678 | <td tal:content="spr/sourcepackagename/name"> |
679 | @@ -82,15 +82,15 @@ |
680 | 2005-10-24 |
681 | </td> |
682 | <td> |
683 | - <tal:block condition="spr/needs_building"> |
684 | + <tal:block condition="spph/needs_building"> |
685 | Not yet built |
686 | </tal:block> |
687 | - <tal:block condition="not: spr/needs_building"> |
688 | - <tal:block repeat="build spr/failed_builds"> |
689 | + <tal:block condition="not: spph/needs_building"> |
690 | + <tal:block repeat="build spph/failed_builds"> |
691 | <a tal:attributes="href build/fmt:url" |
692 | tal:content="build/distro_arch_series/architecturetag" /> |
693 | </tal:block> |
694 | - <tal:block condition="not: spr/failed_builds"> |
695 | + <tal:block condition="not: spph/failed_builds"> |
696 | None |
697 | </tal:block> |
698 | </tal:block> |
699 | |
700 | === modified file 'lib/lp/soyuz/templates/person-uploaded-packages.pt' |
701 | --- lib/lp/soyuz/templates/person-uploaded-packages.pt 2009-09-08 14:37:17 +0000 |
702 | +++ lib/lp/soyuz/templates/person-uploaded-packages.pt 2011-09-19 07:53:32 +0000 |
703 | @@ -25,9 +25,9 @@ |
704 | replace="structure view/batchnav/@@+navigation-links-upper" /> |
705 | |
706 | <tal:uploaded-packages |
707 | - define="sourcepackagereleases view/batch"> |
708 | + define="spphs view/batch"> |
709 | |
710 | - <table class="listing" condition="sourcepackagereleases"> |
711 | + <table class="listing" condition="spphs"> |
712 | <thead> |
713 | <tr> |
714 | <th>Name</th> |
715 | @@ -40,14 +40,14 @@ |
716 | </tr> |
717 | </thead> |
718 | <tbody> |
719 | - <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" /> |
720 | + <div metal:use-macro="context/@@+person-macros/spph-rows" /> |
721 | </tbody> |
722 | </table> |
723 | |
724 | <tal:navigation_bottom |
725 | replace="structure view/batchnav/@@+navigation-links-lower" /> |
726 | |
727 | - <tal:no_packages condition="not: sourcepackagereleases"> |
728 | + <tal:no_packages condition="not: spphs"> |
729 | <tal:name replace="context/fmt:displayname"/> has not uploaded any packages. |
730 | </tal:no_packages> |
731 |
This branch looks good. I'm a little concerned about the change in sort order from getLatestMainta inedPackages as that change will be visible on the browser pages. Hope it isn't jarring.