Merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part2 into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 9449 | ||||
| Proposed branch: | lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part2 | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
636 lines (+296/-94) 12 files modified
database/schema/comments.sql (+5/-1) database/schema/patch-2207-56-0.sql (+24/-0) database/schema/security.cfg (+5/-1) lib/lp/bugs/doc/bug-heat.txt (+14/-0) lib/lp/bugs/interfaces/bugtarget.py (+7/-2) lib/lp/bugs/model/bug.py (+2/-2) lib/lp/bugs/model/bugtarget.py (+8/-12) lib/lp/bugs/model/bugtask.py (+2/-2) lib/lp/bugs/tests/test_bugheat.py (+82/-0) lib/lp/registry/interfaces/distributionsourcepackage.py (+17/-1) lib/lp/registry/model/distributionsourcepackage.py (+125/-71) lib/lp/soyuz/model/publishing.py (+5/-2) |
||||
| To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part2 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Björn Tillenius (community) | db | 2010-06-08 | Abstain on 2010-06-09 |
| Brad Crittenden (community) | code | 2010-06-04 | Approve on 2010-06-04 |
|
Review via email:
|
|||
Description of the Change
Summary
-------
This branch is a follow-up to
lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part2
It adds the attributes to the DistributionSou
DistributionSou
DistributionSou
DistributionSou
classes is deferred, since it is not certain yet whether errors would
occur if a DSP object required a SPPH row to be created first. I added
code to report a silent oops if there is an unexpected creation of a
DSP.
This branch also popuplates total_bug_heat and bug_count columns in the
DistributionSou
po_message_count column will be populated in a later branch.
Implementation details
-------
Allow db users 'lucille', 'uploader', and 'queued' to create a DSP entry
when a SPPH record is created. Allow db user 'processmail' to read the
section table, since that is necessary to check the foreign key on the
DSP table.
database/
Added tests.
lib/
lib/
Automatically insert into DistributionSou
SourcePackagePu
Renamed recalculateMaxB
overrode it in the model's DistributionSou
total_bug_heat and bug_count in addition to max_bug_heat, which it was
already setting.
lib/
lib/
lib/
lib/
lib/
lib/
lib/
Tests
-----
./bin/test -vv -t 'bug-heat.
| Edwin Grubbs (edwin-grubbs) wrote : | # |
I assume the changes to database/
I forgot to create this merge proposal with the previous branch as the dependency, so you will see the same schema changes that have already been reviewed.
| Björn Tillenius (bjornt) wrote : | # |
Changes to security.cfg don't need a DB review, just make sure they are tested.

Hi Edwin,
This change looks great. I marked a couple of niggly bits but that's
all.
--bac
> === added file 'database/ schema/ patch-2207- 56-0.sql' schema/ patch-2207- 56-0.sql 1970-01-01 00:00:00 +0000 schema/ patch-2207- 56-0.sql 2010-06-04 18:48:29 +0000
> --- database/
> +++ database/
> @@ -0,0 +1,24 @@
> +-- Copyright 2009 Canonical Ltd. This software is licensed under the
2010
(The contents of the patch are left for a db review.)
> === modified file 'lib/lp/ bugs/tests/ test_bugheat. py' bugs/tests/ test_bugheat. py 2010-06-01 09:21:32 +0000 bugs/tests/ test_bugheat. py 2010-06-04 18:48:29 +0000
> --- lib/lp/
> +++ lib/lp/
> @@ -7,8 +7,11 @@
Edwin this test is really readable and easy to follow. Good job.
> import unittest ssLayer Factory makeDistributio nSourcePackage( ) rcePackageNullB ugHeatCacheTest ( tory): ssLayer tory.setUp( self) makeDistributio nSourcePackage( ) max_bug_ heat(self) : l(None, self.target. max_bug_ heat) total_bug_ heat(self) : l(None, self.target. total_bug_ heat) bug_count( self): l(None, self.target. bug_count) rcePackageZeroR ecalculateBugHe atCacheTest( tory): ssLayer tory.setUp( self) makeDistributio nSourcePackage( ) recalculateBugH eatCache( ) max_bug_ heat(self) : max_bug_ heat) total_bug_ heat(self) : total_bug_ heat) bug_count( self): bug_count) rcePackageMulti pleBugsRecalcul ateBugHeatCache Test( tory): ssLayer tory.setUp( self) makeDistributio nSourcePackage( ) makeBugTask( target= self.target) makeBugTask( target= self.target)
>
> +from storm.store import Store
> +
> from canonical.testing import LaunchpadZopele
>
> +from lp.testing import TestCaseWithFactory
> from lp.testing.factory import LaunchpadObject
>
>
> @@ -58,6 +61,85 @@
> def setUp(self):
> self.target = self.factory.
>
> +class DistributionSou
> + TestCaseWithFac
> + """Ensure distro source package cache values start at None."""
> +
> + layer = LaunchpadZopele
> +
> + def setUp(self):
> + TestCaseWithFac
> + self.target = self.factory.
> +
> + def test_null_
> + self.assertEqua
> +
> + def test_null_
> + self.assertEqua
> +
> + def test_null_
> + self.assertEqua
> +
> +
> +class DistributionSou
> + TestCaseWithFac
> + """Ensure distro source package cache values become zero properly."""
> +
> + layer = LaunchpadZopele
> +
> + def setUp(self):
> + TestCaseWithFac
> + self.target = self.factory.
> + self.target.
> +
> + def test_zero_
> + self.assertEqual(0, self.target.
> +
> + def test_zero_
> + self.assertEqual(0, self.target.
> +
> + def test_zero_
> + self.assertEqual(0, self.target.
> +
> +
> +class DistributionSou
> + TestCaseWithFac
> + """Ensure distro source package cache values are set properly."""
> +
> + layer = LaunchpadZopele
> +
> + def setUp(self):
> + TestCaseWithFac
> + self.target = self.factory.
> + self.bugtask1 = self.factory.
> + self.bugtask2 = self.factory.
> + # Bug heat gets calculated by complicated rules in a db
> + # stored procedure. We will override them here to avoid
> + # testing inconsitencies if those values are calculated
> + # differently in the future.
> + #...