Merge lp:~sinzui/launchpad/dsp-bug-counts-1 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Curtis Hovey on 2010-08-25 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 11442 | ||||
| Proposed branch: | lp:~sinzui/launchpad/dsp-bug-counts-1 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
232 lines (+59/-14) 5 files modified
database/schema/security.cfg (+19/-11) lib/lp/bugs/doc/bug-heat.txt (+0/-2) lib/lp/bugs/model/bug.py (+3/-1) lib/lp/bugs/tests/test_bugheat.py (+35/-0) lib/lp/registry/model/distributionsourcepackage.py (+2/-0) |
||||
| To merge this branch: | bzr merge lp:~sinzui/launchpad/dsp-bug-counts-1 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Deryck Hodge (community) | code | 2010-08-23 | Approve on 2010-08-25 |
| Brad Crittenden (community) | code | 2010-08-20 | Approve on 2010-08-20 |
|
Review via email:
|
|||
Description of the Change
This is my branch to fix the DSP bug counts shown on +needs-packaging.
lp:~sinzui/launchpad/dsp-bug-counts-1
Diff size: 90
Launchpad bug:
https:/
Test command: ./bin/test -vv -t test_bugheat
Pre-
Target release: 10.09
Fix the DSP bug counts shown on +needs-packaging
-------
The bug counts shown on +needs-packaging are for all bugs reported against
the DSP. We want to show the open bugs that the user can see when viewing
the DSPs bug page.
The recent fix to exclude closed bugs was not enough to address this issue.
The rules must also ignore duplicate bugs. The call to recalculateBugH
should be added to updateHeat so that bugtargets are updated when their bugs
change.
Rules
-----
* Add condition to exclude duplicate bugs from bug heat cache
calculations.
* Call recalculateBugH
update when their bugs change.
QA
--
* Subscribe to flashplugin-nonfree on staging. Verify the DSP's bug
count goes down.
SELECT bug_count FROM distributionsou
WHERE distribution = 1
AND sourcepackagename in (
Lint
----
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
Test
----
* lib/lp/
* Added a test to verify recalculateBugH
proxies and monkey patching objects is more dangerous.
* Add a duplicate bug to the test setup. The count (2) must not change.
Implementation
--------------
* lib/lp/
* Added a rule to iterate of the bug's tasks and call the
task's recalculateBugH
setHeat works.
* lib/lp/
* Add a condition to ignore duplicate bugs in recalculateBugH
| Robert Collins (lifeless) wrote : | # |
Could you expand on this? I seem to recall a bug saying that
duplicates *should* count towards the heat of a bug? or is this an
aggregate function saying that we shouldn't count the heat from
duplicates twice ?
| Curtis Hovey (sinzui) wrote : | # |
The duplicates heat is alredy counted on the bug it is a duplicate of. When a bug is marked a duplicate, its heat is set to 0. So it has no apparent affect when total heat or getting the max heat. It is however skewing the number of open bugs on the +needs-page. The user sees 1000 bugs, but discovers there is only 58. Most are duplicates, many are closed.
| Robert Collins (lifeless) wrote : | # |
Thanks for clarifying, I appreciate it.
| Curtis Hovey (sinzui) wrote : | # |
Hi.
I had a number of test failures caused by the change to updateHeat to also update the bug target caches. Many procs are changing bugs and thus are implicitly using SELECT and UPDATE to work with distros, DSPs, products, projects. Creating a DSP on demand also requires read SELECT on sourcepackagepu
I also saw some very strange storm timing issues that were fixed by adding a call to flush() when we mutate the DSP to create a db instance on demand.
I hesitate to do this without your okay. If we do not do this, I think we need to rethink how bug targets keep that bug heat cache data in sync. We could reuse the old bug-heat script user to update thousands of targets every day, or consider a job.
{{{
=== modified file 'database/
--- database/
+++ database/
@@ -535,7 +535,8 @@
public.
public.cve = SELECT, INSERT, UPDATE
public.
-public.
+public.
+public.
public.
public.
public.job = SELECT, INSERT, UPDATE
@@ -548,13 +549,16 @@
public.
public.person = SELECT, INSERT, UPDATE
public.
-public.product = SELECT
+public.product = SELECT, UPDATE
public.
-public.project = SELECT
+public.project = SELECT, UPDATE
public.questionbug = SELECT
public.question = SELECT
public.
+public.section = SELECT
+public.
public.
+public.
public.
public.
public.
@@ -1083,7 +1087,7 @@
# to insert it.
public.gpgkey = SELECT, INSERT
public.
-public.
+public.
public.
public.
public.
@@ -1140,8 +1144,8 @@
public.
public.
public.bugtask = SELECT, UPDATE
-public.product = SELECT
-public.p...
| Deryck Hodge (deryck) wrote : | # |
The changes here look good to me. Curtis and I chatted a bit on IRC about the changes to security.cfg, and I'm comfortable with them and have no concerns.
Cheers,
deryck

This fix is so simple -- let's hope it does the trick.