Merge lp:~deryck/launchpad/max-heat-by-target-511382 into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Eleanor Berger on 2010-02-25 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~deryck/launchpad/max-heat-by-target-511382 |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
650 lines (+241/-52) 19 files modified
database/schema/comments.sql (+4/-2) database/schema/patch-2207-34-0.sql (+11/-0) lib/lp/bugs/browser/bug.py (+0/-22) lib/lp/bugs/browser/bugtask.py (+33/-8) lib/lp/bugs/browser/configure.zcml (+0/-5) lib/lp/bugs/browser/tests/bug-heat-view.txt (+44/-11) lib/lp/bugs/interfaces/bug.py (+1/-0) lib/lp/bugs/interfaces/bugtarget.py (+5/-0) lib/lp/bugs/model/bug.py (+1/-0) lib/lp/bugs/model/bugtarget.py (+14/-0) lib/lp/bugs/tests/test_bugheat.py (+82/-0) lib/lp/registry/configure.zcml (+2/-1) lib/lp/registry/model/distribution.py (+2/-2) lib/lp/registry/model/distributionsourcepackage.py (+23/-0) lib/lp/registry/model/distroseries.py (+5/-0) lib/lp/registry/model/product.py (+2/-1) lib/lp/registry/model/productseries.py (+5/-0) lib/lp/registry/model/project.py (+2/-0) lib/lp/registry/model/sourcepackage.py (+5/-0) |
| To merge this branch: | bzr merge lp:~deryck/launchpad/max-heat-by-target-511382 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Björn Tillenius (community) | db | 2010-02-24 | Approve on 2010-02-25 |
| Eleanor Berger (community) | 2010-02-23 | Approve on 2010-02-25 | |
| Stuart Bishop | db | Approve on 2010-02-25 | |
|
Review via email:
|
|||
Commit Message
Add a max_heat attribute to each bug target.
| Deryck Hodge (deryck) wrote : | # |
| Stuart Bishop (stub) wrote : | # |
Will Launchpad have other heat in the future? If so, the column needs to be called max_bug_heat to avoid future name conflicts.
Is 0 a sane default? For heat calculations, I imagine this could lead to division by zero errors. If there is no sane default and the heat calculations explicitly checks for '0', we should just use NULL instead.
Otherwise fine. Allocated number is patch-2207-
Rather than write a new script to update the max heat cache, I think it would be better to add a new task to garbo-daily.py. This provides infrastructure to do the updates in a database friendly manner (with DBLoopTuner), and test infrastructure to speed up writing your tests.
| Björn Tillenius (bjornt) wrote : | # |
I have the same questions as Stuart. For now I think it would be better to call it max_bug_heat to avoid confusion. If we add heat to other things, we can rename it, if we want the heat to be shared.
I also think that NULL should be used to define that heat hasn't been calculated yet, unless using 0 makes things easier. Does it? (Using 0 to have a special value is a bit of a hack, when you are restricted to integer values only.)
I have another question as well, though. You have max_heat for Distribution, DistroSeries, and DistributionSou
| Deryck Hodge (deryck) wrote : | # |
I'll update the patch and code to use max_bug_heat, that makes sense. I'm also fine to use NULL; again that makes sense. Thanks for the reviews!
I'll fix the branch now and follow up with Björn on IRC about the DistroSeriesSou
Cheers,
deryck
| Deryck Hodge (deryck) wrote : | # |
Okay, I've updated based on the recommendations here.
I talked to Björn and after a long discussion on IRC came to the conclusion to have max_bug_heat on Product, Project, Distribution, and DistributionSou
Does this look good to you guys?
Cheers,
deryck
| Eleanor Berger (intellectronica) wrote : | # |
As we discussed on IRC, it will be safer to avoid having a setter for DSP.max_bug_heat, since it uses the distro's value. With that change, r=me.

This is the first step in fixing Bug #511382. This branch provides a max_heat attribute on bug targets and a setMaxHeat method. This branch includes the DB patch and a test to exercise the new attribute on each bug target.
I did a implementation call with Björn to make sure the approach was sane.
To run the test:
./bin/test -cvvt test_bugheat
The branch doesn't use max_heat yet. This branch is only to provide the DB changes. A later branch will need to be provided to update this value in an offline-run script and then convert the icon view to use a target's max_heat, rather than the constant MAX_HEAT.