← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-950502 into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-950502 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #950502 in Launchpad itself: ""Bugs fixed elsewhere" count is expensive and of dubious utility"
  https://bugs.launchpad.net/launchpad/+bug/950502

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-950502/+merge/96701

The bugtarget statistics portlet shows a count of "Bugs fixed elsewhere". This is expensive to calculate in BugSummary, and is probably not commonly useful due to the link type limitations in LP's task model.

In order to simplify and accelerate BugSummary calculation we would like to remove this count. But let's hide it first, and see if anyone notices. This branch adds a feature flag to hide it.

I also moved it above "Bugs with patches", so there's not a number missing in the middle of other numbers.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-950502/+merge/96701
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-950502 into lp:launchpad.
=== modified file 'lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt'
--- lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt	2011-09-30 01:48:31 +0000
+++ lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt	2012-03-09 03:00:35 +0000
@@ -25,8 +25,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
 
 
@@ -37,8 +37,8 @@
     0 Critical bugs
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     2 Open CVE bugs - CVE reports
 
 Once the user has identified themselves, show information on assigned and
@@ -55,8 +55,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
 
 
@@ -71,8 +71,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     2 Open CVE bugs - CVE reports
 
 The content includes a link to the distribution CVE report.
@@ -96,8 +96,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
     Review nominations
       --> http://bugs.launchpad.dev/debian/woody/+nominations
@@ -109,8 +109,8 @@
     0 Critical bugs
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug - CVE report
 
 Once the user has identified themselves, show information on assigned and
@@ -127,8 +127,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
     Review nominations
       --> http://bugs.launchpad.dev/debian/woody/+nominations
@@ -144,8 +144,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug - CVE report
 
 The content includes a link to the distribution CVE report.
@@ -168,8 +168,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
 
     >>> print_bugfilters_portlet_filled(anon_browser, path)
@@ -179,8 +179,8 @@
     0 Critical bugs
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     2 Open CVE bugs
 
 Once the user has identified themselves, show information on assigned and
@@ -197,8 +197,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
 
     >>> print_bugfilters_portlet_filled(user_browser, path)
@@ -212,8 +212,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     2 Open CVE bugs
 
 Note that the "CVE reports" link is not shown above; distribution
@@ -240,8 +240,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
 
     >>> print_bugfilters_portlet_filled(anon_browser, path)
@@ -251,8 +251,8 @@
     0 Critical bugs
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug
 
 Once the user has identified themselves, show information on assigned and
@@ -269,8 +269,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
 
     >>> print_bugfilters_portlet_filled(user_browser, path)
@@ -284,8 +284,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug
 
 Note that the "CVE reports" link is not shown above; source packages
@@ -311,8 +311,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
 
     >>> print_bugfilters_portlet_filled(anon_browser, path)
@@ -322,8 +322,8 @@
     1 Critical bug
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug
 
 Once the user has identified themselves, show information on assigned
@@ -340,8 +340,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs
     Subscribe to bug mail
       --> http://bugs.launchpad.dev/mozilla/+subscribe
@@ -360,8 +360,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug
 
 Note that the "CVE reports" link is not shown above; project groups do
@@ -387,8 +387,8 @@
     Critical bugs
     High importance bugs
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
 
     >>> print_bugfilters_portlet_filled(anon_browser, path)
@@ -398,8 +398,8 @@
     1 Critical bug
     0 High importance bugs
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug - CVE report
 
 Once the user has identified him or herself, information on assigned
@@ -416,8 +416,8 @@
     Bugs reported by me
     Bugs affecting me
     <BLANKLINE>
+    Bugs fixed elsewhere
     Bugs with patches
-    Bugs fixed elsewhere
     Open CVE bugs - CVE reports
     Subscribe to bug mail
       --> http://bugs.launchpad.dev/firefox/+subscribe
@@ -436,8 +436,8 @@
     0 Bugs reported by me
       Bugs affecting me
     <BLANKLINE>
+    0 Bugs fixed elsewhere
     0 Bugs with patches
-    0 Bugs fixed elsewhere
     1 Open CVE bug - CVE report
 
 
@@ -445,3 +445,30 @@
 
     >>> print user_browser.getLink('CVE report').url
     http://bugs.launchpad.dev/firefox/+cve
+
+
+Hiding "Bugs fixed elsewhere" counts
+------------------------------------
+
+The count of bugs fixed elsewhere is of dubious utility, and it's
+expensive to calculate when generating BugSummary. As a trial before we
+remove it, there's a feature flag to hide the count.
+
+    >>> print_bugfilters_portlet_filled(user_browser, path)
+    3 New bugs
+    ...
+    <BLANKLINE>
+    0 Bugs fixed elsewhere
+    0 Bugs with patches
+    ...
+
+    >>> from lp.services.features.testing import FeatureFixture
+    >>> with FeatureFixture(
+    ...     {'bugs.statistics_portlet.hide_fixed_elsewhere_count': 'true'}):
+    ...     print print_bugfilters_portlet_filled(user_browser, path)
+    3 New bugs
+    ...
+    <BLANKLINE>
+      Bugs fixed elsewhere
+    0 Bugs with patches
+    ...

=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt	2011-09-29 02:48:05 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt	2012-03-09 03:00:35 +0000
@@ -108,6 +108,28 @@
 
   <tr><td colspan="2"><br /></td></tr>
 
+  <tr tal:condition="not: request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count"
+      tal:define="count view/bugs_fixed_elsewhere_count|nothing;
+                  plural string: Bugs fixed elsewhere;
+                  singular string: Bug fixed elsewhere;">
+    <td class="bugs-count" tal:content="count" />
+    <td class="bugs-link">
+      <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
+      <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
+      </a>
+    </td>
+  </tr>
+  <tr tal:condition="request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count">
+    <tal:comment condition="nothing">
+      No count here, because generating it is expensive.
+    </tal:comment>
+    <td class="bugs-count" />
+    <td class="bugs-link">
+      <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
+      Bugs fixed elsewhere
+      </a>
+    </td>
+  </tr>
   <tr tal:define="count view/bugs_with_patches_count|nothing;
                   plural string: Bugs with patches;
                   singular string: Bug with a patch;">
@@ -118,16 +140,6 @@
       </a>
     </td>
   </tr>
-  <tr tal:define="count view/bugs_fixed_elsewhere_count|nothing;
-                  plural string: Bugs fixed elsewhere;
-                  singular string: Bug fixed elsewhere;">
-    <td class="bugs-count" tal:content="count" />
-    <td class="bugs-link">
-      <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
-      <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
-      </a>
-    </td>
-  </tr>
   <tr tal:define="count view/open_cve_bugs_count|nothing;
                   plural string: Open CVE bugs;
                   singular string: Open CVE bug;">