Merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part3 into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Edwin Grubbs on 2010-06-25 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 9497 | ||||
| Proposed branch: | lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part3 | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Prerequisite: | lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part3-base | ||||
| Diff against target: |
347 lines (+97/-80) 6 files modified
database/schema/comments.sql (+1/-1) database/schema/patch-2207-56-0.sql (+52/-1) lib/lp/registry/doc/distroseries.txt (+1/-1) lib/lp/registry/model/distributionsourcepackage.py (+33/-47) lib/lp/registry/model/distroseries.py (+9/-29) lib/lp/registry/templates/distroseries-needs-packaging.pt (+1/-1) |
||||
| To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-535430-needspackaging-timeout-part3 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Stuart Bishop | db | 2010-06-22 | Approve on 2010-06-25 |
| Brad Crittenden (community) | code | 2010-06-22 | Approve on 2010-06-22 |
| Björn Tillenius | db | 2010-06-23 | Pending |
|
Review via email:
|
|||
Description of the Change
Summary
-------
This branch extends the work from
bug-535430-needspackaging
revision 9449 but got reverted in revision 9451 due to the NOT NULL
constraint on the DistributionSou
added. After looking into it more, it became apparent that caching the
section in the DSP table wasn't really necessary, since it was only used
to guess if a package is a metapackage by checking if it was in the
'misc' section. A metapackage does not need a link to its upstream
project, so it can be safely ignored by the
$distroseries/
the first place.
This branch changes the db patch to add the is_upstream_
boolean to the DistributionSou
foreign key.
Implementation details
-------
DistributionSou
database/
database/
lib/
Modified the getPrioritizedU
+needs-packaging page uses:
lib/
lib/
lib/
Tests
-----
./bin/test -vv -t 'xx-show-
Demo and Q/A
------------
* Open http://
* On staging, this should no longer timeout.
| Stuart Bishop (stub) wrote : | # |
The first INSERT needs an ORDER BY clause, or we could end up with inconsistent data between the master and slave databases:
INSERT INTO DistributionSou
SELECT ds.distribution, sourcepackagename
FROM SourcePackagePu
JOIN Archive ON spph.archive = Archive.id
JOIN SourcePackageRe
JOIN DistroSeries ds ON spph.distroseries = ds.id
WHERE ds.releasestatus = 4 -- CURRENT
AND Archive.purpose = 1 -- PRIMARY
EXCEPT
SELECT distribution, sourcepackagename
FROM DistributionSou
ORDER BY distribution, sourcepackagename;
We also need to repack the table when we are done, so add at the end:
CLUSTER DistributionSou
USING distributionpac

Hi Edwin,
We already discussed some of these on IRC:
* "Whether an upstream link should be added if it does not already exist." s/should/may
* For clarity I'd change link_allowed = spph.section.name == 'misc' to link_allowed = (spph.section.name == 'misc')
is_upstream_
is_upstream_
I also note that code appears twice in the module. Perhaps you can refactor it.
Otherwise the branch looks good. Thanks.