Merge lp:~gmb/launchpad/heat-garbo-hourly-bug-509195 into lp:launchpad/db-devel
Proposed by
Graham Binns
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~gmb/launchpad/heat-garbo-hourly-bug-509195 |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
410 lines (+172/-52) 7 files modified
database/schema/security.cfg (+2/-1) lib/canonical/config/schema-lazr.conf (+1/-0) lib/canonical/launchpad/scripts/garbo.py (+19/-16) lib/lp/bugs/configure.zcml (+1/-0) lib/lp/bugs/doc/bug-heat.txt (+117/-32) lib/lp/bugs/interfaces/bug.py (+11/-1) lib/lp/bugs/model/bug.py (+21/-2) |
To merge this branch: | bzr merge lp:~gmb/launchpad/heat-garbo-hourly-bug-509195 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+20729@code.launchpad.net |
Commit message
Bugs with out-of-date heat will now have CalculateBugHea
Description of the change
This branch adds a job to the hourly garbage collector to mop up bugs with out-of-date heat.
In this branch I've added Bug.heat_
I've also added permissions to the garbo db user so that it can add new BugJobs.
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Graham,
nice banch! I have just two nitpicks, see below.
Abel
> === modified file 'lib/lp/ bugs/doc/ bug-heat. txt' bugs/doc/ bug-heat. txt 2010-03-03 13:10:17 +0000 bugs/doc/ bug-heat. txt 2010-03-05 10:13:32 +0000
> --- lib/lp/
> +++ lib/lp/
[...]
> +it as a method will add jobs to calculate the heat of for all the bugs
> +whose heat is more than seven days old.
I think one of ('of', 'for') is sufficient ;)
> + interfaces. bugjob import ICalculateBugHe atJobSource ICalculateBugHe atJobSource) .iterReady( ): job.start( ) job.complete( ) (ICalculateBugH eatJobSource) .iterReady( )) commit( ) IBugSet) .getBugsWithOut datedHeat( 1).count( )
> +Before update_bug_heat is called, we'll ensure that there are no waiting
> +jobs in the bug heat calculation queue.
> +
> + >>> from lp.bugs.
> + >>> for calc_job in
getUtility(
> + ... calc_job.
> + ... calc_job.
> +
> + >>> ready_jobs =
list(getUtility
> + >>> len(ready_jobs)
> + 0
> +
> +We need to commit here to ensure that the bugs we've created are
> +available to the update_bug_heat script.
> +
> + >>> import transaction
> + >>> transaction.
> +
> + >>> getUtility(
> + 2
> +
> +We need to run update_bug_heat() twice to ensure that both the bugs are
> +updated.
I think you call update_bug_heat() in this doc test only once. But it
seems it should be called with chunksize=2 to ensure both bugs are
processed.
> + bug_heat( chunk_size= 2) tJobs for 2 Bugs (starting id: ...)
> + >>> update_
> + DEBUG Adding CalculateBugHea
> + DEBUG Adding CalculateBugHeatJob for bug ...
> + DEBUG Adding CalculateBugHeatJob for bug ...
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org
Phm8NrtARApukAJ oCrVwFFnMkn4bR+ JHA6lbUGQaZigCg kHXF qmb/8X7o=
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFLkODxekB
ARR5bSLClYT7Elx
=+2Ba
-----END PGP SIGNATURE-----