Merge lp://staging/~stevenk/launchpad/db-add-bprc into lp://staging/launchpad/db-devel
Status: | Merged |
---|---|
Approved by: | Steve Kowalik |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10693 |
Proposed branch: | lp://staging/~stevenk/launchpad/db-add-bprc |
Merge into: | lp://staging/launchpad/db-devel |
Diff against target: |
416 lines (+341/-0) 10 files modified
database/schema/comments.sql (+10/-0) database/schema/patch-2208-76-0.sql (+17/-0) database/schema/security.cfg (+2/-0) lib/lp/soyuz/configure.zcml (+34/-0) lib/lp/soyuz/interfaces/binarypackagepath.py (+36/-0) lib/lp/soyuz/interfaces/binarypackagereleasecontents.py (+43/-0) lib/lp/soyuz/model/binarypackagepath.py (+37/-0) lib/lp/soyuz/model/binarypackagereleasecontents.py (+70/-0) lib/lp/soyuz/tests/test_binarypackagepath.py (+26/-0) lib/lp/soyuz/tests/test_binarypackagereleasecontents.py (+66/-0) |
To merge this branch: | bzr merge lp://staging/~stevenk/launchpad/db-add-bprc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant (community) | code | Approve | |
Gavin Panella (community) | Abstain | ||
Stuart Bishop (community) | db | Approve | |
Robert Collins | db | Pending | |
Review via email: mp+64783@code.staging.launchpad.net |
Commit message
[r=stub,wgrant][bug=796997][incr] Add infrastructure to eventually support contents generation from the database.
Description of the change
(Updated to facilitate code review.)
Add a two new tables, BinaryPackagePath and BinaryPackageRe
Background:
Currently, Contents generation (for example, the file at http://
These two tables completes the first step of moving contents generation into the database, and lets it do the heavy lifting, rather than cocoplum's disk. This also gives us the opportunity to perform Contents generation for PPAs.
The next step of the plan is to have a garbo script that slowly populates these tables (but not yet, since they will be large).
The end goal is to move Contents generation into the publisher itself, where it will query the table by a list of BPRs and get back every single filename that the BPRs contain.
IBinaryPackageP
The idea behind these two interfaces and database table is so that a filename that is in the contents of a Binary Package Release (such as, 'bin/true'), is only mentioned once.
IBinaryPackageR
These two interfaces and database table are to link a given Binary Package Release (BPR) to its contents, where the filenames are joined from BinaryPackagePath. Note that a given BPR will have multiple rows in BPRC, one for each file, but each BPR can only link to a given file once.
Tests: All new, all shiny.
BinaryPackagePa th.path should be UNIQUE NOT NULL.
Shouldn't this table be called BinaryPackageRe leasePath to match BinaryPackageRe leaseContents?
Both columns in BinaryPackageRe leaseContents should be NOT NULL.
patch-2208-76-0.sql
You likely will want this construct to ensure a path exists in the BinaryPackageRe leasePaths table. This will avoid race conditions in scripts (not running in serializable isolation):
insert into binarypackagepaths (path) select 'foo' where not exists (select * from binarypackagepaths where path='foo');