Merge lp:~wgrant/launchpad/bugsummary-v2-app-no-fixed-upstream into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 15277
Proposed branch: lp:~wgrant/launchpad/bugsummary-v2-app-no-fixed-upstream
Merge into: lp:launchpad
Diff against target: 871 lines (+87/-500)
10 files modified
lib/lp/bugs/browser/bugtask.py (+5/-14)
lib/lp/bugs/browser/tests/special/bugs-fixed-elsewhere.txt (+0/-144)
lib/lp/bugs/browser/tests/test_bugs_fixed_elsewhere.py (+0/-73)
lib/lp/bugs/doc/bugsummary.txt (+69/-72)
lib/lp/bugs/interfaces/bugsummary.py (+0/-1)
lib/lp/bugs/model/bugsummary.py (+0/-1)
lib/lp/bugs/model/tests/test_bugsummary.py (+0/-137)
lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt (+12/-39)
lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt (+1/-12)
lib/lp/services/features/flags.py (+0/-7)
To merge this branch: bzr merge lp:~wgrant/launchpad/bugsummary-v2-app-no-fixed-upstream
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+106557@code.launchpad.net

Commit message

Completely drop the 'Bugs fixed elsewhere' count and remove BugSummary.fixed_upstream from the model.

Description of the change

This branch continues bug #950502, completely removing the application side of the "Bugs fixed elsewhere" count that has been disabled on production for two months. BugSummary.fixed_upstream support gets ripped out of the model, in preparation for its purging from the DB next week.

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

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2012-05-01 07:24:59 +0000
+++ lib/lp/bugs/browser/bugtask.py 2012-05-21 03:40:21 +0000
@@ -1977,8 +1977,8 @@
1977 # Circular fail.1977 # Circular fail.
1978 from lp.bugs.model.bugsummary import BugSummary1978 from lp.bugs.model.bugsummary import BugSummary
1979 bug_task_set = getUtility(IBugTaskSet)1979 bug_task_set = getUtility(IBugTaskSet)
1980 groups = (BugSummary.status, BugSummary.importance,1980 groups = (
1981 BugSummary.has_patch, BugSummary.fixed_upstream)1981 BugSummary.status, BugSummary.importance, BugSummary.has_patch)
1982 counts = bug_task_set.countBugs(self.user, [self.context], groups)1982 counts = bug_task_set.countBugs(self.user, [self.context], groups)
1983 # Sum the split out aggregates.1983 # Sum the split out aggregates.
1984 new = 01984 new = 0
@@ -1987,12 +1987,10 @@
1987 critical = 01987 critical = 0
1988 high = 01988 high = 0
1989 with_patch = 01989 with_patch = 0
1990 resolved_upstream = 0
1991 for metadata, count in counts.items():1990 for metadata, count in counts.items():
1992 status = metadata[0]1991 status = metadata[0]
1993 importance = metadata[1]1992 importance = metadata[1]
1994 has_patch = metadata[2]1993 has_patch = metadata[2]
1995 was_resolved_upstream = metadata[3]
1996 if status == BugTaskStatus.NEW:1994 if status == BugTaskStatus.NEW:
1997 new += count1995 new += count
1998 elif status == BugTaskStatus.INPROGRESS:1996 elif status == BugTaskStatus.INPROGRESS:
@@ -2003,20 +2001,13 @@
2003 high += count2001 high += count
2004 if has_patch and DISPLAY_BUG_STATUS_FOR_PATCHES[status]:2002 if has_patch and DISPLAY_BUG_STATUS_FOR_PATCHES[status]:
2005 with_patch += count2003 with_patch += count
2006 if was_resolved_upstream:
2007 resolved_upstream += count
2008 open += count2004 open += count
2009 result = dict(new=new, open=open, inprogress=inprogress, high=high,2005 result = dict(
2010 critical=critical, with_patch=with_patch,2006 new=new, open=open, inprogress=inprogress, high=high,
2011 resolved_upstream=resolved_upstream)2007 critical=critical, with_patch=with_patch)
2012 return result2008 return result
20132009
2014 @property2010 @property
2015 def bugs_fixed_elsewhere_count(self):
2016 """A count of bugs fixed elsewhere."""
2017 return self._bug_stats['resolved_upstream']
2018
2019 @property
2020 def open_cve_bugs_count(self):2011 def open_cve_bugs_count(self):
2021 """A count of open bugs linked to CVEs."""2012 """A count of open bugs linked to CVEs."""
2022 params = get_default_search_params(self.user)2013 params = get_default_search_params(self.user)
20232014
=== removed file 'lib/lp/bugs/browser/tests/special/bugs-fixed-elsewhere.txt'
--- lib/lp/bugs/browser/tests/special/bugs-fixed-elsewhere.txt 2012-04-04 05:46:26 +0000
+++ lib/lp/bugs/browser/tests/special/bugs-fixed-elsewhere.txt 1970-01-01 00:00:00 +0000
@@ -1,144 +0,0 @@
1Bugs Fixed Elsewhere
2====================
3
4The +bugtarget-portlet-bugfilters-info view for a distribution or
5product contains a property for a URL to a list of bugs fixed
6elsewhere.
7
8 >>> from zope.component import getMultiAdapter
9 >>> from lp.services.webapp.servers import LaunchpadTestRequest
10
11 >>> view = getMultiAdapter(
12 ... (bugtarget, LaunchpadTestRequest()),
13 ... name='+bugtarget-portlet-bugfilters-info')
14 >>> view.initialize()
15
16 >>> view.bugs_fixed_elsewhere_url
17 u'http://.../+bugs?field.status_upstream=resolved_upstream'
18
19The +bugtarget-portlet-bugfilters-stats view for a distribution or
20product contains the URL as above in addition to a count of how many
21bugs that are fixed elsewhere. This count can take a while to
22calculate, so it is put on this separate view which can be requested
23asyncronously.
24
25 >>> def get_view():
26 ... view = getMultiAdapter(
27 ... (bugtarget, LaunchpadTestRequest()),
28 ... name='+bugtarget-portlet-bugfilters-stats')
29 ... view.initialize()
30 ... return view
31
32 >>> view = get_view()
33 >>> view.bugs_fixed_elsewhere_url
34 u'http://.../+bugs?field.status_upstream=resolved_upstream'
35 >>> view.bugs_fixed_elsewhere_count
36 0
37
38Simply opening a bug elsewhere won't increase the count.
39
40 >>> from lp.registry.interfaces.product import IProductSet
41 >>> evolution = getUtility(IProductSet).getByName('evolution')
42 >>> evolution != bugtarget
43 True
44
45 >>> bug = filebug(bugtarget, 'Example Bug')
46
47 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
48 >>> elsewhere = getUtility(IBugTaskSet).createTask(
49 ... bug, getUtility(ILaunchBag).user, evolution)
50 >>> get_view().bugs_fixed_elsewhere_count
51 0
52
53But if we mark the bug as fixed in the other, the count will increase
54by one.
55
56 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
57 >>> elsewhere.transitionToStatus(
58 ... BugTaskStatus.FIXRELEASED, getUtility(ILaunchBag).user)
59
60 >>> get_view().bugs_fixed_elsewhere_count
61 1L
62
63Bugs fixed elsewhere also show up when we perform an advanced bug
64search, using the appropriate query string parameter to ask for "bugs
65resolved elsewhere":
66
67 >>> search_view = getMultiAdapter(
68 ... (bugtarget,
69 ... LaunchpadTestRequest(
70 ... form={'field.status_upstream': 'resolved_upstream'})),
71 ... name='+bugs')
72 >>> search_view.initialize()
73 >>> navigator = search_view.search()
74
75 >>> for task in search_view.search().batch:
76 ... for related_task in task.related_tasks:
77 ... print related_task.target.name
78 ... print related_task.status.name
79 evolution
80 FIXRELEASED
81
82
83Private Bugs
84------------
85
86Only bugs that the user has permission to view are included in the count.
87
88 >>> another_bug = filebug(bugtarget, 'Example Bug')
89 >>> another_bug.setPrivate(True, getUtility(ILaunchBag).user)
90 True
91
92 >>> another_elsewhere = getUtility(IBugTaskSet).createTask(
93 ... another_bug, getUtility(ILaunchBag).user, evolution)
94 >>> another_elsewhere.transitionToStatus(
95 ... BugTaskStatus.FIXRELEASED, getUtility(ILaunchBag).user)
96
97 >>> get_view().bugs_fixed_elsewhere_count
98 2L
99
100This means that No Privileges Person will see that there is only one bug
101fixed elsewhere.
102
103 >>> login('no-priv@canonical.com')
104 >>> get_view().bugs_fixed_elsewhere_count
105 1L
106
107If the private bug is made public again, he will of course see that
108there are two bugs fixed.
109
110 >>> login('foo.bar@canonical.com')
111 >>> another_bug.setPrivate(False, getUtility(ILaunchBag).user)
112 True
113
114 >>> login('no-priv@canonical.com')
115 >>> get_view().bugs_fixed_elsewhere_count
116 2L
117
118
119Duplicate Bugs
120--------------
121
122Bugs that are duplicate of other bugs aren't included in the count.
123
124 >>> another_bug.markAsDuplicate(bug)
125
126 >>> get_view().bugs_fixed_elsewhere_count
127 1L
128
129
130Resolved Bugs
131-------------
132
133The count includes only bugs that are open in the current context.
134
135 >>> for bugtask in bug.bugtasks:
136 ... if bugtask.target == bugtarget:
137 ... break
138 ... else:
139 ... print "Couldn't find a bugtasks for %r" % bugtarget
140 >>> bugtask.transitionToStatus(
141 ... BugTaskStatus.FIXRELEASED, getUtility(ILaunchBag).user)
142
143 >>> get_view().bugs_fixed_elsewhere_count
144 0
1450
=== removed file 'lib/lp/bugs/browser/tests/test_bugs_fixed_elsewhere.py'
--- lib/lp/bugs/browser/tests/test_bugs_fixed_elsewhere.py 2011-12-30 06:14:56 +0000
+++ lib/lp/bugs/browser/tests/test_bugs_fixed_elsewhere.py 1970-01-01 00:00:00 +0000
@@ -1,73 +0,0 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Test harness for running the bugs-fixed-elsewhere.txt tests."""
5
6__metaclass__ = type
7
8__all__ = []
9
10import unittest
11
12from zope.component import getUtility
13
14from lp.bugs.interfaces.bug import CreateBugParams
15from lp.bugs.interfaces.bugtask import BugTaskStatus
16from lp.registry.interfaces.distribution import IDistributionSet
17from lp.registry.interfaces.product import IProductSet
18from lp.services.database.sqlbase import (
19 cursor,
20 sqlvalues,
21 )
22from lp.services.webapp.interfaces import ILaunchBag
23from lp.testing import login
24from lp.testing.layers import LaunchpadFunctionalLayer
25from lp.testing.systemdocs import (
26 LayeredDocFileSuite,
27 setUp,
28 tearDown,
29 )
30
31
32def bugtarget_filebug(bugtarget, summary):
33 """File a bug as the current user on the bug target and return it."""
34 return bugtarget.createBug(CreateBugParams(
35 getUtility(ILaunchBag).user, summary, comment=summary))
36
37def commonSetUp(test):
38 """Set up common for all tests."""
39 setUp(test)
40 test.globs['filebug'] = bugtarget_filebug
41 login('test@canonical.com')
42 # Ensure that there are no fixed bugs in sample data that might
43 # interfere with the tests.
44 cur = cursor()
45 cur.execute("UPDATE BugTask SET status = %s" % (
46 sqlvalues(BugTaskStatus.NEW)))
47
48
49def productSetUp(test):
50 commonSetUp(test)
51 test.globs['bugtarget'] = getUtility(IProductSet).getByName('firefox')
52
53
54def distributionSetUp(test):
55 commonSetUp(test)
56 test.globs['bugtarget'] = getUtility(IDistributionSet).getByName('ubuntu')
57
58
59def test_suite():
60 suite = unittest.TestSuite()
61
62 setUpMethods = [
63 productSetUp,
64 distributionSetUp,
65 ]
66
67 for setUpMethod in setUpMethods:
68 test = LayeredDocFileSuite(
69 'special/bugs-fixed-elsewhere.txt',
70 setUp=setUpMethod, tearDown=tearDown,
71 layer=LaunchpadFunctionalLayer)
72 suite.addTest(test)
73 return suite
740
=== modified file 'lib/lp/bugs/doc/bugsummary.txt'
--- lib/lp/bugs/doc/bugsummary.txt 2012-05-02 05:25:11 +0000
+++ lib/lp/bugs/doc/bugsummary.txt 2012-05-21 03:40:21 +0000
@@ -14,20 +14,19 @@
14 - milestone14 - milestone
15 - importance15 - importance
16 - has_patch16 - has_patch
17 - fixed_upstream
1817
1918
20First we should setup some helpers to use in the examples. These will19First we should setup some helpers to use in the examples. These will
21let us dump the BugSummary table in a readable format.20let us dump the BugSummary table in a readable format.
2221
23 ---------------------------------------------------------------22 ---------------------------------------------------------------
24 prod ps dist ds spn tag mile status import pa up vis #23 prod ps dist ds spn tag mile status import pa vis #
25 ---------------------------------------------------------------24 ---------------------------------------------------------------
2625
27The columns are product, productseries, distribution, distroseries,26The columns are product, productseries, distribution, distroseries,
28sourcepackagename, tag, milestone, status, importance, has_patch,27sourcepackagename, tag, milestone, status, importance, has_patch,
29fixed_upstream, viewed_by and the count. viewed_by is a team reference28viewed_by and the count. viewed_by is a team reference and used to
30and used to query private bug counts.29query private bug counts.
3130
32 >>> from lp.services.database.lpstorm import IMasterStore31 >>> from lp.services.database.lpstorm import IMasterStore
33 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus32 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
@@ -60,14 +59,13 @@
60 ... BugSummary.sourcepackagename_id, BugSummary.tag,59 ... BugSummary.sourcepackagename_id, BugSummary.tag,
61 ... BugSummary.milestone_id, BugSummary.status,60 ... BugSummary.milestone_id, BugSummary.status,
62 ... BugSummary.importance, BugSummary.has_patch,61 ... BugSummary.importance, BugSummary.has_patch,
63 ... BugSummary.fixed_upstream, BugSummary.viewed_by_id,62 ... BugSummary.viewed_by_id, BugSummary.id)
64 ... BugSummary.id)
65 ... fmt = (63 ... fmt = (
66 ... "%-4s %-4s %-4s %-4s %-5s %-3s %-4s "64 ... "%-4s %-4s %-4s %-4s %-5s %-3s %-4s "
67 ... "%-6s %-6s %-2s %-2s %-4s %3s")65 ... "%-6s %-6s %-2s %-4s %3s")
68 ... header = fmt % (66 ... header = fmt % (
69 ... 'prod', 'ps', 'dist', 'ds', 'spn', 'tag', 'mile',67 ... 'prod', 'ps', 'dist', 'ds', 'spn', 'tag', 'mile',
70 ... 'status', 'import', 'pa', 'up', 'vis', '#')68 ... 'status', 'import', 'pa', 'vis', '#')
71 ... print "-" * len(header)69 ... print "-" * len(header)
72 ... print header70 ... print header
73 ... print "-" * len(header)71 ... print "-" * len(header)
@@ -83,7 +81,6 @@
83 ... str(bugsummary.status)[:6],81 ... str(bugsummary.status)[:6],
84 ... str(bugsummary.importance)[:6],82 ... str(bugsummary.importance)[:6],
85 ... str(bugsummary.has_patch)[:1],83 ... str(bugsummary.has_patch)[:1],
86 ... str(bugsummary.fixed_upstream)[:1],
87 ... name(bugsummary.viewed_by),84 ... name(bugsummary.viewed_by),
88 ... bugsummary.count)85 ... bugsummary.count)
89 ... print " " * (len(header) - 4),86 ... print " " * (len(header) - 4),
@@ -122,12 +119,12 @@
122 ... BugSummary.tag == None)119 ... BugSummary.tag == None)
123120
124 >>> print_result(bug_summaries)121 >>> print_result(bug_summaries)
125 ---------------------------------------------------------------122 ------------------------------------------------------------
126 prod ps dist ds spn tag mile status import pa up vis #123 prod ps dist ds spn tag mile status import pa vis #
127 ---------------------------------------------------------------124 ------------------------------------------------------------
128 pr-a x x x x x x New Undeci F F x 1125 pr-a x x x x x x New Undeci F x 1
129 ===126 ===
130 1127 1
131128
132There is one row per tag per combination of product, status and milestone.129There is one row per tag per combination of product, status and milestone.
133If we are interested in all bugs targeted to a product regardless of how130If we are interested in all bugs targeted to a product regardless of how
@@ -148,13 +145,13 @@
148 ... BugSummary.product == prod_a,145 ... BugSummary.product == prod_a,
149 ... BugSummary.tag == None,146 ... BugSummary.tag == None,
150 ... BugSummary.viewed_by == None)147 ... BugSummary.viewed_by == None)
151 ---------------------------------------------------------------148 ------------------------------------------------------------
152 prod ps dist ds spn tag mile status import pa up vis #149 prod ps dist ds spn tag mile status import pa vis #
153 ---------------------------------------------------------------150 ------------------------------------------------------------
154 pr-a x x x x x x New Undeci F F x 2151 pr-a x x x x x x New Undeci F x 2
155 pr-a x x x x x x Confir Undeci F F x 2152 pr-a x x x x x x Confir Undeci F x 2
156 ===153 ===
157 4154 4
158155
159Here are the rows associated with the 't-a' tag. There is 1 Confirmed156Here are the rows associated with the 't-a' tag. There is 1 Confirmed
160bug task targetted to the pr-a product who's bug is tagged 't-a'.:157bug task targetted to the pr-a product who's bug is tagged 't-a'.:
@@ -163,12 +160,12 @@
163 ... BugSummary.product == prod_a,160 ... BugSummary.product == prod_a,
164 ... BugSummary.tag == u't-a',161 ... BugSummary.tag == u't-a',
165 ... BugSummary.viewed_by == None)162 ... BugSummary.viewed_by == None)
166 ---------------------------------------------------------------163 ------------------------------------------------------------
167 prod ps dist ds spn tag mile status import pa up vis #164 prod ps dist ds spn tag mile status import pa vis #
168 ---------------------------------------------------------------165 ------------------------------------------------------------
169 pr-a x x x x t-a x Confir Undeci F F x 1166 pr-a x x x x t-a x Confir Undeci F x 1
170 ===167 ===
171 1168 1
172169
173You will normally want to get the total count counted in the database170You will normally want to get the total count counted in the database
174rather than waste transmission time to calculate the rows client side.171rather than waste transmission time to calculate the rows client side.
@@ -208,17 +205,17 @@
208 >>> print_find(205 >>> print_find(
209 ... BugSummary.product == prod_a,206 ... BugSummary.product == prod_a,
210 ... BugSummary.viewed_by == None)207 ... BugSummary.viewed_by == None)
211 ---------------------------------------------------------------208 ------------------------------------------------------------
212 prod ps dist ds spn tag mile status import pa up vis #209 prod ps dist ds spn tag mile status import pa vis #
213 ---------------------------------------------------------------210 ------------------------------------------------------------
214 pr-a x x x x t-a x Confir Undeci F F x 1211 pr-a x x x x t-a x Confir Undeci F x 1
215 pr-a x x x x t-b ms-a New Undeci F F x 1212 pr-a x x x x t-b ms-a New Undeci F x 1
216 pr-a x x x x t-c ms-a New Undeci F F x 1213 pr-a x x x x t-c ms-a New Undeci F x 1
217 pr-a x x x x x ms-a New Undeci F F x 1214 pr-a x x x x x ms-a New Undeci F x 1
218 pr-a x x x x x x New Undeci F F x 2215 pr-a x x x x x x New Undeci F x 2
219 pr-a x x x x x x Confir Undeci F F x 2216 pr-a x x x x x x Confir Undeci F x 2
220 ===217 ===
221 8218 8
222219
223Number of New bugs not targeted to a milestone. Note the difference220Number of New bugs not targeted to a milestone. Note the difference
224between selecting records where tag is None, and where milestone is None:221between selecting records where tag is None, and where milestone is None:
@@ -272,13 +269,13 @@
272 ... BugSummary.productseries == productseries_b,269 ... BugSummary.productseries == productseries_b,
273 ... BugSummary.product == prod_b),270 ... BugSummary.product == prod_b),
274 ... BugSummary.viewed_by == None)271 ... BugSummary.viewed_by == None)
275 ---------------------------------------------------------------272 ------------------------------------------------------------
276 prod ps dist ds spn tag mile status import pa up vis #273 prod ps dist ds spn tag mile status import pa vis #
277 ---------------------------------------------------------------274 ------------------------------------------------------------
278 pr-b x x x x x x New Undeci F F x 1275 pr-b x x x x x x New Undeci F x 1
279 x ps-b x x x x x New Undeci F F x 1276 x ps-b x x x x x New Undeci F x 1
280 ===277 ===
281 2278 2
282279
283Distribution Bug Counts280Distribution Bug Counts
284-----------------------281-----------------------
@@ -300,14 +297,14 @@
300 >>> print_find(297 >>> print_find(
301 ... BugSummary.distribution == distribution,298 ... BugSummary.distribution == distribution,
302 ... BugSummary.viewed_by == None)299 ... BugSummary.viewed_by == None)
303 ---------------------------------------------------------------300 ------------------------------------------------------------
304 prod ps dist ds spn tag mile status import pa up vis #301 prod ps dist ds spn tag mile status import pa vis #
305 ---------------------------------------------------------------302 ------------------------------------------------------------
306 x x di-a x sp-a x x New Undeci F F x 1303 x x di-a x sp-a x x New Undeci F x 1
307 x x di-a x x x x New Undeci F F x 1304 x x di-a x x x x New Undeci F x 1
308 x x di-a x x x x Confir Undeci F F x 1305 x x di-a x x x x Confir Undeci F x 1
309 ===306 ===
310 3307 3
311308
312How many bugs targeted to a distribution?309How many bugs targeted to a distribution?
313310
@@ -372,12 +369,12 @@
372 >>> print_find(369 >>> print_find(
373 ... BugSummary.distroseries == series_c,370 ... BugSummary.distroseries == series_c,
374 ... BugSummary.viewed_by == None)371 ... BugSummary.viewed_by == None)
375 ---------------------------------------------------------------372 ------------------------------------------------------------
376 prod ps dist ds spn tag mile status import pa up vis #373 prod ps dist ds spn tag mile status import pa vis #
377 ---------------------------------------------------------------374 ------------------------------------------------------------
378 x x x ds-c x x x New Undeci F F x 1375 x x x ds-c x x x New Undeci F x 1
379 ===376 ===
380 1377 1
381378
382379
383Privacy380Privacy
@@ -444,18 +441,18 @@
444 ... BugSummary.distribution == distro_p,441 ... BugSummary.distribution == distro_p,
445 ... BugSummary.distroseries == series_p)442 ... BugSummary.distroseries == series_p)
446 >>> print_find(distro_or_series)443 >>> print_find(distro_or_series)
447 ---------------------------------------------------------------444 ------------------------------------------------------------
448 prod ps dist ds spn tag mile status import pa up vis #445 prod ps dist ds spn tag mile status import pa vis #
449 ---------------------------------------------------------------446 ------------------------------------------------------------
450 x x di-p x x x x New Undeci F F p-b 1447 x x di-p x x x x New Undeci F p-b 1
451 x x di-p x x x x New Undeci F F own 3448 x x di-p x x x x New Undeci F own 3
452 x x di-p x x x x New Undeci F F t-a 1449 x x di-p x x x x New Undeci F t-a 1
453 x x di-p x x x x New Undeci F F t-c 1450 x x di-p x x x x New Undeci F t-c 1
454 x x di-p x x x x New Undeci F F x 1451 x x di-p x x x x New Undeci F x 1
455 x x x ds-p x x x New Undeci F F own 1452 x x x ds-p x x x New Undeci F own 1
456 x x x ds-p x x x New Undeci F F t-c 1453 x x x ds-p x x x New Undeci F t-c 1
457 ===454 ===
458 9455 9
459456
460So how many public bugs are there on the distro?457So how many public bugs are there on the distro?
461458
462459
=== modified file 'lib/lp/bugs/interfaces/bugsummary.py'
--- lib/lp/bugs/interfaces/bugsummary.py 2011-12-24 16:54:44 +0000
+++ lib/lp/bugs/interfaces/bugsummary.py 2012-05-21 03:40:21 +0000
@@ -72,7 +72,6 @@
72 viewed_by = Object(IPerson, readonly=True)72 viewed_by = Object(IPerson, readonly=True)
7373
74 has_patch = Bool(readonly=True)74 has_patch = Bool(readonly=True)
75 fixed_upstream = Bool(readonly=True)
7675
7776
78class IBugSummaryDimension(Interface):77class IBugSummaryDimension(Interface):
7978
=== modified file 'lib/lp/bugs/model/bugsummary.py'
--- lib/lp/bugs/model/bugsummary.py 2011-12-30 06:14:56 +0000
+++ lib/lp/bugs/model/bugsummary.py 2012-05-21 03:40:21 +0000
@@ -78,7 +78,6 @@
78 viewed_by = Reference(viewed_by_id, Person.id)78 viewed_by = Reference(viewed_by_id, Person.id)
7979
80 has_patch = Bool()80 has_patch = Bool()
81 fixed_upstream = Bool()
8281
8382
84class CombineBugSummaryConstraint:83class CombineBugSummaryConstraint:
8584
=== modified file 'lib/lp/bugs/model/tests/test_bugsummary.py'
--- lib/lp/bugs/model/tests/test_bugsummary.py 2012-05-02 05:25:11 +0000
+++ lib/lp/bugs/model/tests/test_bugsummary.py 2012-05-21 03:40:21 +0000
@@ -976,143 +976,6 @@
976 BugSummary.milestone == milestone),976 BugSummary.milestone == milestone),
977 0)977 0)
978978
979 def test_fixUpstream(self):
980 distribution = self.factory.makeDistribution()
981 product = self.factory.makeProduct()
982 distro_bugtask = self.factory.makeBugTask(target=distribution)
983 bug = distro_bugtask.bug
984 product_bugtask = self.factory.makeBugTask(bug=bug, target=product)
985
986 self.assertEqual(
987 self.getPublicCount(
988 BugSummary.distribution == distribution,
989 BugSummary.fixed_upstream == True),
990 0)
991 self.assertEqual(
992 self.getPublicCount(
993 BugSummary.distribution == distribution,
994 BugSummary.fixed_upstream == False),
995 1)
996
997 product_bugtask.transitionToStatus(
998 BugTaskStatus.FIXRELEASED, bug.owner)
999
1000 self.assertEqual(
1001 self.getPublicCount(
1002 BugSummary.distribution == distribution,
1003 BugSummary.fixed_upstream == True),
1004 1)
1005 self.assertEqual(
1006 self.getPublicCount(
1007 BugSummary.distribution == distribution,
1008 BugSummary.fixed_upstream == False),
1009 0)
1010
1011 def test_breakUpstream(self):
1012 distribution = self.factory.makeDistribution()
1013 product = self.factory.makeProduct()
1014 distro_bugtask = self.factory.makeBugTask(target=distribution)
1015 bug = distro_bugtask.bug
1016 product_bugtask = self.factory.makeBugTask(bug=bug, target=product)
1017
1018 product_bugtask.transitionToStatus(
1019 BugTaskStatus.FIXCOMMITTED, bug.owner)
1020
1021 self.assertEqual(
1022 self.getPublicCount(
1023 BugSummary.distribution == distribution,
1024 BugSummary.fixed_upstream == True),
1025 1)
1026 self.assertEqual(
1027 self.getPublicCount(
1028 BugSummary.distribution == distribution,
1029 BugSummary.fixed_upstream == False),
1030 0)
1031
1032 product_bugtask.transitionToStatus(
1033 BugTaskStatus.INPROGRESS, bug.owner)
1034
1035 self.assertEqual(
1036 self.getPublicCount(
1037 BugSummary.distribution == distribution,
1038 BugSummary.fixed_upstream == True),
1039 0)
1040 self.assertEqual(
1041 self.getPublicCount(
1042 BugSummary.distribution == distribution,
1043 BugSummary.fixed_upstream == False),
1044 1)
1045
1046 def test_fixUpstreamViaWatch(self):
1047 distribution = self.factory.makeDistribution()
1048 product = self.factory.makeProduct()
1049 distro_bugtask = self.factory.makeBugTask(target=distribution)
1050 bug = distro_bugtask.bug
1051 product_bugtask = self.factory.makeBugTask(bug=bug, target=product)
1052 self.factory.makeBugWatch(bug_task=product_bugtask)
1053
1054 self.assertEqual(
1055 self.getPublicCount(
1056 BugSummary.distribution == distribution,
1057 BugSummary.fixed_upstream == True),
1058 0)
1059 self.assertEqual(
1060 self.getPublicCount(
1061 BugSummary.distribution == distribution,
1062 BugSummary.fixed_upstream == False),
1063 1)
1064
1065 # Bugs flagged INVALID by upstream count as fixed upstream.
1066 product_bugtask.transitionToStatus(
1067 BugTaskStatus.INVALID, bug.owner)
1068
1069 self.assertEqual(
1070 self.getPublicCount(
1071 BugSummary.distribution == distribution,
1072 BugSummary.fixed_upstream == True),
1073 1)
1074 self.assertEqual(
1075 self.getPublicCount(
1076 BugSummary.distribution == distribution,
1077 BugSummary.fixed_upstream == False),
1078 0)
1079
1080 def test_breakUpstreamViaWatch(self):
1081 distribution = self.factory.makeDistribution()
1082 product = self.factory.makeProduct()
1083 distro_bugtask = self.factory.makeBugTask(target=distribution)
1084 bug = distro_bugtask.bug
1085 product_bugtask = self.factory.makeBugTask(bug=bug, target=product)
1086 self.factory.makeBugWatch(bug_task=product_bugtask)
1087
1088 product_bugtask.transitionToStatus(
1089 BugTaskStatus.FIXCOMMITTED, bug.owner)
1090
1091 self.assertEqual(
1092 self.getPublicCount(
1093 BugSummary.distribution == distribution,
1094 BugSummary.fixed_upstream == True),
1095 1)
1096 self.assertEqual(
1097 self.getPublicCount(
1098 BugSummary.distribution == distribution,
1099 BugSummary.fixed_upstream == False),
1100 0)
1101
1102 product_bugtask.transitionToStatus(
1103 BugTaskStatus.UNKNOWN, bug.owner)
1104
1105 self.assertEqual(
1106 self.getPublicCount(
1107 BugSummary.distribution == distribution,
1108 BugSummary.fixed_upstream == True),
1109 0)
1110 self.assertEqual(
1111 self.getPublicCount(
1112 BugSummary.distribution == distribution,
1113 BugSummary.fixed_upstream == False),
1114 1)
1115
1116 def test_addPatch(self):979 def test_addPatch(self):
1117 product = self.factory.makeProduct()980 product = self.factory.makeProduct()
1118 bug = self.factory.makeBug(product=product)981 bug = self.factory.makeBug(product=product)
1119982
=== modified file 'lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt'
--- lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2012-03-15 05:55:42 +0000
+++ lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2012-05-21 03:40:21 +0000
@@ -37,7 +37,7 @@
37 0 Critical bugs37 0 Critical bugs
38 0 High importance bugs38 0 High importance bugs
39 <BLANKLINE>39 <BLANKLINE>
40 0 Bugs fixed elsewhere40 Bugs fixed elsewhere
41 0 Bugs with patches41 0 Bugs with patches
42 2 Open CVE bugs - CVE reports42 2 Open CVE bugs - CVE reports
4343
@@ -71,7 +71,7 @@
71 0 Bugs reported by me71 0 Bugs reported by me
72 Bugs affecting me72 Bugs affecting me
73 <BLANKLINE>73 <BLANKLINE>
74 0 Bugs fixed elsewhere74 Bugs fixed elsewhere
75 0 Bugs with patches75 0 Bugs with patches
76 2 Open CVE bugs - CVE reports76 2 Open CVE bugs - CVE reports
7777
@@ -107,7 +107,7 @@
107 0 Critical bugs107 0 Critical bugs
108 0 High importance bugs108 0 High importance bugs
109 <BLANKLINE>109 <BLANKLINE>
110 0 Bugs fixed elsewhere110 Bugs fixed elsewhere
111 0 Bugs with patches111 0 Bugs with patches
112 1 Open CVE bug - CVE report112 1 Open CVE bug - CVE report
113113
@@ -140,7 +140,7 @@
140 0 Bugs reported by me140 0 Bugs reported by me
141 Bugs affecting me141 Bugs affecting me
142 <BLANKLINE>142 <BLANKLINE>
143 0 Bugs fixed elsewhere143 Bugs fixed elsewhere
144 0 Bugs with patches144 0 Bugs with patches
145 1 Open CVE bug - CVE report145 1 Open CVE bug - CVE report
146146
@@ -175,7 +175,7 @@
175 0 Critical bugs175 0 Critical bugs
176 0 High importance bugs176 0 High importance bugs
177 <BLANKLINE>177 <BLANKLINE>
178 0 Bugs fixed elsewhere178 Bugs fixed elsewhere
179 0 Bugs with patches179 0 Bugs with patches
180 2 Open CVE bugs180 2 Open CVE bugs
181181
@@ -208,7 +208,7 @@
208 0 Bugs reported by me208 0 Bugs reported by me
209 Bugs affecting me209 Bugs affecting me
210 <BLANKLINE>210 <BLANKLINE>
211 0 Bugs fixed elsewhere211 Bugs fixed elsewhere
212 0 Bugs with patches212 0 Bugs with patches
213 2 Open CVE bugs213 2 Open CVE bugs
214214
@@ -247,7 +247,7 @@
247 0 Critical bugs247 0 Critical bugs
248 0 High importance bugs248 0 High importance bugs
249 <BLANKLINE>249 <BLANKLINE>
250 0 Bugs fixed elsewhere250 Bugs fixed elsewhere
251 0 Bugs with patches251 0 Bugs with patches
252 1 Open CVE bug252 1 Open CVE bug
253253
@@ -280,7 +280,7 @@
280 0 Bugs reported by me280 0 Bugs reported by me
281 Bugs affecting me281 Bugs affecting me
282 <BLANKLINE>282 <BLANKLINE>
283 0 Bugs fixed elsewhere283 Bugs fixed elsewhere
284 0 Bugs with patches284 0 Bugs with patches
285 1 Open CVE bug285 1 Open CVE bug
286286
@@ -318,7 +318,7 @@
318 1 Critical bug318 1 Critical bug
319 0 High importance bugs319 0 High importance bugs
320 <BLANKLINE>320 <BLANKLINE>
321 0 Bugs fixed elsewhere321 Bugs fixed elsewhere
322 0 Bugs with patches322 0 Bugs with patches
323 1 Open CVE bug323 1 Open CVE bug
324324
@@ -352,7 +352,7 @@
352 0 Bugs reported by me352 0 Bugs reported by me
353 Bugs affecting me353 Bugs affecting me
354 <BLANKLINE>354 <BLANKLINE>
355 0 Bugs fixed elsewhere355 Bugs fixed elsewhere
356 0 Bugs with patches356 0 Bugs with patches
357 1 Open CVE bug357 1 Open CVE bug
358358
@@ -390,7 +390,7 @@
390 1 Critical bug390 1 Critical bug
391 0 High importance bugs391 0 High importance bugs
392 <BLANKLINE>392 <BLANKLINE>
393 0 Bugs fixed elsewhere393 Bugs fixed elsewhere
394 0 Bugs with patches394 0 Bugs with patches
395 1 Open CVE bug - CVE report395 1 Open CVE bug - CVE report
396396
@@ -424,7 +424,7 @@
424 0 Bugs reported by me424 0 Bugs reported by me
425 Bugs affecting me425 Bugs affecting me
426 <BLANKLINE>426 <BLANKLINE>
427 0 Bugs fixed elsewhere427 Bugs fixed elsewhere
428 0 Bugs with patches428 0 Bugs with patches
429 1 Open CVE bug - CVE report429 1 Open CVE bug - CVE report
430430
@@ -433,30 +433,3 @@
433433
434 >>> print user_browser.getLink('CVE report').url434 >>> print user_browser.getLink('CVE report').url
435 http://bugs.launchpad.dev/firefox/+cve435 http://bugs.launchpad.dev/firefox/+cve
436
437
438Hiding "Bugs fixed elsewhere" counts
439------------------------------------
440
441The count of bugs fixed elsewhere is of dubious utility, and it's
442expensive to calculate when generating BugSummary. As a trial before we
443remove it, there's a feature flag to hide the count.
444
445 >>> print_bugfilters_portlet_filled(user_browser, path)
446 3 New bugs
447 ...
448 <BLANKLINE>
449 0 Bugs fixed elsewhere
450 0 Bugs with patches
451 ...
452
453 >>> from lp.services.features.testing import FeatureFixture
454 >>> with FeatureFixture(
455 ... {'bugs.statistics_portlet.hide_fixed_elsewhere_count': 'true'}):
456 ... print print_bugfilters_portlet_filled(user_browser, path)
457 3 New bugs
458 ...
459 <BLANKLINE>
460 Bugs fixed elsewhere
461 0 Bugs with patches
462 ...
463436
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2012-03-14 13:19:43 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2012-05-21 03:40:21 +0000
@@ -110,18 +110,7 @@
110110
111 <tr><td colspan="2"><br /></td></tr>111 <tr><td colspan="2"><br /></td></tr>
112112
113 <tr tal:condition="not: request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count"113 <tr>
114 tal:define="count view/bugs_fixed_elsewhere_count|nothing;
115 plural string: Bugs fixed elsewhere;
116 singular string: Bug fixed elsewhere;">
117 <td class="bugs-count" tal:content="count" />
118 <td class="bugs-link">
119 <a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
120 <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
121 </a>
122 </td>
123 </tr>
124 <tr tal:condition="request/features/bugs.statistics_portlet.hide_fixed_elsewhere_count">
125 <tal:comment condition="nothing">114 <tal:comment condition="nothing">
126 No count here, because generating it is expensive.115 No count here, because generating it is expensive.
127 </tal:comment>116 </tal:comment>
128117
=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py 2012-05-08 01:31:10 +0000
+++ lib/lp/services/features/flags.py 2012-05-21 03:40:21 +0000
@@ -96,13 +96,6 @@
96 '',96 '',
97 '',97 '',
98 ''),98 ''),
99 ('bugs.statistics_portlet.hide_fixed_elsewhere_count',
100 'boolean',
101 ('Hides the "Bugs fixed elsewhere" count in the bug target statistics '
102 'portlet.'),
103 '',
104 '',
105 ''),
106 ('code.ajax_revision_diffs.enabled',99 ('code.ajax_revision_diffs.enabled',
107 'boolean',100 'boolean',
108 ("Offer expandable inline diffs for branch revisions."),101 ("Offer expandable inline diffs for branch revisions."),