Merge lp://staging/~edwin-grubbs/launchpad/bug-577492-needspackaging-duplicates into lp://staging/launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 11248
Proposed branch: lp://staging/~edwin-grubbs/launchpad/bug-577492-needspackaging-duplicates
Merge into: lp://staging/launchpad
Diff against target: 1009 lines (+386/-327)
8 files modified
lib/lp/registry/browser/distroseries.py (+3/-6)
lib/lp/registry/browser/tests/test_distroseries_views.py (+52/-0)
lib/lp/registry/doc/distroseries.txt (+286/-284)
lib/lp/registry/interfaces/distroseries.py (+5/-4)
lib/lp/registry/model/distroseries.py (+25/-23)
lib/lp/registry/stories/distroseries/xx-distroseries-index.txt (+6/-1)
lib/lp/registry/templates/distroseries-portlet-packaging.pt (+1/-1)
lib/lp/registry/tests/test_distroseries.py (+8/-8)
To merge this branch: bzr merge lp://staging/~edwin-grubbs/launchpad/bug-577492-needspackaging-duplicates
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+31112@code.staging.launchpad.net

Description of the change

Summary
-------

Sped up +needs-packaging page and the needs-packaging portlet on the
distroseries +index page by making getPrioritizedUnlinkedSourcePackages()
return a result set, so that batching will result in a limited query.

Previously, the result set was turned into a list in order to format
each item as a dictionary. Therefore, it would load 13,000 source
packages, and then iterate just over the first batch.

I also fixed the name of getPrioritizedPackagings() and made it
return a result set instead of a list.

Tests
-----

./bin/test -vv -t 'test_distroseries|doc/distroseries.txt'

Demo and Q/A
------------

* Open https://staging.launchpad.net/ubuntu/maverick/+needs-packaging
  * It should not timeout.
* Open https://staging.launchpad.net/ubuntu/maverick/
  * The "Upstream packaging" portlet should say
    "Needs more information or linking to upstream" and list some source
    packages.

Lint
----

There are over 700 lint errors due to bad indentation in doctests, so I
will add those changes later, so that reviewers aren't scared away.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Nice, I'm looking forward to seeing this land!

One minor comment: lib/lp/registry/browser/tests/test_distroseries_views.py mentions 2009 as the copyright year, that probably should be 2010..

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.