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

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 14928
Proposed branch: lp:~wgrant/launchpad/bug-950502
Merge into: lp:launchpad
Diff against target: 342 lines (+80/-34)
3 files modified
lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt (+51/-24)
lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt (+22/-10)
lib/lp/services/features/flags.py (+7/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-950502
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+96701@code.launchpad.net

Commit message

Optionally hide the "Bugs fixed elsewhere" count in the statistics portlet.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt'
2--- lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2011-09-30 01:48:31 +0000
3+++ lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2012-03-09 04:06:21 +0000
4@@ -25,8 +25,8 @@
5 Critical bugs
6 High importance bugs
7 <BLANKLINE>
8+ Bugs fixed elsewhere
9 Bugs with patches
10- Bugs fixed elsewhere
11 Open CVE bugs - CVE reports
12
13
14@@ -37,8 +37,8 @@
15 0 Critical bugs
16 0 High importance bugs
17 <BLANKLINE>
18+ 0 Bugs fixed elsewhere
19 0 Bugs with patches
20- 0 Bugs fixed elsewhere
21 2 Open CVE bugs - CVE reports
22
23 Once the user has identified themselves, show information on assigned and
24@@ -55,8 +55,8 @@
25 Bugs reported by me
26 Bugs affecting me
27 <BLANKLINE>
28+ Bugs fixed elsewhere
29 Bugs with patches
30- Bugs fixed elsewhere
31 Open CVE bugs - CVE reports
32
33
34@@ -71,8 +71,8 @@
35 0 Bugs reported by me
36 Bugs affecting me
37 <BLANKLINE>
38+ 0 Bugs fixed elsewhere
39 0 Bugs with patches
40- 0 Bugs fixed elsewhere
41 2 Open CVE bugs - CVE reports
42
43 The content includes a link to the distribution CVE report.
44@@ -96,8 +96,8 @@
45 Critical bugs
46 High importance bugs
47 <BLANKLINE>
48+ Bugs fixed elsewhere
49 Bugs with patches
50- Bugs fixed elsewhere
51 Open CVE bugs - CVE reports
52 Review nominations
53 --> http://bugs.launchpad.dev/debian/woody/+nominations
54@@ -109,8 +109,8 @@
55 0 Critical bugs
56 0 High importance bugs
57 <BLANKLINE>
58+ 0 Bugs fixed elsewhere
59 0 Bugs with patches
60- 0 Bugs fixed elsewhere
61 1 Open CVE bug - CVE report
62
63 Once the user has identified themselves, show information on assigned and
64@@ -127,8 +127,8 @@
65 Bugs reported by me
66 Bugs affecting me
67 <BLANKLINE>
68+ Bugs fixed elsewhere
69 Bugs with patches
70- Bugs fixed elsewhere
71 Open CVE bugs - CVE reports
72 Review nominations
73 --> http://bugs.launchpad.dev/debian/woody/+nominations
74@@ -144,8 +144,8 @@
75 0 Bugs reported by me
76 Bugs affecting me
77 <BLANKLINE>
78+ 0 Bugs fixed elsewhere
79 0 Bugs with patches
80- 0 Bugs fixed elsewhere
81 1 Open CVE bug - CVE report
82
83 The content includes a link to the distribution CVE report.
84@@ -168,8 +168,8 @@
85 Critical bugs
86 High importance bugs
87 <BLANKLINE>
88+ Bugs fixed elsewhere
89 Bugs with patches
90- Bugs fixed elsewhere
91 Open CVE bugs
92
93 >>> print_bugfilters_portlet_filled(anon_browser, path)
94@@ -179,8 +179,8 @@
95 0 Critical bugs
96 0 High importance bugs
97 <BLANKLINE>
98+ 0 Bugs fixed elsewhere
99 0 Bugs with patches
100- 0 Bugs fixed elsewhere
101 2 Open CVE bugs
102
103 Once the user has identified themselves, show information on assigned and
104@@ -197,8 +197,8 @@
105 Bugs reported by me
106 Bugs affecting me
107 <BLANKLINE>
108+ Bugs fixed elsewhere
109 Bugs with patches
110- Bugs fixed elsewhere
111 Open CVE bugs
112
113 >>> print_bugfilters_portlet_filled(user_browser, path)
114@@ -212,8 +212,8 @@
115 0 Bugs reported by me
116 Bugs affecting me
117 <BLANKLINE>
118+ 0 Bugs fixed elsewhere
119 0 Bugs with patches
120- 0 Bugs fixed elsewhere
121 2 Open CVE bugs
122
123 Note that the "CVE reports" link is not shown above; distribution
124@@ -240,8 +240,8 @@
125 Critical bugs
126 High importance bugs
127 <BLANKLINE>
128+ Bugs fixed elsewhere
129 Bugs with patches
130- Bugs fixed elsewhere
131 Open CVE bugs
132
133 >>> print_bugfilters_portlet_filled(anon_browser, path)
134@@ -251,8 +251,8 @@
135 0 Critical bugs
136 0 High importance bugs
137 <BLANKLINE>
138+ 0 Bugs fixed elsewhere
139 0 Bugs with patches
140- 0 Bugs fixed elsewhere
141 1 Open CVE bug
142
143 Once the user has identified themselves, show information on assigned and
144@@ -269,8 +269,8 @@
145 Bugs reported by me
146 Bugs affecting me
147 <BLANKLINE>
148+ Bugs fixed elsewhere
149 Bugs with patches
150- Bugs fixed elsewhere
151 Open CVE bugs
152
153 >>> print_bugfilters_portlet_filled(user_browser, path)
154@@ -284,8 +284,8 @@
155 0 Bugs reported by me
156 Bugs affecting me
157 <BLANKLINE>
158+ 0 Bugs fixed elsewhere
159 0 Bugs with patches
160- 0 Bugs fixed elsewhere
161 1 Open CVE bug
162
163 Note that the "CVE reports" link is not shown above; source packages
164@@ -311,8 +311,8 @@
165 Critical bugs
166 High importance bugs
167 <BLANKLINE>
168+ Bugs fixed elsewhere
169 Bugs with patches
170- Bugs fixed elsewhere
171 Open CVE bugs
172
173 >>> print_bugfilters_portlet_filled(anon_browser, path)
174@@ -322,8 +322,8 @@
175 1 Critical bug
176 0 High importance bugs
177 <BLANKLINE>
178+ 0 Bugs fixed elsewhere
179 0 Bugs with patches
180- 0 Bugs fixed elsewhere
181 1 Open CVE bug
182
183 Once the user has identified themselves, show information on assigned
184@@ -340,8 +340,8 @@
185 Bugs reported by me
186 Bugs affecting me
187 <BLANKLINE>
188+ Bugs fixed elsewhere
189 Bugs with patches
190- Bugs fixed elsewhere
191 Open CVE bugs
192 Subscribe to bug mail
193 --> http://bugs.launchpad.dev/mozilla/+subscribe
194@@ -360,8 +360,8 @@
195 0 Bugs reported by me
196 Bugs affecting me
197 <BLANKLINE>
198+ 0 Bugs fixed elsewhere
199 0 Bugs with patches
200- 0 Bugs fixed elsewhere
201 1 Open CVE bug
202
203 Note that the "CVE reports" link is not shown above; project groups do
204@@ -387,8 +387,8 @@
205 Critical bugs
206 High importance bugs
207 <BLANKLINE>
208+ Bugs fixed elsewhere
209 Bugs with patches
210- Bugs fixed elsewhere
211 Open CVE bugs - CVE reports
212
213 >>> print_bugfilters_portlet_filled(anon_browser, path)
214@@ -398,8 +398,8 @@
215 1 Critical bug
216 0 High importance bugs
217 <BLANKLINE>
218+ 0 Bugs fixed elsewhere
219 0 Bugs with patches
220- 0 Bugs fixed elsewhere
221 1 Open CVE bug - CVE report
222
223 Once the user has identified him or herself, information on assigned
224@@ -416,8 +416,8 @@
225 Bugs reported by me
226 Bugs affecting me
227 <BLANKLINE>
228+ Bugs fixed elsewhere
229 Bugs with patches
230- Bugs fixed elsewhere
231 Open CVE bugs - CVE reports
232 Subscribe to bug mail
233 --> http://bugs.launchpad.dev/firefox/+subscribe
234@@ -436,8 +436,8 @@
235 0 Bugs reported by me
236 Bugs affecting me
237 <BLANKLINE>
238+ 0 Bugs fixed elsewhere
239 0 Bugs with patches
240- 0 Bugs fixed elsewhere
241 1 Open CVE bug - CVE report
242
243
244@@ -445,3 +445,30 @@
245
246 >>> print user_browser.getLink('CVE report').url
247 http://bugs.launchpad.dev/firefox/+cve
248+
249+
250+Hiding "Bugs fixed elsewhere" counts
251+------------------------------------
252+
253+The count of bugs fixed elsewhere is of dubious utility, and it's
254+expensive to calculate when generating BugSummary. As a trial before we
255+remove it, there's a feature flag to hide the count.
256+
257+ >>> print_bugfilters_portlet_filled(user_browser, path)
258+ 3 New bugs
259+ ...
260+ <BLANKLINE>
261+ 0 Bugs fixed elsewhere
262+ 0 Bugs with patches
263+ ...
264+
265+ >>> from lp.services.features.testing import FeatureFixture
266+ >>> with FeatureFixture(
267+ ... {'bugs.statistics_portlet.hide_fixed_elsewhere_count': 'true'}):
268+ ... print print_bugfilters_portlet_filled(user_browser, path)
269+ 3 New bugs
270+ ...
271+ <BLANKLINE>
272+ Bugs fixed elsewhere
273+ 0 Bugs with patches
274+ ...
275
276=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
277--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2011-09-29 02:48:05 +0000
278+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2012-03-09 04:06:21 +0000
279@@ -108,6 +108,28 @@
280
281 <tr><td colspan="2"><br /></td></tr>
282
283+ <tr tal:condition="not: request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count"
284+ tal:define="count view/bugs_fixed_elsewhere_count|nothing;
285+ plural string: Bugs fixed elsewhere;
286+ singular string: Bug fixed elsewhere;">
287+ <td class="bugs-count" tal:content="count" />
288+ <td class="bugs-link">
289+ <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
290+ <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
291+ </a>
292+ </td>
293+ </tr>
294+ <tr tal:condition="request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count">
295+ <tal:comment condition="nothing">
296+ No count here, because generating it is expensive.
297+ </tal:comment>
298+ <td class="bugs-count" />
299+ <td class="bugs-link">
300+ <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
301+ Bugs fixed elsewhere
302+ </a>
303+ </td>
304+ </tr>
305 <tr tal:define="count view/bugs_with_patches_count|nothing;
306 plural string: Bugs with patches;
307 singular string: Bug with a patch;">
308@@ -118,16 +140,6 @@
309 </a>
310 </td>
311 </tr>
312- <tr tal:define="count view/bugs_fixed_elsewhere_count|nothing;
313- plural string: Bugs fixed elsewhere;
314- singular string: Bug fixed elsewhere;">
315- <td class="bugs-count" tal:content="count" />
316- <td class="bugs-link">
317- <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
318- <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
319- </a>
320- </td>
321- </tr>
322 <tr tal:define="count view/open_cve_bugs_count|nothing;
323 plural string: Open CVE bugs;
324 singular string: Open CVE bug;">
325
326=== modified file 'lib/lp/services/features/flags.py'
327--- lib/lp/services/features/flags.py 2012-03-04 23:51:01 +0000
328+++ lib/lp/services/features/flags.py 2012-03-09 04:06:21 +0000
329@@ -88,6 +88,13 @@
330 '',
331 '',
332 ''),
333+ ('bugs.statistics_portlet.hide_fixed_elsewhere_count',
334+ 'boolean',
335+ ('Hides the "Bugs fixed elsewhere" count in the bug target statistics '
336+ 'portlet.'),
337+ '',
338+ '',
339+ ''),
340 ('code.ajax_revision_diffs.enabled',
341 'boolean',
342 ("Offer expandable inline diffs for branch revisions."),