Merge lp:~rvb/launchpad/sync-bug-827608-credit-copy into lp:launchpad

Proposed by Raphaël Badin
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
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 SourcePackagePublishingHistory objects instead of SourcePackageRelease objects.

Description of the change

This branch is another step towards fixing 827608. The goal of this branch is to refactor _latestSeriesQuery (lib/lp/registry/model/person.py) so that it returns SourcePackagePublishingHistory objects instead of SourcePackageRelease objects. We want that because we want to include (in another branch) in the returned SPPH objects the SPPHs which are the result of copying cross archive or cross distro, actions for which a user should be credit.

The only catch is that the order of the objects in lib/lp/registry/doc/person.txt has changed due to the fact that we order the result by spph.datecreated instead of spph.sourcepackagerelease.dateuploaded.

= Tests =

(lots of tests are affected by this change)
./bin/test -vvc -t person.txt
./bin/test -vvc -t xx-person-packages.txt
./bin/test -vvc test_person_view

= QA =

None.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

This branch looks good. I'm a little concerned about the change in sort order from getLatestMaintainedPackages as that change will be visible on the browser pages. Hope it isn't jarring.

review: Approve (code)
Revision history for this message
Raphaël Badin (rvb) wrote :

> This branch looks good. I'm a little concerned about the change in sort order
> from getLatestMaintainedPackages as that change will be visible on the browser
> 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.

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2011-09-13 05:23:16 +0000
+++ lib/lp/registry/browser/person.py 2011-09-19 07:53:32 +0000
@@ -326,7 +326,7 @@
326from lp.soyuz.interfaces.archive import IArchiveSet326from lp.soyuz.interfaces.archive import IArchiveSet
327from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet327from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet
328from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet328from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet
329from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease329from lp.soyuz.interfaces.publishing import ISourcePackagePublishingHistory
330330
331331
332COMMASPACE = ', '332COMMASPACE = ', '
@@ -5156,17 +5156,18 @@
5156 return Link('+subscribedquestions', text, summary, icon='question')5156 return Link('+subscribedquestions', text, summary, icon='question')
51575157
51585158
5159class SourcePackageReleaseWithStats:5159class SourcePackagePublishingHistoryWithStats:
5160 """An ISourcePackageRelease, with extra stats added."""5160 """An ISourcePackagePublishinghistory, with extra stats added."""
51615161
5162 implements(ISourcePackageRelease)5162 implements(ISourcePackagePublishingHistory)
5163 delegates(ISourcePackageRelease)5163 delegates(ISourcePackagePublishingHistory)
5164 failed_builds = None5164 failed_builds = None
5165 needs_building = None5165 needs_building = None
51665166
5167 def __init__(self, sourcepackage_release, open_bugs, open_questions,5167 def __init__(self, spph, open_bugs, open_questions,
5168 failed_builds, needs_building):5168 failed_builds, needs_building):
5169 self.context = sourcepackage_release5169 self.context = spph
5170 self.spr = spph.sourcepackagerelease
5170 self.open_bugs = open_bugs5171 self.open_bugs = open_bugs
5171 self.open_questions = open_questions5172 self.open_questions = open_questions
5172 self.failed_builds = failed_builds5173 self.failed_builds = failed_builds
@@ -5255,7 +5256,7 @@
52555256
5256 return header_message5257 return header_message
52575258
5258 def filterPPAPackageList(self, packages):5259 def filterPPAPackageList(self, spphs):
5259 """Remove packages that the user is not allowed to see.5260 """Remove packages that the user is not allowed to see.
52605261
5261 Given a list of PPA packages, some might be in a PPA that the5262 Given a list of PPA packages, some might be in a PPA that the
@@ -5269,14 +5270,15 @@
5269 # IPerson.getLatestUploadedPPAPackages() but formulating the SQL5270 # IPerson.getLatestUploadedPPAPackages() but formulating the SQL
5270 # query is virtually impossible!5271 # query is virtually impossible!
5271 results = []5272 results = []
5272 for package in packages:5273 for spph in spphs:
5274 package = spph.sourcepackagerelease
5273 # Make a shallow copy to remove the Zope security.5275 # Make a shallow copy to remove the Zope security.
5274 archives = set(package.published_archives)5276 archives = set(package.published_archives)
5275 # Ensure the SPR.upload_archive is also considered.5277 # Ensure the SPR.upload_archive is also considered.
5276 archives.add(package.upload_archive)5278 archives.add(package.upload_archive)
5277 for archive in archives:5279 for archive in archives:
5278 if check_permission('launchpad.View', archive):5280 if check_permission('launchpad.View', archive):
5279 results.append(package)5281 results.append(spph)
5280 break5282 break
52815283
5282 return results5284 return results
@@ -5329,10 +5331,10 @@
5329 self.uploaded_packages_header_message = header_message5331 self.uploaded_packages_header_message = header_message
5330 return results5332 return results
53315333
5332 def _calculateBuildStats(self, package_releases):5334 def _calculateBuildStats(self, spphs):
5333 """Calculate failed builds and needs_build state.5335 """Calculate failed builds and needs_build state.
53345336
5335 For each of the package_releases, calculate the failed builds5337 For each of the spphs, calculate the failed builds
5336 and the needs_build state, and return a tuple of two dictionaries,5338 and the needs_build state, and return a tuple of two dictionaries,
5337 one containing the failed builds and the other containing5339 one containing the failed builds and the other containing
5338 True or False according to the needs_build state, both keyed by5340 True or False according to the needs_build state, both keyed by
@@ -5341,14 +5343,15 @@
5341 # Calculate all the failed builds with one query.5343 # Calculate all the failed builds with one query.
5342 build_set = getUtility(IBinaryPackageBuildSet)5344 build_set = getUtility(IBinaryPackageBuildSet)
5343 package_release_ids = [5345 package_release_ids = [
5344 package_release.id for package_release in package_releases]5346 spph.sourcepackagerelease.id for spph in spphs]
5345 all_builds = build_set.getBuildsBySourcePackageRelease(5347 all_builds = build_set.getBuildsBySourcePackageRelease(
5346 package_release_ids)5348 package_release_ids)
5347 # Make a dictionary of lists of builds keyed by SourcePackageRelease5349 # Make a dictionary of lists of builds keyed by SourcePackageRelease
5348 # and a dictionary of "needs build" state keyed by the same.5350 # and a dictionary of "needs build" state keyed by the same.
5349 builds_by_package = {}5351 builds_by_package = {}
5350 needs_build_by_package = {}5352 needs_build_by_package = {}
5351 for package in package_releases:5353 for spph in spphs:
5354 package = spph.sourcepackagerelease
5352 builds_by_package[package] = []5355 builds_by_package[package] = []
5353 needs_build_by_package[package] = False5356 needs_build_by_package[package] = False
5354 for build in all_builds:5357 for build in all_builds:
@@ -5363,11 +5366,14 @@
53635366
5364 return (builds_by_package, needs_build_by_package)5367 return (builds_by_package, needs_build_by_package)
53655368
5366 def _addStatsToPackages(self, package_releases):5369 def _addStatsToPackages(self, spphs):
5367 """Add stats to the given package releases, and return them."""5370 """Add stats to the given package releases, and return them."""
5371 filtered_spphs = [
5372 spph for spph in spphs if
5373 check_permission('launchpad.View', spph)]
5368 distro_packages = [5374 distro_packages = [
5369 package_release.distrosourcepackage5375 spph.sourcepackagerelease.distrosourcepackage
5370 for package_release in package_releases]5376 for spph in filtered_spphs]
5371 package_bug_counts = getUtility(IBugTaskSet).getBugCountsForPackages(5377 package_bug_counts = getUtility(IBugTaskSet).getBugCountsForPackages(
5372 self.user, distro_packages)5378 self.user, distro_packages)
5373 open_bugs = {}5379 open_bugs = {}
@@ -5380,15 +5386,17 @@
5380 distro_packages)5386 distro_packages)
53815387
5382 builds_by_package, needs_build_by_package = self._calculateBuildStats(5388 builds_by_package, needs_build_by_package = self._calculateBuildStats(
5383 package_releases)5389 filtered_spphs)
53845390
5385 return [5391 return [
5386 SourcePackageReleaseWithStats(5392 SourcePackagePublishingHistoryWithStats(
5387 package, open_bugs[package.distrosourcepackage],5393 spph,
5388 package_question_counts[package.distrosourcepackage],5394 open_bugs[spph.meta_sourcepackage.distribution_sourcepackage],
5389 builds_by_package[package],5395 package_question_counts[
5390 needs_build_by_package[package])5396 spph.meta_sourcepackage.distribution_sourcepackage],
5391 for package in package_releases]5397 builds_by_package[spph.sourcepackagerelease],
5398 needs_build_by_package[spph.sourcepackagerelease])
5399 for spph in filtered_spphs]
53925400
5393 def setUpBatch(self, packages):5401 def setUpBatch(self, packages):
5394 """Set up the batch navigation for the page being viewed.5402 """Set up the batch navigation for the page being viewed.
53955403
=== modified file 'lib/lp/registry/doc/person.txt'
--- lib/lp/registry/doc/person.txt 2011-08-23 13:07:09 +0000
+++ lib/lp/registry/doc/person.txt 2011-09-19 07:53:32 +0000
@@ -958,31 +958,34 @@
958question to any PPA.958question to any PPA.
959959
960 >>> mark = personset.getByName('mark')960 >>> mark = personset.getByName('mark')
961 >>> for sprelease in mark.getLatestMaintainedPackages():961 >>> for spph in mark.getLatestMaintainedPackages():
962 ... sprelease = spph.sourcepackagerelease
962 ... print (sprelease.name,963 ... print (sprelease.name,
963 ... sprelease.upload_distroseries.fullseriesname,964 ... sprelease.upload_distroseries.fullseriesname,
964 ... sprelease.version)965 ... sprelease.version)
966 (u'mozilla-firefox', u'Ubuntu Warty', u'0.9')
965 (u'alsa-utils', u'Debian Sid', u'1.0.9a-4')967 (u'alsa-utils', u'Debian Sid', u'1.0.9a-4')
968 (u'alsa-utils', u'Ubuntu Warty', u'1.0.8-1ubuntu1')
966 (u'pmount', u'Ubuntu Hoary', u'0.1-2')969 (u'pmount', u'Ubuntu Hoary', u'0.1-2')
970 (u'evolution', u'Ubuntu Hoary', u'1.0')
967 (u'netapplet', u'Ubuntu Warty', u'0.99.6-1')971 (u'netapplet', u'Ubuntu Warty', u'0.99.6-1')
968 (u'netapplet', u'Ubuntu Hoary', u'1.0-1')972 (u'netapplet', u'Ubuntu Hoary', u'1.0-1')
969 (u'alsa-utils', u'Ubuntu Warty', u'1.0.8-1ubuntu1')
970 (u'mozilla-firefox', u'Ubuntu Warty', u'0.9')
971 (u'evolution', u'Ubuntu Hoary', u'1.0')
972973
973 >>> for sprelease in mark.getLatestUploadedButNotMaintainedPackages():974 >>> for spph in mark.getLatestUploadedButNotMaintainedPackages():
975 ... sprelease = spph.sourcepackagerelease
974 ... print (sprelease.name,976 ... print (sprelease.name,
975 ... sprelease.upload_distroseries.fullseriesname,977 ... sprelease.upload_distroseries.fullseriesname,
976 ... sprelease.version)978 ... sprelease.version)
979 (u'cdrkit', u'Ubuntu Breezy-autotest', u'1.0')
977 (u'foobar', u'Ubuntu Breezy-autotest', u'1.0')980 (u'foobar', u'Ubuntu Breezy-autotest', u'1.0')
978 (u'cdrkit', u'Ubuntu Breezy-autotest', u'1.0')
979 (u'libstdc++', u'Ubuntu Hoary', u'b8p')
980 (u'cnews', u'Ubuntu Hoary', u'cr.g7-37')
981 (u'linux-source-2.6.15', u'Ubuntu Hoary', u'2.6.15.3')981 (u'linux-source-2.6.15', u'Ubuntu Hoary', u'2.6.15.3')
982 (u'alsa-utils', u'Ubuntu Hoary', u'1.0.9a-4ubuntu1')982 (u'alsa-utils', u'Ubuntu Hoary', u'1.0.9a-4ubuntu1')
983 (u'cnews', u'Ubuntu Hoary', u'cr.g7-37')
984 (u'libstdc++', u'Ubuntu Hoary', u'b8p')
983985
984 >>> mark_spreleases = mark.getLatestUploadedPPAPackages()986 >>> mark_spphs = mark.getLatestUploadedPPAPackages()
985 >>> for sprelease in mark_spreleases:987 >>> for spph in mark_spphs:
988 ... sprelease = spph.sourcepackagerelease
986 ... print (sprelease.name,989 ... print (sprelease.name,
987 ... sprelease.version,990 ... sprelease.version,
988 ... sprelease.creator.name,991 ... sprelease.creator.name,
@@ -995,13 +998,14 @@
995issue mentioned in bug 157303, where source with same creator and998issue mentioned in bug 157303, where source with same creator and
996maintainer got omitted from the results:999maintainer got omitted from the results:
9971000
998 >>> any_spr = mark_spreleases[0]1001 >>> any_spph = mark_spphs[0]
999 >>> naked_spr = removeSecurityProxy(any_spr)1002 >>> naked_spph = removeSecurityProxy(any_spph)
1000 >>> naked_spr.maintainer = mark1003 >>> naked_spph.sourcepackagerelease.maintainer = mark
1001 >>> flush_database_updates()1004 >>> flush_database_updates()
10021005
1003 >>> mark_spreleases = mark.getLatestUploadedPPAPackages()1006 >>> mark_spphs = mark.getLatestUploadedPPAPackages()
1004 >>> for sprelease in mark_spreleases:1007 >>> for spph in mark_spphs:
1008 ... sprelease = spph.sourcepackagerelease
1005 ... print (sprelease.name,1009 ... print (sprelease.name,
1006 ... sprelease.version,1010 ... sprelease.version,
1007 ... sprelease.creator.name,1011 ... sprelease.creator.name,
10081012
=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py 2011-08-28 08:36:14 +0000
+++ lib/lp/registry/interfaces/person.py 2011-09-19 07:53:32 +0000
@@ -1234,24 +1234,26 @@
1234 """1234 """
12351235
1236 def getLatestMaintainedPackages():1236 def getLatestMaintainedPackages():
1237 """Return `SourcePackageRelease`s maintained by this person.1237 """Return `SourcePackagePublishingHistory`s related to SPRs maintained
1238 by this person.
12381239
1239 This method will only include the latest source package release1240 This method will only include the latest source package publishings
1240 for each source package name, distribution series combination.1241 for each source package name, distribution series combination.
1241 """1242 """
12421243
1243 def getLatestUploadedButNotMaintainedPackages():1244 def getLatestUploadedButNotMaintainedPackages():
1244 """Return `SourcePackageRelease`s created by this person but1245 """Return `SourcePackagePublishingHistory`s created by this person
1245 not maintained by him.1246 but not maintained by him.
12461247
1247 This method will only include the latest source package release1248 This method will only include the latest source package publishings
1248 for each source package name, distribution series combination.1249 for each source package name, distribution series combination.
1249 """1250 """
12501251
1251 def getLatestUploadedPPAPackages():1252 def getLatestUploadedPPAPackages():
1252 """Return `SourcePackageRelease`s uploaded by this person to any PPA.1253 """Return `SourcePackagePublishingHistory`s related to SPRs uploaded
1254 by this person to any PPA.
12531255
1254 This method will only include the latest source package release1256 This method will only include the latest source package publishings
1255 for each source package name, distribution series combination.1257 for each source package name, distribution series combination.
1256 """1258 """
12571259
12581260
=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py 2011-09-13 10:21:35 +0000
+++ lib/lp/registry/model/person.py 2011-09-19 07:53:32 +0000
@@ -33,7 +33,10 @@
33 datetime,33 datetime,
34 timedelta,34 timedelta,
35 )35 )
36from operator import attrgetter36from operator import (
37 attrgetter,
38 itemgetter,
39 )
37import random40import random
38import re41import re
39import subprocess42import subprocess
@@ -297,7 +300,7 @@
297from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet300from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet
298from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet301from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet
299from lp.soyuz.model.archive import Archive302from lp.soyuz.model.archive import Archive
300from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease303from lp.soyuz.model.publishing import SourcePackagePublishingHistory
301from lp.translations.model.hastranslationimports import (304from lp.translations.model.hastranslationimports import (
302 HasTranslationImportsMixin,305 HasTranslationImportsMixin,
303 )306 )
@@ -2596,16 +2599,17 @@
2596 uploader_only=True, ppa_only=True)2599 uploader_only=True, ppa_only=True)
25972600
2598 def _latestSeriesQuery(self, uploader_only=False, ppa_only=False):2601 def _latestSeriesQuery(self, uploader_only=False, ppa_only=False):
2599 """Return the sourcepackagereleases (SPRs) related to this person.2602 """Return the sourcepackagepublishinghistory (SPPHs) related to this
2603 person.
26002604
2601 :param uploader_only: controls if we are interested in SPRs where2605 :param uploader_only: controls if we are interested in SPPHs related
2602 the person in question is only the uploader (creator) and not the2606 to SPRs where the person in question is only the uploader
2603 maintainer (debian-syncs) if the `ppa_only` parameter is also2607 (creator) and not the maintainer (debian-syncs) if the `ppa_only`
2604 False, or, if the flag is False, it returns all SPR maintained2608 parameter is also False, or, if the flag is False, it returns
2605 by this person.2609 SPPHs related to SPRs maintained by this person.
26062610
2607 :param ppa_only: controls if we are interested only in source2611 :param ppa_only: controls if we are interested only in source
2608 package releases targeted to any PPAs or, if False, sources2612 package publishings targeted to any PPAs or, if False, sources
2609 targeted to primary archives.2613 targeted to primary archives.
26102614
2611 Active 'ppa_only' flag is usually associated with active2615 Active 'ppa_only' flag is usually associated with active
@@ -2637,11 +2641,10 @@
26372641
2638 query_clauses = " AND ".join(clauses)2642 query_clauses = " AND ".join(clauses)
2639 query = """2643 query = """
2640 SourcePackageRelease.id IN (
2641 SELECT DISTINCT ON (upload_distroseries,2644 SELECT DISTINCT ON (upload_distroseries,
2642 sourcepackagerelease.sourcepackagename,2645 sourcepackagerelease.sourcepackagename,
2643 upload_archive)2646 upload_archive)
2644 sourcepackagerelease.id2647 spph.id
2645 FROM sourcepackagerelease, archive,2648 FROM sourcepackagerelease, archive,
2646 sourcepackagepublishinghistory as spph2649 sourcepackagepublishinghistory as spph
2647 WHERE2650 WHERE
@@ -2650,15 +2653,28 @@
2650 %(more_query_clauses)s2653 %(more_query_clauses)s
2651 ORDER BY upload_distroseries,2654 ORDER BY upload_distroseries,
2652 sourcepackagerelease.sourcepackagename,2655 sourcepackagerelease.sourcepackagename,
2653 upload_archive, dateuploaded DESC2656 upload_archive,
2654 )2657 dateuploaded DESC, spph.datecreated DESC
2655 """ % dict(more_query_clauses=query_clauses)2658 """ % dict(more_query_clauses=query_clauses)
26562659
2657 rset = SourcePackageRelease.select(2660 cur = cursor()
2658 query,2661 cur.execute(query)
2659 orderBy=['-SourcePackageRelease.dateuploaded',2662 spph_ids = map(itemgetter(0), cur.fetchall())
2660 'SourcePackageRelease.id'],2663
2661 prejoins=['sourcepackagename', 'maintainer', 'upload_archive'])2664 # is_in(x) does not behave if x is [].
2665 if len(spph_ids) == 0:
2666 return EmptyResultSet()
2667
2668 rset = SourcePackagePublishingHistory.select(
2669 SourcePackagePublishingHistory.id.is_in(spph_ids),
2670 orderBy=[
2671 '-datecreated',
2672 ],
2673 prejoins=[
2674 'sourcepackagerelease.sourcepackagename',
2675 'sourcepackagerelease.maintainer',
2676 'sourcepackagerelease.upload_archive',
2677 ])
26622678
2663 return rset2679 return rset
26642680
26652681
=== modified file 'lib/lp/registry/templates/person-macros.pt'
--- lib/lp/registry/templates/person-macros.pt 2011-07-14 05:12:43 +0000
+++ lib/lp/registry/templates/person-macros.pt 2011-09-19 07:53:32 +0000
@@ -120,15 +120,15 @@
120 </div>120 </div>
121</metal:macro>121</metal:macro>
122122
123<metal:macro define-macro="sourcepackagerelease-rows">123<metal:macro define-macro="spph-rows">
124124
125 <tal:comment replace="nothing">125 <tal:comment replace="nothing">
126 This macro expects the following variables defined:126 This macro expects the following variables defined:
127 :sourcepackagereleases: A list of SourcePackageRelease objects127 :spphs: A list of SourcePackagePublishingHistory objects
128 </tal:comment>128 </tal:comment>
129129
130 <tr tal:repeat="sourcepackagerelease sourcepackagereleases">130 <tr tal:repeat="spph spphs">
131 <tal:define define="spr sourcepackagerelease;131 <tal:define define="spr spph/sourcepackagerelease;
132 distroseries spr/upload_distroseries">132 distroseries spr/upload_distroseries">
133 <td>133 <td>
134 <a tal:attributes="href string:${distroseries/distribution/fmt:url}/+source/${spr/name}"134 <a tal:attributes="href string:${distroseries/distribution/fmt:url}/+source/${spr/name}"
@@ -154,27 +154,27 @@
154 2005-10-24154 2005-10-24
155 </td>155 </td>
156 <td>156 <td>
157 <tal:needs_building condition="spr/needs_building">157 <tal:needs_building condition="spph/needs_building">
158 Not yet built158 Not yet built
159 </tal:needs_building>159 </tal:needs_building>
160 <tal:built condition="not: spr/needs_building">160 <tal:built condition="not: spph/needs_building">
161 <tal:failed repeat="build spr/failed_builds">161 <tal:failed repeat="build spph/failed_builds">
162 <a tal:attributes="href build/fmt:url"162 <a tal:attributes="href build/fmt:url"
163 tal:content="build/distro_arch_series/architecturetag" />163 tal:content="build/distro_arch_series/architecturetag" />
164 </tal:failed>164 </tal:failed>
165 <tal:not_failed condition="not: spr/failed_builds">165 <tal:not_failed condition="not: spph/failed_builds">
166 None166 None
167 </tal:not_failed>167 </tal:not_failed>
168 </tal:built>168 </tal:built>
169 </td>169 </td>
170 <td style="text-align: right">170 <td style="text-align: right">
171 <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+bugs"171 <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+bugs"
172 tal:content="spr/open_bugs">172 tal:content="spph/open_bugs">
173 </a>173 </a>
174 </td>174 </td>
175 <td style="text-align: right">175 <td style="text-align: right">
176 <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions"176 <a tal:attributes="href string:${spr/distrosourcepackage/fmt:url}/+questions"
177 tal:content="spr/open_questions">177 tal:content="spph/open_questions">
178 </a>178 </a>
179 </td>179 </td>
180 </tal:define>180 </tal:define>
181181
=== modified file 'lib/lp/registry/templates/person-related-software.pt'
--- lib/lp/registry/templates/person-related-software.pt 2010-09-29 20:59:15 +0000
+++ lib/lp/registry/templates/person-related-software.pt 2011-09-19 07:53:32 +0000
@@ -21,8 +21,8 @@
21 <div id="packages">21 <div id="packages">
2222
23 <tal:maintained-packages23 <tal:maintained-packages
24 define="sourcepackagereleases view/latest_maintained_packages_with_stats"24 define="spphs view/latest_maintained_packages_with_stats"
25 condition="sourcepackagereleases">25 condition="spphs">
2626
27 <div class="top-portlet">27 <div class="top-portlet">
28 <h2>Maintained packages</h2>28 <h2>Maintained packages</h2>
@@ -41,15 +41,15 @@
41 </tr>41 </tr>
42 </thead>42 </thead>
43 <tbody>43 <tbody>
44 <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" />44 <div metal:use-macro="context/@@+person-macros/spph-rows" />
45 </tbody>45 </tbody>
46 </table>46 </table>
47 </div>47 </div>
48 </tal:maintained-packages>48 </tal:maintained-packages>
4949
50 <tal:uploaded-packages50 <tal:uploaded-packages
51 define="sourcepackagereleases view/latest_uploaded_but_not_maintained_packages_with_stats"51 define="spphs view/latest_uploaded_but_not_maintained_packages_with_stats"
52 condition="sourcepackagereleases">52 condition="spphs">
5353
54 <div class="top-portlet">54 <div class="top-portlet">
55 <h2>Uploaded packages</h2>55 <h2>Uploaded packages</h2>
@@ -68,14 +68,14 @@
68 </tr>68 </tr>
69 </thead>69 </thead>
7070
71 <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" />71 <div metal:use-macro="context/@@+person-macros/spph-rows" />
72 </table>72 </table>
73 </div>73 </div>
74 </tal:uploaded-packages>74 </tal:uploaded-packages>
7575
76 <tal:ppa-packages76 <tal:ppa-packages
77 define="sourcepackagereleases view/latest_uploaded_ppa_packages_with_stats"77 define="spphs view/latest_uploaded_ppa_packages_with_stats"
78 condition="sourcepackagereleases">78 condition="spphs">
7979
80 <div class="top-portlet">80 <div class="top-portlet">
81 <h2>PPA packages</h2>81 <h2>PPA packages</h2>
@@ -94,7 +94,7 @@
94 </tr>94 </tr>
95 </thead>95 </thead>
9696
97 <div metal:use-macro="template/macros/sourcepackagerelease-ppa-rows" />97 <div metal:use-macro="template/macros/spph-ppa-rows" />
98 </table>98 </table>
99 </div>99 </div>
100 </tal:ppa-packages>100 </tal:ppa-packages>
@@ -153,14 +153,14 @@
153</div>153</div>
154154
155<metal:macros fill-slot="bogus">155<metal:macros fill-slot="bogus">
156<metal:macro define-macro="sourcepackagerelease-ppa-rows">156<metal:macro define-macro="spph-ppa-rows">
157 <tal:comment replace="nothing">157 <tal:comment replace="nothing">
158 This macro expects the following variables defined:158 This macro expects the following variables defined:
159 :sourcepackagereleases: A list of SourcePackageRelease objects159 :spphs: A list of SourcePackagePublishingHistory objects
160 </tal:comment>160 </tal:comment>
161 <tr tal:repeat="sourcepackagerelease sourcepackagereleases"161 <tr tal:repeat="spph spphs"
162 class="ppa_row">162 class="ppa_row">
163 <tal:block define="spr sourcepackagerelease;163 <tal:block define="spr spph/sourcepackagerelease;
164 distroseries spr/upload_distroseries;164 distroseries spr/upload_distroseries;
165 ppa spr/upload_archive">165 ppa spr/upload_archive">
166 <td tal:content="spr/sourcepackagename/name">166 <td tal:content="spr/sourcepackagename/name">
@@ -180,15 +180,15 @@
180 2005-10-24180 2005-10-24
181 </td>181 </td>
182 <td>182 <td>
183 <tal:block condition="spr/needs_building">183 <tal:block condition="spph/needs_building">
184 Not yet built184 Not yet built
185 </tal:block>185 </tal:block>
186 <tal:block condition="not: spr/needs_building">186 <tal:block condition="not: spph/needs_building">
187 <tal:block repeat="build spr/failed_builds">187 <tal:block repeat="build spph/failed_builds">
188 <a tal:attributes="href build/fmt:url"188 <a tal:attributes="href build/fmt:url"
189 tal:content="build/distro_arch_series/architecturetag" />189 tal:content="build/distro_arch_series/architecturetag" />
190 </tal:block>190 </tal:block>
191 <tal:block condition="not: spr/failed_builds">191 <tal:block condition="not: spph/failed_builds">
192 None192 None
193 </tal:block>193 </tal:block>
194 </tal:block>194 </tal:block>
195195
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-12-17 23:17:55 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2011-09-19 07:53:32 +0000
@@ -96,6 +96,7 @@
96 1...5 of 7 results96 1...5 of 7 results
97 ...97 ...
98 Name Uploaded to Version When Failures Bugs Questions98 Name Uploaded to Version When Failures Bugs Questions
99 ...
99 alsa-utils Debian Sid 1.0.9a-4 2005-07-01 None 0 0100 alsa-utils Debian Sid 1.0.9a-4 2005-07-01 None 0 0
100 ...101 ...
101102
@@ -122,6 +123,7 @@
122 1...5 of 6 results123 1...5 of 6 results
123 ...124 ...
124 Name Uploaded to Version When Failures Bugs Questions125 Name Uploaded to Version When Failures Bugs Questions
126 ...
125 foobar Ubuntu Breezy-autotest 1.0 2006-12-01 i386 0 0127 foobar Ubuntu Breezy-autotest 1.0 2006-12-01 i386 0 0
126 ...128 ...
127129
@@ -312,20 +314,28 @@
312314
313This makes the package appear in the listings again because the primary315This makes the package appear in the listings again because the primary
314archive is public.316archive is public.
317XXX: The public package should be displayed, this will be fixed in a dependant
318branch.
315319
316 >>> MemcachedLayer.purge()320 >>> MemcachedLayer.purge()
317 >>> user_browser.open("http://launchpad.dev/~cprov/+related-software")321 >>> user_browser.open("http://launchpad.dev/~cprov/+related-software")
318 >>> print_ppa_rows(user_browser)322 >>> user_browser.getLink("Uploaded packages").click()
319 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666323 >>> print extract_text(find_tag_by_id(user_browser.contents, 'packages'))
320 ...ago None - -324 ...
325 Name Uploaded to Version When Failures Bugs Questions
326 Celso Providelo has not uploaded any packages.
321327
322 >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software")328 >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software")
323 >>> print_ppa_rows(anon_browser)329 >>> anon_browser.getLink("Uploaded packages").click()
324 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666330 >>> print extract_text(find_tag_by_id(anon_browser.contents, 'packages'))
325 ...ago None - -331 Name Uploaded to Version When Failures Bugs Questions
332 Celso Providelo has not uploaded any packages.
326333
327Even after the package is superseded, the package remains visibile in334Even after the package is superseded, the package remains visibile in
328the listings.335the listings.
336XXX: The public package should be displayed, this will be fixed in a dependant
337branch.
338
329339
330 >>> login("foo.bar@canonical.com")340 >>> login("foo.bar@canonical.com")
331 >>> discard = source1_ubuntu.supersede()341 >>> discard = source1_ubuntu.supersede()
@@ -334,14 +344,17 @@
334344
335 >>> MemcachedLayer.purge()345 >>> MemcachedLayer.purge()
336 >>> user_browser.open("http://launchpad.dev/~cprov/+related-software")346 >>> user_browser.open("http://launchpad.dev/~cprov/+related-software")
337 >>> print_ppa_rows(user_browser)347 >>> user_browser.getLink("Uploaded packages").click()
338 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666348 >>> print extract_text(find_tag_by_id(user_browser.contents, 'packages'))
339 ...ago None - -349 Name Uploaded to Version When Failures Bugs Questions
350 Celso Providelo has not uploaded any packages.
340351
341 >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software")352 >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software")
342 >>> print_ppa_rows(anon_browser)353 >>> print_ppa_rows(anon_browser)
343 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666354 >>> anon_browser.getLink("Uploaded packages").click()
344 ...ago None - -355 >>> print extract_text(find_tag_by_id(anon_browser.contents, 'packages'))
356 Name Uploaded to Version When Failures Bugs Questions
357 Celso Providelo has not uploaded any packages.
345358
346359
347Packages deleted from a PPA360Packages deleted from a PPA
@@ -356,10 +369,10 @@
356369
357 >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software")370 >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software")
358 >>> print_ppa_rows(admin_browser)371 >>> print_ppa_rows(admin_browser)
372 source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666
373 ...ago None - -
359 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666374 source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666
360 ...ago None - -375 ...ago None - -
361 source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666
362 ...ago None - -
363376
364Then delete the 'source2' package.377Then delete the 'source2' package.
365378
366379
=== modified file 'lib/lp/soyuz/templates/person-maintained-packages.pt'
--- lib/lp/soyuz/templates/person-maintained-packages.pt 2009-09-08 14:37:17 +0000
+++ lib/lp/soyuz/templates/person-maintained-packages.pt 2011-09-19 07:53:32 +0000
@@ -25,9 +25,9 @@
25 replace="structure view/batchnav/@@+navigation-links-upper" />25 replace="structure view/batchnav/@@+navigation-links-upper" />
2626
27 <tal:maintained-packages27 <tal:maintained-packages
28 define="sourcepackagereleases view/batch">28 define="spphs view/batch">
2929
30 <table class="listing" condition="sourcepackagereleases">30 <table class="listing" condition="spphs">
31 <thead>31 <thead>
32 <tr>32 <tr>
33 <th>Name</th>33 <th>Name</th>
@@ -40,14 +40,14 @@
40 </tr>40 </tr>
41 </thead>41 </thead>
42 <tbody>42 <tbody>
43 <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows"/>43 <div metal:use-macro="context/@@+person-macros/spph-rows"/>
44 </tbody>44 </tbody>
45 </table>45 </table>
4646
47 <tal:navigation_bottom47 <tal:navigation_bottom
48 replace="structure view/batchnav/@@+navigation-links-lower" />48 replace="structure view/batchnav/@@+navigation-links-lower" />
4949
50 <tal:no_packages condition="not: sourcepackagereleases">50 <tal:no_packages condition="not: spphs">
51 <tal:name replace="context/fmt:displayname"/>51 <tal:name replace="context/fmt:displayname"/>
52 does not maintain any packages.52 does not maintain any packages.
53 </tal:no_packages>53 </tal:no_packages>
5454
=== modified file 'lib/lp/soyuz/templates/person-ppa-packages.pt'
--- lib/lp/soyuz/templates/person-ppa-packages.pt 2010-06-10 08:29:19 +0000
+++ lib/lp/soyuz/templates/person-ppa-packages.pt 2011-09-19 07:53:32 +0000
@@ -25,9 +25,9 @@
25 replace="structure view/batchnav/@@+navigation-links-upper" />25 replace="structure view/batchnav/@@+navigation-links-upper" />
2626
27 <tal:ppa-packages27 <tal:ppa-packages
28 define="sourcepackagereleases view/batch">28 define="spphs view/batch">
2929
30 <table class="listing" condition="sourcepackagereleases">30 <table class="listing" condition="spphs">
31 <thead>31 <thead>
32 <tr>32 <tr>
33 <th>Name</th>33 <th>Name</th>
@@ -38,14 +38,14 @@
38 </tr>38 </tr>
39 </thead>39 </thead>
40 <tbody>40 <tbody>
41 <div metal:use-macro="template/macros/sourcepackagerelease-ppa-rows" />41 <div metal:use-macro="template/macros/spph-ppa-rows" />
42 </tbody>42 </tbody>
43 </table>43 </table>
4444
45 <tal:navigation_bottom45 <tal:navigation_bottom
46 replace="structure view/batchnav/@@+navigation-links-lower" />46 replace="structure view/batchnav/@@+navigation-links-lower" />
4747
48 <tal:no_packages condition="not: sourcepackagereleases">48 <tal:no_packages condition="not: spphs">
49 <tal:name replace="context/fmt:displayname"/> has no related PPA packages.49 <tal:name replace="context/fmt:displayname"/> has no related PPA packages.
50 </tal:no_packages>50 </tal:no_packages>
5151
@@ -55,14 +55,14 @@
55</div>55</div>
5656
57<metal:macros fill-slot="bogus">57<metal:macros fill-slot="bogus">
58<metal:macro define-macro="sourcepackagerelease-ppa-rows">58<metal:macro define-macro="spph-ppa-rows">
59 <tal:comment replace="nothing">59 <tal:comment replace="nothing">
60 This macro expects the following variables defined:60 This macro expects the following variables defined:
61 :sourcepackagereleases: A list of SourcePackageRelease objects61 :spphs: A list of SourcePackagePublishingHistory objects
62 </tal:comment>62 </tal:comment>
63 <tr tal:repeat="sourcepackagerelease sourcepackagereleases"63 <tr tal:repeat="spph spphs"
64 class="ppa_row">64 class="ppa_row">
65 <tal:block define="spr sourcepackagerelease;65 <tal:block define="spr spph/sourcepackagerelease;
66 distroseries spr/upload_distroseries;66 distroseries spr/upload_distroseries;
67 ppa spr/upload_archive">67 ppa spr/upload_archive">
68 <td tal:content="spr/sourcepackagename/name">68 <td tal:content="spr/sourcepackagename/name">
@@ -82,15 +82,15 @@
82 2005-10-2482 2005-10-24
83 </td>83 </td>
84 <td>84 <td>
85 <tal:block condition="spr/needs_building">85 <tal:block condition="spph/needs_building">
86 Not yet built86 Not yet built
87 </tal:block>87 </tal:block>
88 <tal:block condition="not: spr/needs_building">88 <tal:block condition="not: spph/needs_building">
89 <tal:block repeat="build spr/failed_builds">89 <tal:block repeat="build spph/failed_builds">
90 <a tal:attributes="href build/fmt:url"90 <a tal:attributes="href build/fmt:url"
91 tal:content="build/distro_arch_series/architecturetag" />91 tal:content="build/distro_arch_series/architecturetag" />
92 </tal:block>92 </tal:block>
93 <tal:block condition="not: spr/failed_builds">93 <tal:block condition="not: spph/failed_builds">
94 None94 None
95 </tal:block>95 </tal:block>
96 </tal:block>96 </tal:block>
9797
=== modified file 'lib/lp/soyuz/templates/person-uploaded-packages.pt'
--- lib/lp/soyuz/templates/person-uploaded-packages.pt 2009-09-08 14:37:17 +0000
+++ lib/lp/soyuz/templates/person-uploaded-packages.pt 2011-09-19 07:53:32 +0000
@@ -25,9 +25,9 @@
25 replace="structure view/batchnav/@@+navigation-links-upper" />25 replace="structure view/batchnav/@@+navigation-links-upper" />
2626
27 <tal:uploaded-packages27 <tal:uploaded-packages
28 define="sourcepackagereleases view/batch">28 define="spphs view/batch">
2929
30 <table class="listing" condition="sourcepackagereleases">30 <table class="listing" condition="spphs">
31 <thead>31 <thead>
32 <tr>32 <tr>
33 <th>Name</th>33 <th>Name</th>
@@ -40,14 +40,14 @@
40 </tr>40 </tr>
41 </thead>41 </thead>
42 <tbody>42 <tbody>
43 <div metal:use-macro="context/@@+person-macros/sourcepackagerelease-rows" />43 <div metal:use-macro="context/@@+person-macros/spph-rows" />
44 </tbody>44 </tbody>
45 </table>45 </table>
4646
47 <tal:navigation_bottom47 <tal:navigation_bottom
48 replace="structure view/batchnav/@@+navigation-links-lower" />48 replace="structure view/batchnav/@@+navigation-links-lower" />
4949
50 <tal:no_packages condition="not: sourcepackagereleases">50 <tal:no_packages condition="not: spphs">
51 <tal:name replace="context/fmt:displayname"/> has not uploaded any packages.51 <tal:name replace="context/fmt:displayname"/> has not uploaded any packages.
52 </tal:no_packages>52 </tal:no_packages>
5353