← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/packaging-portlet-timeouts into lp:launchpad/devel

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/packaging-portlet-timeouts into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #612358 packaging portlet cause timeout on distroseries index
  https://bugs.launchpad.net/bugs/612358


lp:~jcsackett/launchpad/packaging-portlet-timeouts
    Diff size: 43 lines
    Launchpad bug: 
          https://bugs.launchpad.net/bugs/612358
    Test command: ./bin/test -vv \
          -t test_needs_linking
    Pre-implementation: sinzui (Curtis Hovey)
    Target release: 10.08


Disable the "needs linked" feature in the packaging-portlet
--------------------------------------------------------------------

Related to bug 612358, we needed to disable the needs linked portion
of the packaging-portlet. The current presentation isn't really
meeting the need of encouraging participation in linking packages,
and is showing bad data (bad bug count, packages that can't be 
linked).


QA
--

Open a project with the packaging-portlet; the needs more 
information part should no longer display.

Lint
----

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/browser/distroseries.py
  lib/lp/registry/browser/tests/test_distroseries_views.py
  lib/lp/registry/templates/distroseries-portlet-packaging.pt


Test
----

test_needs_linking in 
/lib/lp/registry/browser/tests/test_distroseries.py 
was updated to assert that view.needs_linked returns None


Implementation
--------------

In the portlet:
    * Removed the preprocessing so that the data no longer
      displays, turning off the feature
In the view:
    * Updated the needs_linked property to return None

Together, this disables the feature.
-- 
https://code.launchpad.net/~jcsackett/launchpad/packaging-portlet-timeouts/+merge/31878
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/packaging-portlet-timeouts into lp:launchpad/devel.
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py	2010-08-02 02:13:52 +0000
+++ lib/lp/registry/browser/distroseries.py	2010-08-05 19:36:01 +0000
@@ -332,7 +332,8 @@
     @cachedproperty
     def needs_linking(self):
         """Return a list of 10 packages most in need of upstream linking."""
-        return self.context.getPrioritizedUnlinkedSourcePackages()[:10]
+        #disabling this feature for now
+        return None
 
     milestone_can_release = False
 

=== modified file 'lib/lp/registry/browser/tests/test_distroseries_views.py'
--- lib/lp/registry/browser/tests/test_distroseries_views.py	2010-07-28 14:05:12 +0000
+++ lib/lp/registry/browser/tests/test_distroseries_views.py	2010-08-05 19:36:01 +0000
@@ -42,10 +42,7 @@
         ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
         distroseries = self.factory.makeDistroSeries(distribution=ubuntu)
         view = create_initialized_view(distroseries, '+index')
-        self.assertTrue(
-            IResultSet.providedBy(view.needs_linking),
-            '%s should implement IResultSet so that slicing will limit the '
-            'query' % view.needs_linking)
+        self.assertEqual(view.needs_linking, None)
 
 
 def test_suite():

=== modified file 'lib/lp/registry/templates/distroseries-portlet-packaging.pt'
--- lib/lp/registry/templates/distroseries-portlet-packaging.pt	2010-07-27 20:59:06 +0000
+++ lib/lp/registry/templates/distroseries-portlet-packaging.pt	2010-08-05 19:36:01 +0000
@@ -56,7 +56,7 @@
     </dt>
     <dd tal:condition="view/needs_linking">
       <ul class="horizontal">
-          <li tal:repeat="package view/needs_linking">
+          <li repeat="package view/needs_linking">
             <a class="sprite package-source"
                tal:attributes="href package/package/fmt:url"
                tal:content="package/package/name">evolution</a>