Merge lp:~wgrant/launchpad/distroseries-source-format-selection-part1 into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Julian Edwards
Approved revision: not available
Merge reported by: William Grant
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/distroseries-source-format-selection-part1
Merge into: lp:launchpad
Diff against target: 4589 lines
To merge this branch: bzr merge lp:~wgrant/launchpad/distroseries-source-format-selection-part1
Reviewer Review Type Date Requested Status
Julian Edwards (community) code Approve
Gavin Panella (community) Approve
Review via email: mp+14729@code.launchpad.net

Commit message

Refactor bits and pieces to prepare for Debian source format 3.0 support.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

This is hopefully the second last of my Debian source format 3.0 branches. It has minimal 3.0-specific changes, as it mainly refactoring to support the new file types and multiple formats.

Note that the sample data changes are all from schema changes in previous branches, with the exception of the 'INSERT INTO sourcepackageformatselection' lines which are new (they permit the 1.0 format in all series in the sample data).

The main changes are:

Making way for new files (new compression algorithms and completely new file types):
 - Renamed SourcePackageFileType.ORIG to ORIG_TARBALL, and SPFT.TARBALL to NATIVE_TARBALL, as there will be other kinds of orig and tarball soon.
 - Isolated extension matching on source files into determine_source_file_type.

Adding multiple source format support to archiveuploader:
 - Removed most of the checks from NU._check_binaryful_consistency, since we cannot make many assertions until we know the DSC format.
 - Extended DSCFile.checkFiles to perform the checks that NU._check_binaryful_consistency used have, but in a more extensible manner.

Forbidding uploads and copies of sources to series without appropriate format support:
 - Added the SourcePackageFormat enum with 1.0, 3.0 (quilt) and 3.0 (native) formats.
 - Added (I)SourcePackageFormatSelection, which uses a DB table added late in 3.1.10.
 - Added DB permissions for SPFS.
 - Added (I)DistroSeries.{permitSourcePackageFormat,isSourceFormatPermitted} to allow manipulation and verification of allowed formats.
 - Extended DS._copy_component_and_section_selections to also copy SourcePackageFormatSelections during intialiseFromParent.
 - In CopyChecker.checkCopy, reject a copy if the target does not support the source format.
 - Replace the self.format != "1.0" check in archiveuploader with a check that the format is supported by the target series.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Hi William, thanks for making this change. There's some much-needed refactoring and clearing up in nascentupload.

The basic direction is good, I just have a few comments to make for things that need fixing. Gavin will do a more thorough review as we agreed on IRC.

General questions:

 * I can't tell from the diff but are the db permissions added for the new table correctly tested in the tests? This usually just means ensuring that the test runs as the correct db user.
 * The XXX about the orphaned files is interesting. I don't think we deal with this right now do we? I'm trying to think if it would be bad to reject the upload if we detect orphan files, and I can't think of one. What's your opinion?

Things that need fixing:

 * The upload format check is not tested. (The "%s: format '%s' is not permitted in %s." one)

 * IDistroSeries methods permitSourcePackageFormat() and isSourcePackageFormatPermitted() should be in a utility, e.g. SourcePackageFormatSet. This ensures that in a zopeful environment they are security wrapped. Although the upload processor is zopeless, we might need to do that one day. Something like
   * SourcePackageFormatSet.add()
   * SourcePackageFormatSet.getByFormat()
   would fit with our current style. You can keep the isSourcePackageFormatPermitted() and make it call the utility method as a convenience, but the permitSourcePackageFormat() should go.

 * Once that's done, you should remove the __init__ on the SourcePackageFormat model class and make the new utility's add() method initialise the correct fields.

Everything else looks great, thanks!

review: Needs Fixing
Revision history for this message
Gavin Panella (allenap) wrote :
Download full text (34.9 KiB)

Hi William,

As Julian has already reviewed the logic in this branch, I'll just do
a style/convention review.

I really have very little to say, and that which I have said is pretty
trivial. It's inline with the diff below.

Running `make lint` generated a lot of warnings. Please can you clean
up those that make sense.

Thanks, Gavin.

> === modified file 'database/schema/security.cfg'
> --- database/schema/security.cfg 2009-11-06 01:16:21 +0000
> +++ database/schema/security.cfg 2009-11-11 14:24:18 +0000
> @@ -271,6 +271,7 @@
> public.shippingrun = SELECT, INSERT, UPDATE
> public.sourcepackagepublishinghistory = SELECT
> public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE
> +public.sourcepackageformatselection = SELECT
> public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
> public.specificationbug = SELECT, INSERT, DELETE
> public.specificationdependency = SELECT, INSERT, DELETE
> @@ -986,6 +987,7 @@
> public.section = SELECT, INSERT, UPDATE
> public.sectionselection = SELECT, INSERT, UPDATE
> public.signedcodeofconduct = SELECT, INSERT, UPDATE
> +public.sourcepackageformatselection = SELECT, INSERT

This should go after the following line. Wow, how pedantic I am :)

> public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE
> public.sourcepackagename = SELECT, INSERT, UPDATE
> public.sourcepackagepublishinghistory = SELECT
> @@ -1103,6 +1105,7 @@
> public.archivepermission = SELECT
> public.processor = SELECT
> public.processorfamily = SELECT
> +public.sourcepackageformatselection = SELECT
>
> # Source and Binary packages and builds
> public.sourcepackagename = SELECT, INSERT
>
> === modified file 'lib/canonical/launchpad/helpers.py'
> --- lib/canonical/launchpad/helpers.py 2009-07-17 00:26:05 +0000
> +++ lib/canonical/launchpad/helpers.py 2009-11-11 14:24:18 +0000
> @@ -477,9 +477,9 @@
> if fname.endswith(".diff.gz"):
> return SourcePackageFileType.DIFF
> if fname.endswith(".orig.tar.gz"):
> - return SourcePackageFileType.ORIG
> + return SourcePackageFileType.ORIG_TARBALL
> if fname.endswith(".tar.gz"):
> - return SourcePackageFileType.TARBALL
> + return SourcePackageFileType.NATIVE_TARBALL
>
>
> BINARYPACKAGE_EXTENSIONS = {
>
> === modified file 'lib/lp/archiveuploader/dscfile.py'
> --- lib/lp/archiveuploader/dscfile.py 2009-06-24 23:33:29 +0000
> +++ lib/lp/archiveuploader/dscfile.py 2009-11-11 14:24:18 +0000
> @@ -31,10 +31,13 @@
> parse_tagfile, TagFileParseError)
> from lp.archiveuploader.utils import (
> prefix_multi_line_string, safe_fix_maintainer, ParseMaintError,
> - re_valid_pkg_name, re_valid_version, re_issource)
> + re_valid_pkg_name, re_valid_version, re_issource,
> + determine_source_file_type)
> from canonical.encoding import guess as guess_encoding
> from lp.registry.interfaces.person import IPersonSet, PersonCreationRationale
> +from lp.registry.interfaces.sourcepackage import Source...

review: Approve
Revision history for this message
William Grant (wgrant) wrote :

> Hi William, thanks for making this change. There's some much-needed
> refactoring and clearing up in nascentupload.
>
> The basic direction is good, I just have a few comments to make for things
> that need fixing. Gavin will do a more thorough review as we agreed on IRC.
>
> General questions:
>
> * I can't tell from the diff but are the db permissions added for the new
> table correctly tested in the tests? This usually just means ensuring that
> the test runs as the correct db user.

I'll have to look at that later. I'm not quite sure.

> * The XXX about the orphaned files is interesting. I don't think we deal
> with this right now do we? I'm trying to think if it would be bad to reject
> the upload if we detect orphan files, and I can't think of one. What's your
> opinion?

I think there is a word or two missing there. You mean you can't think of a reason that it would be bad, or that it wouldn't be bad?

I can't see any compelling reason to reject if it has extra files, apart from it seeming slightly cleaner. If you feel it needs to be done, it's probably easy enough to add.

> Things that need fixing:
>
> * The upload format check is not tested. (The "%s: format '%s' is not
> permitted in %s." one)

Ah, yes, forgot about that. The other half of the branch has 3.0 format test source packages, and tests that. I suppose I should bring one of those in.

> * IDistroSeries methods permitSourcePackageFormat() and
> isSourcePackageFormatPermitted() should be in a utility, e.g.
> SourcePackageFormatSet. This ensures that in a zopeful environment they are
> security wrapped. Although the upload processor is zopeless, we might need to
> do that one day. Something like
> * SourcePackageFormatSet.add()
> * SourcePackageFormatSet.getByFormat()
> would fit with our current style. You can keep the
> isSourcePackageFormatPermitted() and make it call the utility method as a
> convenience, but the permitSourcePackageFormat() should go.
>
> * Once that's done, you should remove the __init__ on the SourcePackageFormat
> model class and make the new utility's add() method initialise the correct
> fields.

OK, sure. Will fix.

> Everything else looks great, thanks!

Thanks for the review.

Revision history for this message
William Grant (wgrant) wrote :
Download full text (37.3 KiB)

Hi Gavin,

Thanks for the review.

> Hi William,
>
> As Julian has already reviewed the logic in this branch, I'll just do
> a style/convention review.
>
> I really have very little to say, and that which I have said is pretty
> trivial. It's inline with the diff below.
>
> Running `make lint` generated a lot of warnings. Please can you clean
> up those that make sense.

I don't think any of those are actually mine, and I felt my diff was big enough. If you think I should clean them up anyway, I will.

> Thanks, Gavin.
>
>
> > === modified file 'database/schema/security.cfg'
> > --- database/schema/security.cfg 2009-11-06 01:16:21 +0000
> > +++ database/schema/security.cfg 2009-11-11 14:24:18 +0000
> > @@ -271,6 +271,7 @@
> > public.shippingrun = SELECT, INSERT, UPDATE
> > public.sourcepackagepublishinghistory = SELECT
> > public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE
> > +public.sourcepackageformatselection = SELECT
> > public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
> > public.specificationbug = SELECT, INSERT, DELETE
> > public.specificationdependency = SELECT, INSERT, DELETE
> > @@ -986,6 +987,7 @@
> > public.section = SELECT, INSERT, UPDATE
> > public.sectionselection = SELECT, INSERT, UPDATE
> > public.signedcodeofconduct = SELECT, INSERT, UPDATE
> > +public.sourcepackageformatselection = SELECT, INSERT
>
> This should go after the following line. Wow, how pedantic I am :)

Oops -- I renamed the table after I added this line. Fixed.

> > public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE
> > public.sourcepackagename = SELECT, INSERT, UPDATE
> > public.sourcepackagepublishinghistory = SELECT
> > @@ -1103,6 +1105,7 @@
> > public.archivepermission = SELECT
> > public.processor = SELECT
> > public.processorfamily = SELECT
> > +public.sourcepackageformatselection = SELECT
> >
> > # Source and Binary packages and builds
> > public.sourcepackagename = SELECT, INSERT
> >
> > === modified file 'lib/canonical/launchpad/helpers.py'
> > --- lib/canonical/launchpad/helpers.py 2009-07-17 00:26:05 +0000
> > +++ lib/canonical/launchpad/helpers.py 2009-11-11 14:24:18 +0000
> > @@ -477,9 +477,9 @@
> > if fname.endswith(".diff.gz"):
> > return SourcePackageFileType.DIFF
> > if fname.endswith(".orig.tar.gz"):
> > - return SourcePackageFileType.ORIG
> > + return SourcePackageFileType.ORIG_TARBALL
> > if fname.endswith(".tar.gz"):
> > - return SourcePackageFileType.TARBALL
> > + return SourcePackageFileType.NATIVE_TARBALL
> >
> >
> > BINARYPACKAGE_EXTENSIONS = {
> >
> > === modified file 'lib/lp/archiveuploader/dscfile.py'
> > --- lib/lp/archiveuploader/dscfile.py 2009-06-24 23:33:29 +0000
> > +++ lib/lp/archiveuploader/dscfile.py 2009-11-11 14:24:18 +0000
> > @@ -31,10 +31,13 @@
> > parse_tagfile, TagFileParseError)
> > from lp.archiveuploader.utils import (
> > prefix_multi_line_string...

Revision history for this message
Gavin Panella (allenap) wrote :

On Wed, 11 Nov 2009 21:53:34 -0000
William Grant <email address hidden> wrote:

> Hi Gavin,
>
> Thanks for the review.
>
> > Hi William,
> >
> > As Julian has already reviewed the logic in this branch, I'll just do
> > a style/convention review.
> >
> > I really have very little to say, and that which I have said is pretty
> > trivial. It's inline with the diff below.
> >
> > Running `make lint` generated a lot of warnings. Please can you clean
> > up those that make sense.
>
> I don't think any of those are actually mine, and I felt my diff was big enough. If you think I should clean them up anyway, I will.

It's not essential, but in general it's good to clean up while moving
through the tree because there's a lot of crud from before we
cared. If you do feel energetic enough to sort some of them out
(anything is better than nothing), then do it in a follow-on branch,
and just ask for a sanity-check review before landing it.

Gavin.

Revision history for this message
William Grant (wgrant) wrote :

Hi Julian,

On Wed, 2009-11-11 at 21:30 +0000, William Grant wrote:
> > Hi William, thanks for making this change. There's some much-needed
> > refactoring and clearing up in nascentupload.
> >
> > The basic direction is good, I just have a few comments to make for things
> > that need fixing. Gavin will do a more thorough review as we agreed on IRC.
> >
> > General questions:
> >
> > * I can't tell from the diff but are the db permissions added for the new
> > table correctly tested in the tests? This usually just means ensuring that
> > the test runs as the correct db user.
>
> I'll have to look at that later. I'm not quite sure.

I'm not entirely sure how to check this, but I would really hope that
the upload and copy code paths were already executed as the relevant
users at some point in the test suite.

> > * The XXX about the orphaned files is interesting. I don't think we deal
> > with this right now do we? I'm trying to think if it would be bad to reject
> > the upload if we detect orphan files, and I can't think of one. What's your
> > opinion?
>
> I think there is a word or two missing there. You mean you can't think of a reason that it would be bad, or that it wouldn't be bad?
>
> I can't see any compelling reason to reject if it has extra files, apart from it seeming slightly cleaner. If you feel it needs to be done, it's probably easy enough to add.

As discussed on IRC, I've removed the XXX.

> > Things that need fixing:
> >
> > * The upload format check is not tested. (The "%s: format '%s' is not
> > permitted in %s." one)
>
> Ah, yes, forgot about that. The other half of the branch has 3.0 format test source packages, and tests that. I suppose I should bring one of those in.

I've created a 3.0 (quilt) source package and brought across the
relevant test from the second branch.

> > * IDistroSeries methods permitSourcePackageFormat() and
> > isSourcePackageFormatPermitted() should be in a utility, e.g.
> > SourcePackageFormatSet. This ensures that in a zopeful environment they are
> > security wrapped. Although the upload processor is zopeless, we might need to
> > do that one day. Something like
> > * SourcePackageFormatSet.add()
> > * SourcePackageFormatSet.getByFormat()
> > would fit with our current style. You can keep the
> > isSourcePackageFormatPermitted() and make it call the utility method as a
> > convenience, but the permitSourcePackageFormat() should go.
> >
> > * Once that's done, you should remove the __init__ on the SourcePackageFormat
> > model class and make the new utility's add() method initialise the correct
> > fields.
>
> OK, sure. Will fix.

Fixed.

The intermediate diff is attached.

=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2009-11-10 13:09:26 +0000
+++ database/schema/security.cfg 2009-11-11 21:34:02 +0000
@@ -987,8 +987,8 @@
987public.section = SELECT, INSERT, UPDATE987public.section = SELECT, INSERT, UPDATE
988public.sectionselection = SELECT, INSERT, UPDATE988public.sectionselection = SELECT, INSERT, UPDATE
989public.signedcodeofconduct = SELECT, INSERT, UPDATE989public.signedcodeofconduct = SELECT, INSERT, UPDATE
990public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE
990public.sourcepackageformatselection = SELECT, INSERT991public.sourcepackageformatselection = SELECT, INSERT
991public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE
992public.sourcepackagename = SELECT, INSERT, UPDATE992public.sourcepackagename = SELECT, INSERT, UPDATE
993public.sourcepackagepublishinghistory = SELECT993public.sourcepackagepublishinghistory = SELECT
994public.securesourcepackagepublishinghistory = SELECT, INSERT, UPDATE994public.securesourcepackagepublishinghistory = SELECT, INSERT, UPDATE
995995
=== modified file 'lib/lp/archiveuploader/nascentupload.py'
--- lib/lp/archiveuploader/nascentupload.py 2009-11-10 13:09:26 +0000
+++ lib/lp/archiveuploader/nascentupload.py 2009-11-12 11:44:36 +0000
@@ -325,9 +325,6 @@
325325
326326
327 # It is never sane to upload more than one source at a time.327 # It is never sane to upload more than one source at a time.
328 # XXX: What about orphaned files? How will that work?
329 # I think we might need to verify that all source files are
330 # claimed by a dsc.
331 if dsc > 1:328 if dsc > 1:
332 self.reject("Changes file lists more than one .dsc")329 self.reject("Changes file lists more than one .dsc")
333330
334331
=== added directory 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt'
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz'
335Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 2009-11-12 11:51:53 +0000 differ332Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 2009-11-12 11:51:53 +0000 differ
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc 2009-11-12 11:51:53 +0000
@@ -0,0 +1,16 @@
1Format: 3.0 (quilt)
2Source: bar
3Binary: bar
4Architecture: any
5Version: 1.0-1
6Maintainer: Launchpad team <launchpad@lists.canonical.com>
7Standards-Version: 3.6.2
8Checksums-Sha1:
9 73a04163fee97fd2257ab266bd48f1d3d528e012 164 bar_1.0.orig.tar.gz
10 abce262314a7c0ca00e43598f21b41a3e6ff6b21 688 bar_1.0-1.debian.tar.gz
11Checksums-Sha256:
12 f1ecff929899b567f45d6734b69d59a4f3c04dabce3cc8e6ed6d64073eda360e 164 bar_1.0.orig.tar.gz
13 ffdcce60fca14618f68483ca77a206f332a3773dc7ece1c3e6de55c0118c69c6 688 bar_1.0-1.debian.tar.gz
14Files:
15 fc1464e5985b962a042d5354452f361d 164 bar_1.0.orig.tar.gz
16 056db4dfe7de8322296b6d417592ee01 688 bar_1.0-1.debian.tar.gz
017
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes 2009-11-12 11:51:54 +0000
@@ -0,0 +1,28 @@
1Format: 1.8
2Date: Thu, 16 Feb 2006 15:34:09 +0000
3Source: bar
4Binary: bar
5Architecture: source
6Version: 1.0-1
7Distribution: breezy
8Urgency: low
9Maintainer: Launchpad team <launchpad@lists.canonical.com>
10Changed-By: Daniel Silverstone <daniel.silverstone@canonical.com>
11Description:
12 bar - Stuff for testing
13Changes:
14 bar (1.0-1) breezy; urgency=low
15 .
16 * Initial version
17Checksums-Sha1:
18 bc97e185cf31af33bf8d109044ce51f32d09c229 645 bar_1.0-1.dsc
19 73a04163fee97fd2257ab266bd48f1d3d528e012 164 bar_1.0.orig.tar.gz
20 abce262314a7c0ca00e43598f21b41a3e6ff6b21 688 bar_1.0-1.debian.tar.gz
21Checksums-Sha256:
22 ae0fb16941a95518332a8ee962d00d55963b491c2df94b3f230a65d2bdbeedf8 645 bar_1.0-1.dsc
23 f1ecff929899b567f45d6734b69d59a4f3c04dabce3cc8e6ed6d64073eda360e 164 bar_1.0.orig.tar.gz
24 ffdcce60fca14618f68483ca77a206f332a3773dc7ece1c3e6de55c0118c69c6 688 bar_1.0-1.debian.tar.gz
25Files:
26 c320d2827f08f09ec2e1bbbac635225c 645 devel optional bar_1.0-1.dsc
27 fc1464e5985b962a042d5354452f361d 164 devel optional bar_1.0.orig.tar.gz
28 056db4dfe7de8322296b6d417592ee01 688 devel optional bar_1.0-1.debian.tar.gz
029
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz'
1Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 2009-11-12 11:47:52 +0000 differ30Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 2009-11-12 11:47:52 +0000 differ
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-10 13:09:26 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-12 11:49:00 +0000
@@ -49,7 +49,8 @@
49from lp.soyuz.interfaces.archivepermission import (49from lp.soyuz.interfaces.archivepermission import (
50 ArchivePermissionType, IArchivePermissionSet)50 ArchivePermissionType, IArchivePermissionSet)
51from lp.soyuz.interfaces.component import IComponentSet51from lp.soyuz.interfaces.component import IComponentSet
52from lp.soyuz.interfaces.sourcepackageformat import SourcePackageFormat52from lp.soyuz.interfaces.sourcepackageformat import (
53 ISourcePackageFormatSelectionSet, SourcePackageFormat)
53from lp.registry.interfaces.person import IPersonSet54from lp.registry.interfaces.person import IPersonSet
54from lp.registry.interfaces.sourcepackagename import (55from lp.registry.interfaces.sourcepackagename import (
55 ISourcePackageNameSet)56 ISourcePackageNameSet)
@@ -192,7 +193,9 @@
192 permitted_formats = [SourcePackageFormat.FORMAT_1_0]193 permitted_formats = [SourcePackageFormat.FORMAT_1_0]
193194
194 for format in permitted_formats:195 for format in permitted_formats:
195 self.breezy.permitSourcePackageFormat(format)196 if not self.breezy.isSourcePackageFormatPermitted(format):
197 getUtility(ISourcePackageFormatSelectionSet).add(
198 self.breezy, format)
196199
197 def addMockFile(self, filename, content="anything"):200 def addMockFile(self, filename, content="anything"):
198 """Return a librarian file."""201 """Return a librarian file."""
@@ -1404,6 +1407,28 @@
1404 ]1407 ]
1405 self.assertEmail(contents, recipients=recipients)1408 self.assertEmail(contents, recipients=recipients)
14061409
1410 def test30QuiltUploadToUnsupportingSeriesIsRejected(self):
1411 """Ensure that uploads to series without format support are rejected.
1412
1413 Series can restrict the source formats that they accept. Uploads
1414 should be rejected if an unsupported format is uploaded.
1415 """
1416 self.setupBreezy()
1417 self.layer.txn.commit()
1418 self.options.context = 'absolutely-anything'
1419 uploadprocessor = UploadProcessor(
1420 self.options, self.layer.txn, self.log)
1421
1422 # Upload the source.
1423 upload_dir = self.queueUpload("bar_1.0-1_3.0-quilt")
1424 self.processUpload(uploadprocessor, upload_dir)
1425 # Make sure it was rejected.
1426 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
1427 self.assertTrue(
1428 "bar_1.0-1.dsc: format '3.0 (quilt)' is not permitted in "
1429 "breezy." in raw_msg,
1430 "Source was not rejected properly:\n%s" % raw_msg)
1431
14071432
1408def test_suite():1433def test_suite():
1409 return unittest.TestLoader().loadTestsFromName(__name__)1434 return unittest.TestLoader().loadTestsFromName(__name__)
14101435
=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py 2009-11-10 13:09:26 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py 2009-11-11 21:49:51 +0000
@@ -24,17 +24,19 @@
24 from lp.archiveuploader.utils import determine_source_file_type24 from lp.archiveuploader.utils import determine_source_file_type
2525
26 self.assertEquals(26 self.assertEquals(
27 determine_source_file_type('foo_1.0-1.dsc'),27 SourcePackageFileType.DSC,
28 SourcePackageFileType.DSC)28 determine_source_file_type('foo_1.0-1.dsc'))
29 self.assertEquals(29 self.assertEquals(
30 determine_source_file_type('foo_1.0-1.diff.gz'),30 SourcePackageFileType.DIFF,
31 SourcePackageFileType.DIFF)31 determine_source_file_type('foo_1.0-1.diff.gz'))
32 self.assertEquals(32 self.assertEquals(
33 determine_source_file_type('foo_1.0.orig.tar.gz'),33 SourcePackageFileType.ORIG_TARBALL,
34 SourcePackageFileType.ORIG_TARBALL)34 determine_source_file_type('foo_1.0.orig.tar.gz'))
35 self.assertEquals(35 self.assertEquals(
36 determine_source_file_type('foo_1.0.tar.gz'),36 SourcePackageFileType.NATIVE_TARBALL,
37 SourcePackageFileType.NATIVE_TARBALL)37 determine_source_file_type('foo_1.0.tar.gz'))
38 self.assertEquals(None, determine_source_file_type('foo_1.0'))
39 self.assertEquals(None, determine_source_file_type('foo_1.0.blah.gz'))
3840
39 def testPrefixMultilineString(self):41 def testPrefixMultilineString(self):
40 """lp.archiveuploader.utils.prefix_multi_line_string should work"""42 """lp.archiveuploader.utils.prefix_multi_line_string should work"""
4143
=== modified file 'lib/lp/archiveuploader/utils.py'
--- lib/lp/archiveuploader/utils.py 2009-11-10 13:09:26 +0000
+++ lib/lp/archiveuploader/utils.py 2009-11-11 21:49:20 +0000
@@ -34,12 +34,11 @@
3434
35re_isadeb = re.compile(r"(.+?)_(.+?)_(.+)\.(u?d?deb)$")35re_isadeb = re.compile(r"(.+?)_(.+?)_(.+)\.(u?d?deb)$")
3636
37source_file_exts = ['orig.tar.gz', 'diff.gz', 'tar.gz', 'dsc']
37re_issource = re.compile(38re_issource = re.compile(
38 r"(.+)_(.+?)\."39 r"(.+)_(.+?)\.(%s)" % "|".join(
39 "(orig\.tar\.gz"40 re.escape(ext) for ext in source_file_exts))
40 "|diff\.gz"41
41 "|tar\.gz"
42 "|dsc)$")
43re_is_orig_tar_ext = re.compile(r"^orig.tar.gz$")42re_is_orig_tar_ext = re.compile(r"^orig.tar.gz$")
44re_is_native_tar_ext = re.compile(r"^tar.gz$")43re_is_native_tar_ext = re.compile(r"^tar.gz$")
4544
@@ -78,6 +77,8 @@
78 return SourcePackageFileType.ORIG_TARBALL77 return SourcePackageFileType.ORIG_TARBALL
79 elif re_is_native_tar_ext.match(extension):78 elif re_is_native_tar_ext.match(extension):
80 return SourcePackageFileType.NATIVE_TARBALL79 return SourcePackageFileType.NATIVE_TARBALL
80 else:
81 return None
8182
8283
83def prefix_multi_line_string(str, prefix, include_blank_lines=0):84def prefix_multi_line_string(str, prefix, include_blank_lines=0):
8485
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2009-11-10 13:09:26 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2009-11-12 11:00:33 +0000
@@ -205,12 +205,6 @@
205 def newMilestone(name, dateexpected=None, summary=None, code_name=None):205 def newMilestone(name, dateexpected=None, summary=None, code_name=None):
206 """Create a new milestone for this DistroSeries."""206 """Create a new milestone for this DistroSeries."""
207207
208 def permitSourcePackageFormat(format):
209 """Permit a source format to be uploaded to this series.
210
211 :param format: The SourcePackageFormat to permit.
212 """
213
214208
215class ISeriesMixin(Interface):209class ISeriesMixin(Interface):
216 """Methods & properties shared between distro & product series."""210 """Methods & properties shared between distro & product series."""
217211
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2009-11-10 13:09:26 +0000
+++ lib/lp/registry/model/distroseries.py 2009-11-12 11:34:49 +0000
@@ -82,7 +82,6 @@
82from lp.registry.model.sourcepackagename import SourcePackageName82from lp.registry.model.sourcepackagename import SourcePackageName
83from lp.soyuz.model.sourcepackagerelease import (83from lp.soyuz.model.sourcepackagerelease import (
84 SourcePackageRelease)84 SourcePackageRelease)
85from lp.soyuz.model.sourcepackageformat import SourcePackageFormatSelection
86from lp.blueprints.model.specification import (85from lp.blueprints.model.specification import (
87 HasSpecificationsMixin, Specification)86 HasSpecificationsMixin, Specification)
88from lp.translations.model.translationimportqueue import (87from lp.translations.model.translationimportqueue import (
@@ -119,6 +118,8 @@
119from canonical.launchpad.webapp.interfaces import (118from canonical.launchpad.webapp.interfaces import (
120 IStoreSelector, MAIN_STORE, NotFoundError, SLAVE_FLAVOR,119 IStoreSelector, MAIN_STORE, NotFoundError, SLAVE_FLAVOR,
121 TranslationUnavailable)120 TranslationUnavailable)
121from lp.soyuz.interfaces.sourcepackageformat import (
122 ISourcePackageFormatSelectionSet)
122123
123124
124class SeriesMixin:125class SeriesMixin:
@@ -1744,14 +1745,8 @@
1744 return '%s%s' % (self.name, pocketsuffix[pocket])1745 return '%s%s' % (self.name, pocketsuffix[pocket])
17451746
1746 def isSourcePackageFormatPermitted(self, format):1747 def isSourcePackageFormatPermitted(self, format):
1747 return Store.of(self).find(1748 return getUtility(ISourcePackageFormatSelectionSet
1748 SourcePackageFormatSelection, distroseries=self,1749 ).getBySeriesAndFormat(self, format) is not None
1749 format=format).count() == 1
1750
1751 def permitSourcePackageFormat(self, format):
1752 if not self.isSourcePackageFormatPermitted(format):
1753 return Store.of(self).add(
1754 SourcePackageFormatSelection(self, format))
17551750
17561751
1757class DistroSeriesSet:1752class DistroSeriesSet:
17581753
=== modified file 'lib/lp/soyuz/configure.zcml'
--- lib/lp/soyuz/configure.zcml 2009-10-30 06:28:19 +0000
+++ lib/lp/soyuz/configure.zcml 2009-11-12 10:49:55 +0000
@@ -791,6 +791,28 @@
791 interface="lp.soyuz.interfaces.section.ISectionSet"/>791 interface="lp.soyuz.interfaces.section.ISectionSet"/>
792 </securedutility>792 </securedutility>
793793
794 <!-- SourcePackageFormatSelection -->
795
796 <class
797 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelection">
798 <allow
799 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelection"/>
800 </class>
801
802 <!-- SourcePackageFormatSelectionSet -->
803
804 <class
805 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelectionSet">
806 <allow
807 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet"/>
808 </class>
809 <securedutility
810 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelectionSet"
811 provides="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet">
812 <allow
813 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet"/>
814 </securedutility>
815
794 <!-- SourcePackageReleaseFile -->816 <!-- SourcePackageReleaseFile -->
795817
796 <class818 <class
797819
=== modified file 'lib/lp/soyuz/interfaces/sourcepackageformat.py'
--- lib/lp/soyuz/interfaces/sourcepackageformat.py 2009-11-10 13:09:26 +0000
+++ lib/lp/soyuz/interfaces/sourcepackageformat.py 2009-11-12 10:46:22 +0000
@@ -8,6 +8,7 @@
8__all__ = [8__all__ = [
9 'SourcePackageFormat',9 'SourcePackageFormat',
10 'ISourcePackageFormatSelection',10 'ISourcePackageFormatSelection',
11 'ISourcePackageFormatSelectionSet',
11 ]12 ]
1213
13from zope.interface import Attribute, Interface14from zope.interface import Attribute, Interface
@@ -50,3 +51,14 @@
50 id = Attribute("ID")51 id = Attribute("ID")
51 distroseries = Attribute("Target series")52 distroseries = Attribute("Target series")
52 format = Attribute("Permitted source package format")53 format = Attribute("Permitted source package format")
54
55
56class ISourcePackageFormatSelectionSet(Interface):
57 """Set manipulation tools for the SourcePackageFormatSelection table."""
58
59 def getBySeriesAndFormat(distroseries, format):
60 """Return the ISourcePackageFormatSelection for the given series and
61 format."""
62
63 def add(distroseries, format):
64 """Allow the given source package format in the given series."""
5365
=== modified file 'lib/lp/soyuz/model/sourcepackageformat.py'
--- lib/lp/soyuz/model/sourcepackageformat.py 2009-11-10 13:09:26 +0000
+++ lib/lp/soyuz/model/sourcepackageformat.py 2009-11-12 11:02:48 +0000
@@ -5,25 +5,26 @@
55
6__all__ = [6__all__ = [
7 'SourcePackageFormatSelection',7 'SourcePackageFormatSelection',
8 'SourcePackageFormatSelectionSet',
8 ]9 ]
910
10from storm.locals import Storm, Int, Reference11from storm.locals import Storm, Int, Reference
12from zope.component import getUtility
11from zope.interface import implements13from zope.interface import implements
1214
15from canonical.launchpad.webapp.interfaces import (
16 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR, MASTER_FLAVOR)
13from canonical.database.enumcol import DBEnum17from canonical.database.enumcol import DBEnum
14from lp.soyuz.interfaces.sourcepackageformat import (18from lp.soyuz.interfaces.sourcepackageformat import (
15 ISourcePackageFormatSelection, SourcePackageFormat)19 ISourcePackageFormatSelection, ISourcePackageFormatSelectionSet,
20 SourcePackageFormat)
21
1622
17class SourcePackageFormatSelection(Storm):23class SourcePackageFormatSelection(Storm):
18 """See ISourcePackageFormatSelection."""24 """See ISourcePackageFormatSelection."""
1925
20 implements(ISourcePackageFormatSelection)26 implements(ISourcePackageFormatSelection)
2127
22 def __init__(self, distroseries, format):
23 super(SourcePackageFormatSelection, self).__init__()
24 self.distroseries = distroseries
25 self.format = format
26
27 __storm_table__ = 'sourcepackageformatselection'28 __storm_table__ = 'sourcepackageformatselection'
2829
29 id = Int(primary=True)30 id = Int(primary=True)
@@ -33,3 +34,23 @@
3334
34 format = DBEnum(enum=SourcePackageFormat)35 format = DBEnum(enum=SourcePackageFormat)
3536
37
38class SourcePackageFormatSelectionSet:
39 """See ISourcePackageFormatSelectionSet."""
40
41 implements(ISourcePackageFormatSelectionSet)
42
43 def getBySeriesAndFormat(self, distroseries, format):
44 """See `ISourcePackageFormatSelection`."""
45 return getUtility(IStoreSelector).get(
46 MAIN_STORE, DEFAULT_FLAVOR).find(
47 SourcePackageFormatSelection, distroseries=distroseries,
48 format=format).one()
49
50 def add(self, distroseries, format):
51 """See `ISourcePackageFormatSelection`."""
52 spfs = SourcePackageFormatSelection()
53 spfs.distroseries = distroseries
54 spfs.format = format
55 return getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR).add(
56 spfs)
3657
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-11-10 13:09:26 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-11-12 11:18:42 +0000
@@ -37,7 +37,8 @@
37 PackagePublishingStatus, active_publishing_status)37 PackagePublishingStatus, active_publishing_status)
38from lp.soyuz.interfaces.queue import (38from lp.soyuz.interfaces.queue import (
39 PackageUploadCustomFormat, PackageUploadStatus)39 PackageUploadCustomFormat, PackageUploadStatus)
40from lp.soyuz.interfaces.sourcepackageformat import SourcePackageFormat40from lp.soyuz.interfaces.sourcepackageformat import (
41 ISourcePackageFormatSelectionSet, SourcePackageFormat)
41from lp.soyuz.model.publishing import (42from lp.soyuz.model.publishing import (
42 SecureSourcePackagePublishingHistory,43 SecureSourcePackagePublishingHistory,
43 SecureBinaryPackagePublishingHistory)44 SecureBinaryPackagePublishingHistory)
@@ -728,7 +729,8 @@
728 # Get hoary, and configure it to accept 3.0 (quilt) uploads.729 # Get hoary, and configure it to accept 3.0 (quilt) uploads.
729 ubuntu = getUtility(IDistributionSet).getByName('ubuntu')730 ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
730 hoary = ubuntu.getSeries('hoary')731 hoary = ubuntu.getSeries('hoary')
731 hoary.permitSourcePackageFormat(SourcePackageFormat.FORMAT_3_0_QUILT)732 getUtility(ISourcePackageFormatSelectionSet).add(
733 hoary, SourcePackageFormat.FORMAT_3_0_QUILT)
732734
733 # Create a 3.0 (quilt) source.735 # Create a 3.0 (quilt) source.
734 source = self.test_publisher.getPubSource(736 source = self.test_publisher.getPubSource(
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Looking good, thanks William. I will land this for you.

review: Approve (code)
Revision history for this message
Julian Edwards (julian-edwards) wrote :

William, I can't land this, it's failing in deathrow.txt.

Revision history for this message
William Grant (wgrant) wrote :

Julian, I've fixed the broken tests.

Revision history for this message
Curtis Hovey (sinzui) wrote :

> Julian, I've fixed the broken tests.

I'll submit the branch.

Revision history for this message
William Grant (wgrant) wrote :

So, it turns out this needs to land on db-devel. I've merged and resolved conflicts, with no other changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2009-11-09 13:01:13 +0000
+++ database/sampledata/current-dev.sql 2009-11-16 23:27:14 +0000
@@ -745,6 +745,15 @@
745745
746746
747747
748
749
750
751
752
753
754
755
756
748ALTER TABLE account DISABLE TRIGGER ALL;757ALTER TABLE account DISABLE TRIGGER ALL;
749758
750INSERT INTO account (id, date_created, creation_rationale, status, date_status_set, displayname, openid_identifier, status_comment, old_openid_identifier) VALUES (1, '2005-06-06 08:59:51.591618', 8, 20, '2005-06-06 08:59:51.591618', 'Mark Shuttleworth', 'mark_oid', NULL, '123/mark');759INSERT INTO account (id, date_created, creation_rationale, status, date_status_set, displayname, openid_identifier, status_comment, old_openid_identifier) VALUES (1, '2005-06-06 08:59:51.591618', 8, 20, '2005-06-06 08:59:51.591618', 'Mark Shuttleworth', 'mark_oid', NULL, '123/mark');
@@ -1695,10 +1704,19 @@
1695ALTER TABLE builder ENABLE TRIGGER ALL;1704ALTER TABLE builder ENABLE TRIGGER ALL;
16961705
16971706
1707ALTER TABLE buildpackagejob DISABLE TRIGGER ALL;
1708
1709INSERT INTO buildpackagejob (id, job, build) VALUES (1, 1, 8);
1710INSERT INTO buildpackagejob (id, job, build) VALUES (2, 2, 11);
1711
1712
1713ALTER TABLE buildpackagejob ENABLE TRIGGER ALL;
1714
1715
1698ALTER TABLE buildqueue DISABLE TRIGGER ALL;1716ALTER TABLE buildqueue DISABLE TRIGGER ALL;
16991717
1700INSERT INTO buildqueue (id, build, builder, logtail, created, buildstart, lastscore, manual) VALUES (1, 8, 1, 'Dummy sampledata entry, not processing', '2005-06-15 09:14:12.820778', '2005-06-15 09:20:12.820778', 1, false);1718INSERT INTO buildqueue (id, builder, logtail, lastscore, manual, job, job_type) VALUES (1, 1, 'Dummy sampledata entry, not processing', 1, false, 1, 1);
1701INSERT INTO buildqueue (id, build, builder, logtail, created, buildstart, lastscore, manual) VALUES (2, 11, NULL, NULL, '2005-06-15 10:14:12.820778', NULL, 10, false);1719INSERT INTO buildqueue (id, builder, logtail, lastscore, manual, job, job_type) VALUES (2, NULL, NULL, 10, false, 2, 1);
17021720
17031721
1704ALTER TABLE buildqueue ENABLE TRIGGER ALL;1722ALTER TABLE buildqueue ENABLE TRIGGER ALL;
@@ -2781,6 +2799,8 @@
27812799
2782ALTER TABLE job DISABLE TRIGGER ALL;2800ALTER TABLE job DISABLE TRIGGER ALL;
27832801
2802INSERT INTO job (id, requester, reason, status, progress, last_report_seen, next_report_due, attempt_count, max_retries, log, scheduled_start, lease_expires, date_created, date_started, date_finished) VALUES (1, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2005-06-15 09:14:12.820778', '2005-06-15 09:20:12.820778', NULL);
2803INSERT INTO job (id, requester, reason, status, progress, last_report_seen, next_report_due, attempt_count, max_retries, log, scheduled_start, lease_expires, date_created, date_started, date_finished) VALUES (2, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2005-06-15 10:14:12.820778', NULL, NULL);
27842804
27852805
2786ALTER TABLE job ENABLE TRIGGER ALL;2806ALTER TABLE job ENABLE TRIGGER ALL;
@@ -4615,6 +4635,13 @@
4615ALTER TABLE packageset ENABLE TRIGGER ALL;4635ALTER TABLE packageset ENABLE TRIGGER ALL;
46164636
46174637
4638ALTER TABLE packagesetgroup DISABLE TRIGGER ALL;
4639
4640
4641
4642ALTER TABLE packagesetgroup ENABLE TRIGGER ALL;
4643
4644
4618ALTER TABLE packagesetinclusion DISABLE TRIGGER ALL;4645ALTER TABLE packagesetinclusion DISABLE TRIGGER ALL;
46194646
46204647
@@ -8569,6 +8596,26 @@
8569ALTER TABLE signedcodeofconduct ENABLE TRIGGER ALL;8596ALTER TABLE signedcodeofconduct ENABLE TRIGGER ALL;
85708597
85718598
8599ALTER TABLE sourcepackageformatselection DISABLE TRIGGER ALL;
8600
8601INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (1, 1, 0);
8602INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (2, 2, 0);
8603INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (3, 3, 0);
8604INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (4, 4, 0);
8605INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (5, 5, 0);
8606INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (6, 6, 0);
8607INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (7, 7, 0);
8608INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (8, 8, 0);
8609INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (9, 9, 0);
8610INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (10, 10, 0);
8611INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (11, 11, 0);
8612INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (12, 12, 0);
8613INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (13, 13, 0);
8614
8615
8616ALTER TABLE sourcepackageformatselection ENABLE TRIGGER ALL;
8617
8618
8572ALTER TABLE sourcepackagename DISABLE TRIGGER ALL;8619ALTER TABLE sourcepackagename DISABLE TRIGGER ALL;
85738620
8574INSERT INTO sourcepackagename (id, name) VALUES (1, 'mozilla-firefox');8621INSERT INTO sourcepackagename (id, name) VALUES (1, 'mozilla-firefox');
@@ -8596,17 +8643,17 @@
8596ALTER TABLE sourcepackagerelease DISABLE TRIGGER ALL;8643ALTER TABLE sourcepackagerelease DISABLE TRIGGER ALL;
85978644
8598INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (14, 1, '0.9', '2004-09-27 11:57:13', 1, NULL, 1, 'Mozilla dummy Changelog......', 'gcc-3.4-base, libc6 (>= 2.3.2.ds1-4), gcc-3.4 (>= 3.4.1-4sarge1), gcc-3.4 (<< 3.4.2), libstdc++6-dev (>= 3.4.1-4sarge1), pmount', 'bacula-common (= 1.34.6-2), bacula-director-common (= 1.34.6-2), postgresql-client (>= 7.4), pmount', 'any', NULL, 1, 1, 1, 1, 1, 'Mark Shuttleworth <mark@canonical.com>', '3.6.2', '1.0', 'mozilla-firefox', 1, NULL, 'gcc-4.0, pmount', 'gcc-4.0-base, pmount');8645INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (14, 1, '0.9', '2004-09-27 11:57:13', 1, NULL, 1, 'Mozilla dummy Changelog......', 'gcc-3.4-base, libc6 (>= 2.3.2.ds1-4), gcc-3.4 (>= 3.4.1-4sarge1), gcc-3.4 (<< 3.4.2), libstdc++6-dev (>= 3.4.1-4sarge1), pmount', 'bacula-common (= 1.34.6-2), bacula-director-common (= 1.34.6-2), postgresql-client (>= 7.4), pmount', 'any', NULL, 1, 1, 1, 1, 1, 'Mark Shuttleworth <mark@canonical.com>', '3.6.2', '1.0', 'mozilla-firefox', 1, NULL, 'gcc-4.0, pmount', 'gcc-4.0-base, pmount');
8599INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (15, 1, '1.0', '2004-09-27 11:57:13', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 2, 1, 9, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8646INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (15, 1, '1.0', '2004-09-27 11:57:13', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 2, 1, 9, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8600INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (16, 1, '1.0-1', '2005-03-10 16:30:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 3, 1, 10, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8647INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (16, 1, '1.0-1', '2005-03-10 16:30:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 3, 1, 10, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8601INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (17, 1, '0.99.6-1', '2005-03-14 18:00:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 2, 1, 10, 1, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8648INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (17, 1, '0.99.6-1', '2005-03-14 18:00:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 2, 1, 10, 1, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8602INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (20, 1, '0.1-1', '2005-03-24 20:59:31.439579', 1, NULL, 1, 'pmount (0.1-1) hoary; urgency=low8649INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (20, 1, '0.1-1', '2005-03-24 20:59:31.439579', 1, NULL, 1, 'pmount (0.1-1) hoary; urgency=low
86038650
8604 * Fix description (Malone #1)8651 * Fix description (Malone #1)
8605 * Fix debian (Debian #2000)8652 * Fix debian (Debian #2000)
8606 * Fix warty (Warty Ubuntu #1)8653 * Fix warty (Warty Ubuntu #1)
86078654
8608 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 2, 1, 14, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8655 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 2, 1, 14, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8609INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (21, 1, '0.1-2', '2005-06-24 20:59:31.439579', 1, NULL, 1, 'This is a placeholder changelog for pmount 0.1-2', NULL, NULL, 'powerpc', NULL, 1, 1, 14, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8656INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (21, 1, '0.1-2', '2005-06-24 20:59:31.439579', 1, NULL, 1, 'This is a placeholder changelog for pmount 0.1-2', NULL, NULL, 'powerpc', NULL, 1, 1, 14, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8610INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (23, 1, '1.0.8-1ubuntu1', '2005-02-03 08:50:00', 1, NULL, 1, 'alsa-utils (1.0.8-1ubuntu1) warty; urgency=low8657INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (23, 1, '1.0.8-1ubuntu1', '2005-02-03 08:50:00', 1, NULL, 1, 'alsa-utils (1.0.8-1ubuntu1) warty; urgency=low
86118658
8612 * Placeholder8659 * Placeholder
@@ -8616,7 +8663,7 @@
86168663
8617 * Placeholder8664 * Placeholder
86188665
8619 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'any', NULL, 2, 1, 19, 8, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8666 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'any', NULL, 2, 1, 19, 8, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8620INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (25, 1, '1.0.9a-4ubuntu1', '2005-08-01 14:10:00', 1, NULL, 1, 'alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low8667INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (25, 1, '1.0.9a-4ubuntu1', '2005-08-01 14:10:00', 1, NULL, 1, 'alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low
86218668
8622 * Placeholder8669 * Placeholder
@@ -8626,21 +8673,21 @@
8626 LP: #7, #8,8673 LP: #7, #8,
8627 #118674 #11
86288675
8629 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 1, 16, 19, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8676 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 1, 16, 19, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8630INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (26, 1, 'cr.g7-37', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 20, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8677INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (26, 1, 'cr.g7-37', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 20, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8631INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (27, 1, 'b8p', '2006-02-10 11:19:00', 1, NULL, 1, 'libstdc++ (9.9-1) hoary; urgency=high8678INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (27, 1, 'b8p', '2006-02-10 11:19:00', 1, NULL, 1, 'libstdc++ (9.9-1) hoary; urgency=high
86328679
8633 * Placeholder8680 * Placeholder
86348681
8635 -- Sample Person <test@canonical.com> Tue, 10 Feb 2006 10:10:08 +0300', NULL, NULL, 'powerpc i386', NULL, 1, 16, 21, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8682 -- Sample Person <test@canonical.com> Tue, 10 Feb 2006 10:10:08 +0300', NULL, NULL, 'powerpc i386', NULL, 1, 16, 21, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8636INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (28, 1, '2.6.15.3', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 22, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8683INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (28, 1, '2.6.15.3', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 22, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8637INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (29, 1, '0.00', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 17, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8684INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (29, 1, '0.00', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 17, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8638INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (30, 1, '1.0', '2006-09-28 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8685INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (30, 1, '1.0', '2006-09-28 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8639INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (31, 1, '1.0', '2006-09-28 18:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8686INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (31, 1, '1.0', '2006-09-28 18:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8640INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (32, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 23, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8687INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (32, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 23, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8641INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (33, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 24, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8688INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (33, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 24, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8642INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (34, 1, '1.0', '2007-02-15 14:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 29, 16, 25, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8689INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (34, 1, '1.0', '2007-02-15 14:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 29, 16, 25, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8643INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (35, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 26, 1, 1, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL);8690INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (35, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 26, 1, 1, NULL, NULL, '1.0', NULL, 10, NULL, NULL, NULL);
8644INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (36, 243606, '1.0-1', '2007-08-09 21:25:37.832976', 1, NULL, 5, 'commercialpackage (1.0-1) breezy; urgency=low8691INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (36, 243606, '1.0-1', '2007-08-09 21:25:37.832976', 1, NULL, 5, 'commercialpackage (1.0-1) breezy; urgency=low
86458692
8646 * Initial version8693 * Initial version
@@ -8666,7 +8713,7 @@
86663F4bEPeRcnUjCFI/hjR0kxg=87133F4bEPeRcnUjCFI/hjR0kxg=
8667=Tjln8714=Tjln
8668', 7, 243606, 27, 10, 1, 'Julian Edwards <launchpad@julian-edwards.com>', '3.6.2', '1.0', 'commercialpackage', 12, NULL, NULL, NULL);8715', 7, 243606, 27, 10, 1, 'Julian Edwards <launchpad@julian-edwards.com>', '3.6.2', '1.0', 'commercialpackage', 12, NULL, NULL, NULL);
8669INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (37, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 26, 1, 1, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL);8716INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (37, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 26, 1, 1, NULL, NULL, '1.0', NULL, 11, NULL, NULL, NULL);
86708717
86718718
8672ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL;8719ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL;
86738720
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2009-11-05 10:51:36 +0000
+++ database/sampledata/current.sql 2009-11-16 23:27:14 +0000
@@ -745,6 +745,15 @@
745745
746746
747747
748
749
750
751
752
753
754
755
756
748ALTER TABLE account DISABLE TRIGGER ALL;757ALTER TABLE account DISABLE TRIGGER ALL;
749758
750INSERT INTO account (id, date_created, creation_rationale, status, date_status_set, displayname, openid_identifier, status_comment, old_openid_identifier) VALUES (11, '2005-06-06 08:59:51.591618', 8, 20, '2005-06-06 08:59:51.591618', 'Mark Shuttleworth', 'mark_oid', NULL, '123/mark');759INSERT INTO account (id, date_created, creation_rationale, status, date_status_set, displayname, openid_identifier, status_comment, old_openid_identifier) VALUES (11, '2005-06-06 08:59:51.591618', 8, 20, '2005-06-06 08:59:51.591618', 'Mark Shuttleworth', 'mark_oid', NULL, '123/mark');
@@ -949,20 +958,20 @@
949958
950ALTER TABLE archive DISABLE TRIGGER ALL;959ALTER TABLE archive DISABLE TRIGGER ALL;
951960
952INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (1, 17, NULL, true, NULL, 1, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:12.241774', 15, 1, 8, 5, 1, '2008-09-23 17:29:03.442606', NULL, NULL, NULL, 'Primary Archive for Ubuntu Linux', 0);961INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (1, 17, NULL, true, NULL, 1, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:12.241774', 15, 1, 8, 5, 1, '2008-09-23 17:29:03.442606', NULL, NULL, NULL, 'Primary Archive for Ubuntu Linux', 0, NULL);
953INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (2, 1, NULL, true, NULL, 2, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.863812', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.445921', NULL, NULL, NULL, 'Primary Archive for Redhat Advanced Server', 0);962INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (2, 1, NULL, true, NULL, 2, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.863812', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.445921', NULL, NULL, NULL, 'Primary Archive for Redhat Advanced Server', 0, NULL);
954INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (3, 1, NULL, true, NULL, 3, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.864941', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.446557', NULL, NULL, NULL, 'Primary Archive for Debian GNU/Linux', 0);963INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (3, 1, NULL, true, NULL, 3, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.864941', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.446557', NULL, NULL, NULL, 'Primary Archive for Debian GNU/Linux', 0, NULL);
955INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (4, 1, NULL, true, NULL, 4, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.865502', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.44689', NULL, NULL, NULL, 'Primary Archive for The Gentoo Linux', 0);964INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (4, 1, NULL, true, NULL, 4, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.865502', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.44689', NULL, NULL, NULL, 'Primary Archive for The Gentoo Linux', 0, NULL);
956INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (5, 1, NULL, true, NULL, 5, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.866015', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447202', NULL, NULL, NULL, 'Primary Archive for Kubuntu - Free KDE-based Linux', 0);965INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (5, 1, NULL, true, NULL, 5, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.866015', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447202', NULL, NULL, NULL, 'Primary Archive for Kubuntu - Free KDE-based Linux', 0, NULL);
957INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (7, 4, NULL, true, NULL, 7, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.866529', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447515', NULL, NULL, NULL, 'Primary Archive for GuadaLinex: Linux for Andalucia', 0);966INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (7, 4, NULL, true, NULL, 7, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.866529', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447515', NULL, NULL, NULL, 'Primary Archive for GuadaLinex: Linux for Andalucia', 0, NULL);
958INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (8, 17, NULL, true, NULL, 8, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.867154', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447851', NULL, NULL, NULL, 'Primary Archive for Ubuntu Test', 0);967INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (8, 17, NULL, true, NULL, 8, 1, false, NULL, NULL, NULL, NULL, NULL, false, 'primary', true, '2008-05-27 18:15:15.867154', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.447851', NULL, NULL, NULL, 'Primary Archive for Ubuntu Test', 0, NULL);
959INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (9, 28, 'packages to help my friends.', true, 1024, 1, 2, false, 3, 3, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.867684', 4, 0, 3, 1, 0, '2008-09-23 17:29:03.448178', NULL, NULL, NULL, 'PPA for Celso Providelo', 0);968INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (9, 28, 'packages to help my friends.', true, 1024, 1, 2, false, 3, 3, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.867684', 4, 0, 3, 1, 0, '2008-09-23 17:29:03.448178', NULL, NULL, NULL, 'PPA for Celso Providelo', 0, NULL);
960INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (10, 1, 'packages to help the humanity (you know, ubuntu)', true, 1024, 1, 2, false, 1, 1, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.868202', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.448488', NULL, NULL, NULL, 'PPA for Mark Shuttleworth', 0);969INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (10, 1, 'packages to help the humanity (you know, ubuntu)', true, 1024, 1, 2, false, 1, 1, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.868202', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.448488', NULL, NULL, NULL, 'PPA for Mark Shuttleworth', 0, NULL);
961INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (11, 52, 'I am not allowed to say, I have no privs.', true, 1024, 1, 2, false, 0, 0, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.868709', 1, 0, 0, 1, 0, '2008-09-23 17:29:03.448797', NULL, NULL, NULL, 'PPA for No Privileges Person', 0);970INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (11, 52, 'I am not allowed to say, I have no privs.', true, 1024, 1, 2, false, 0, 0, NULL, NULL, NULL, true, 'ppa', true, '2008-05-27 18:15:15.868709', 1, 0, 0, 1, 0, '2008-09-23 17:29:03.448797', NULL, NULL, NULL, 'PPA for No Privileges Person', 0, NULL);
962INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (12, 17, 'Partner archive', true, NULL, 1, 4, false, NULL, NULL, NULL, NULL, NULL, false, 'partner', true, '2008-05-27 18:15:15.869209', 1, 0, 1, 0, 0, '2008-09-23 17:29:03.449157', NULL, NULL, NULL, 'Partner Archive for Ubuntu Linux', 0);971INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (12, 17, 'Partner archive', true, NULL, 1, 4, false, NULL, NULL, NULL, NULL, NULL, false, 'partner', true, '2008-05-27 18:15:15.869209', 1, 0, 1, 0, 0, '2008-09-23 17:29:03.449157', NULL, NULL, NULL, 'Partner Archive for Ubuntu Linux', 0, NULL);
963INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (13, 17, 'Partner archive', true, NULL, 8, 4, false, NULL, NULL, NULL, NULL, NULL, false, 'partner', true, '2008-05-27 18:15:15.869732', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.449471', NULL, NULL, NULL, 'Partner Archive for Ubuntu Test', 0);972INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (13, 17, 'Partner archive', true, NULL, 8, 4, false, NULL, NULL, NULL, NULL, NULL, false, 'partner', true, '2008-05-27 18:15:15.869732', 0, 0, 0, 0, 0, '2008-09-23 17:29:03.449471', NULL, NULL, NULL, 'Partner Archive for Ubuntu Test', 0, NULL);
964INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (14, 17, 'Sample copy archive', true, NULL, 8, 6, false, NULL, NULL, NULL, NULL, NULL, false, 'samplecopyarchive', false, '2008-11-19 18:15:15.869732', 0, 0, 0, 0, 0, '2008-11-18 17:29:03.449471', NULL, NULL, NULL, 'Copy archive samplecopyarchive for Ubuntu Team', 0);973INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (14, 17, 'Sample copy archive', true, NULL, 8, 6, false, NULL, NULL, NULL, NULL, NULL, false, 'samplecopyarchive', false, '2008-11-19 18:15:15.869732', 0, 0, 0, 0, 0, '2008-11-18 17:29:03.449471', NULL, NULL, NULL, 'Copy archive samplecopyarchive for Ubuntu Team', 0, NULL);
965INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score) VALUES (15, 17, 'Debug archive', true, NULL, 1, 7, false, NULL, NULL, NULL, NULL, NULL, false, 'debug', true, '2009-04-17 10:09:10.859746', 0, 0, 0, 0, 0, '2009-04-17 10:01:03.449876', NULL, NULL, NULL, 'Ubuntu DEBUG archive', 0);974INSERT INTO archive (id, owner, description, enabled, authorized_size, distribution, purpose, private, sources_cached, binaries_cached, package_description_cache, fti, buildd_secret, require_virtualized, name, publish, date_updated, total_count, pending_count, succeeded_count, failed_count, building_count, date_created, signing_key, removed_binary_retention_days, num_old_versions_published, displayname, relative_build_score, external_dependencies) VALUES (15, 17, 'Debug archive', true, NULL, 1, 7, false, NULL, NULL, NULL, NULL, NULL, false, 'debug', true, '2009-04-17 10:09:10.859746', 0, 0, 0, 0, 0, '2009-04-17 10:01:03.449876', NULL, NULL, NULL, 'Ubuntu DEBUG archive', 0, NULL);
966975
967976
968ALTER TABLE archive ENABLE TRIGGER ALL;977ALTER TABLE archive ENABLE TRIGGER ALL;
@@ -1677,10 +1686,19 @@
1677ALTER TABLE builder ENABLE TRIGGER ALL;1686ALTER TABLE builder ENABLE TRIGGER ALL;
16781687
16791688
1689ALTER TABLE buildpackagejob DISABLE TRIGGER ALL;
1690
1691INSERT INTO buildpackagejob (id, job, build) VALUES (1, 1, 8);
1692INSERT INTO buildpackagejob (id, job, build) VALUES (2, 2, 11);
1693
1694
1695ALTER TABLE buildpackagejob ENABLE TRIGGER ALL;
1696
1697
1680ALTER TABLE buildqueue DISABLE TRIGGER ALL;1698ALTER TABLE buildqueue DISABLE TRIGGER ALL;
16811699
1682INSERT INTO buildqueue (id, build, builder, logtail, created, buildstart, lastscore, manual) VALUES (1, 8, 1, 'Dummy sampledata entry, not processing', '2005-06-15 09:14:12.820778', '2005-06-15 09:20:12.820778', 1, false);1700INSERT INTO buildqueue (id, builder, logtail, lastscore, manual, job, job_type) VALUES (1, 1, 'Dummy sampledata entry, not processing', 1, false, 1, 1);
1683INSERT INTO buildqueue (id, build, builder, logtail, created, buildstart, lastscore, manual) VALUES (2, 11, NULL, NULL, '2005-06-15 10:14:12.820778', NULL, 10, false);1701INSERT INTO buildqueue (id, builder, logtail, lastscore, manual, job, job_type) VALUES (2, NULL, NULL, 10, false, 2, 1);
16841702
16851703
1686ALTER TABLE buildqueue ENABLE TRIGGER ALL;1704ALTER TABLE buildqueue ENABLE TRIGGER ALL;
@@ -2753,6 +2771,8 @@
27532771
2754ALTER TABLE job DISABLE TRIGGER ALL;2772ALTER TABLE job DISABLE TRIGGER ALL;
27552773
2774INSERT INTO job (id, requester, reason, status, progress, last_report_seen, next_report_due, attempt_count, max_retries, log, scheduled_start, lease_expires, date_created, date_started, date_finished) VALUES (1, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2005-06-15 09:14:12.820778', '2005-06-15 09:20:12.820778', NULL);
2775INSERT INTO job (id, requester, reason, status, progress, last_report_seen, next_report_due, attempt_count, max_retries, log, scheduled_start, lease_expires, date_created, date_started, date_finished) VALUES (2, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2005-06-15 10:14:12.820778', NULL, NULL);
27562776
27572777
2758ALTER TABLE job ENABLE TRIGGER ALL;2778ALTER TABLE job ENABLE TRIGGER ALL;
@@ -4579,6 +4599,13 @@
4579ALTER TABLE packageset ENABLE TRIGGER ALL;4599ALTER TABLE packageset ENABLE TRIGGER ALL;
45804600
45814601
4602ALTER TABLE packagesetgroup DISABLE TRIGGER ALL;
4603
4604
4605
4606ALTER TABLE packagesetgroup ENABLE TRIGGER ALL;
4607
4608
4582ALTER TABLE packagesetinclusion DISABLE TRIGGER ALL;4609ALTER TABLE packagesetinclusion DISABLE TRIGGER ALL;
45834610
45844611
@@ -8500,6 +8527,26 @@
8500ALTER TABLE signedcodeofconduct ENABLE TRIGGER ALL;8527ALTER TABLE signedcodeofconduct ENABLE TRIGGER ALL;
85018528
85028529
8530ALTER TABLE sourcepackageformatselection DISABLE TRIGGER ALL;
8531
8532INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (1, 1, 0);
8533INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (2, 2, 0);
8534INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (3, 3, 0);
8535INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (4, 4, 0);
8536INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (5, 5, 0);
8537INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (6, 6, 0);
8538INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (7, 7, 0);
8539INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (8, 8, 0);
8540INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (9, 9, 0);
8541INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (10, 10, 0);
8542INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (11, 11, 0);
8543INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (12, 12, 0);
8544INSERT INTO sourcepackageformatselection (id, distroseries, format) VALUES (13, 13, 0);
8545
8546
8547ALTER TABLE sourcepackageformatselection ENABLE TRIGGER ALL;
8548
8549
8503ALTER TABLE sourcepackagename DISABLE TRIGGER ALL;8550ALTER TABLE sourcepackagename DISABLE TRIGGER ALL;
85048551
8505INSERT INTO sourcepackagename (id, name) VALUES (1, 'mozilla-firefox');8552INSERT INTO sourcepackagename (id, name) VALUES (1, 'mozilla-firefox');
@@ -8527,17 +8574,17 @@
8527ALTER TABLE sourcepackagerelease DISABLE TRIGGER ALL;8574ALTER TABLE sourcepackagerelease DISABLE TRIGGER ALL;
85288575
8529INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (14, 1, '0.9', '2004-09-27 11:57:13', 1, NULL, 1, 'Mozilla dummy Changelog......', 'gcc-3.4-base, libc6 (>= 2.3.2.ds1-4), gcc-3.4 (>= 3.4.1-4sarge1), gcc-3.4 (<< 3.4.2), libstdc++6-dev (>= 3.4.1-4sarge1), pmount', 'bacula-common (= 1.34.6-2), bacula-director-common (= 1.34.6-2), postgresql-client (>= 7.4), pmount', 'any', NULL, 1, 1, 1, 1, 1, 'Mark Shuttleworth <mark@canonical.com>', '3.6.2', '1.0', 'mozilla-firefox', 1, NULL, 'gcc-4.0, pmount', 'gcc-4.0-base, pmount');8576INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (14, 1, '0.9', '2004-09-27 11:57:13', 1, NULL, 1, 'Mozilla dummy Changelog......', 'gcc-3.4-base, libc6 (>= 2.3.2.ds1-4), gcc-3.4 (>= 3.4.1-4sarge1), gcc-3.4 (<< 3.4.2), libstdc++6-dev (>= 3.4.1-4sarge1), pmount', 'bacula-common (= 1.34.6-2), bacula-director-common (= 1.34.6-2), postgresql-client (>= 7.4), pmount', 'any', NULL, 1, 1, 1, 1, 1, 'Mark Shuttleworth <mark@canonical.com>', '3.6.2', '1.0', 'mozilla-firefox', 1, NULL, 'gcc-4.0, pmount', 'gcc-4.0-base, pmount');
8530INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (15, 1, '1.0', '2004-09-27 11:57:13', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 2, 1, 9, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8577INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (15, 1, '1.0', '2004-09-27 11:57:13', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 2, 1, 9, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8531INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (16, 1, '1.0-1', '2005-03-10 16:30:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 3, 1, 10, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8578INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (16, 1, '1.0-1', '2005-03-10 16:30:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 3, 1, 10, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8532INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (17, 1, '0.99.6-1', '2005-03-14 18:00:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 2, 1, 10, 1, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8579INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (17, 1, '0.99.6-1', '2005-03-14 18:00:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 2, 1, 10, 1, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8533INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (20, 1, '0.1-1', '2005-03-24 20:59:31.439579', 1, NULL, 1, 'pmount (0.1-1) hoary; urgency=low8580INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (20, 1, '0.1-1', '2005-03-24 20:59:31.439579', 1, NULL, 1, 'pmount (0.1-1) hoary; urgency=low
85348581
8535 * Fix description (Malone #1)8582 * Fix description (Malone #1)
8536 * Fix debian (Debian #2000)8583 * Fix debian (Debian #2000)
8537 * Fix warty (Warty Ubuntu #1)8584 * Fix warty (Warty Ubuntu #1)
85388585
8539 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 2, 1, 14, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8586 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 2, 1, 14, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8540INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (21, 1, '0.1-2', '2005-06-24 20:59:31.439579', 1, NULL, 1, 'This is a placeholder changelog for pmount 0.1-2', NULL, NULL, 'powerpc', NULL, 1, 1, 14, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8587INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (21, 1, '0.1-2', '2005-06-24 20:59:31.439579', 1, NULL, 1, 'This is a placeholder changelog for pmount 0.1-2', NULL, NULL, 'powerpc', NULL, 1, 1, 14, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8541INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (23, 1, '1.0.8-1ubuntu1', '2005-02-03 08:50:00', 1, NULL, 1, 'alsa-utils (1.0.8-1ubuntu1) warty; urgency=low8588INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (23, 1, '1.0.8-1ubuntu1', '2005-02-03 08:50:00', 1, NULL, 1, 'alsa-utils (1.0.8-1ubuntu1) warty; urgency=low
85428589
8543 * Placeholder8590 * Placeholder
@@ -8547,7 +8594,7 @@
85478594
8548 * Placeholder8595 * Placeholder
85498596
8550 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'any', NULL, 2, 1, 19, 8, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8597 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'any', NULL, 2, 1, 19, 8, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8551INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (25, 1, '1.0.9a-4ubuntu1', '2005-08-01 14:10:00', 1, NULL, 1, 'alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low8598INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (25, 1, '1.0.9a-4ubuntu1', '2005-08-01 14:10:00', 1, NULL, 1, 'alsa-utils (1.0.9a-4ubuntu1) hoary; urgency=low
85528599
8553 * Placeholder8600 * Placeholder
@@ -8557,21 +8604,21 @@
8557 LP: #7, #8,8604 LP: #7, #8,
8558 #118605 #11
85598606
8560 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 1, 16, 19, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8607 -- Sample Person <test@canonical.com> Tue, 7 Feb 2006 12:10:08 +0300', NULL, NULL, 'all', NULL, 1, 16, 19, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8561INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (26, 1, 'cr.g7-37', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 20, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8608INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (26, 1, 'cr.g7-37', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 20, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8562INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (27, 1, 'b8p', '2006-02-10 11:19:00', 1, NULL, 1, 'libstdc++ (9.9-1) hoary; urgency=high8609INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (27, 1, 'b8p', '2006-02-10 11:19:00', 1, NULL, 1, 'libstdc++ (9.9-1) hoary; urgency=high
85638610
8564 * Placeholder8611 * Placeholder
85658612
8566 -- Sample Person <test@canonical.com> Tue, 10 Feb 2006 10:10:08 +0300', NULL, NULL, 'powerpc i386', NULL, 1, 16, 21, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8613 -- Sample Person <test@canonical.com> Tue, 10 Feb 2006 10:10:08 +0300', NULL, NULL, 'powerpc i386', NULL, 1, 16, 21, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8567INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (28, 1, '2.6.15.3', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 22, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8614INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (28, 1, '2.6.15.3', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 22, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8568INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (29, 1, '0.00', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 17, 3, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8615INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (29, 1, '0.00', '2005-12-22 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 17, 3, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8569INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (30, 1, '1.0', '2006-09-28 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8616INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (30, 1, '1.0', '2006-09-28 18:19:00', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8570INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (31, 1, '1.0', '2006-09-28 18:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8617INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (31, 1, '1.0', '2006-09-28 18:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 20, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8571INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (32, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 23, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8618INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (32, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 23, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8572INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (33, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 24, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8619INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (33, 1, '1.0', '2006-12-01 13:19:01', 1, NULL, 1, NULL, NULL, NULL, 'all', NULL, 1, 16, 24, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8573INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (34, 1, '1.0', '2007-02-15 14:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 29, 16, 25, 10, 1, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL);8620INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (34, 1, '1.0', '2007-02-15 14:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 29, 16, 25, 10, 1, NULL, NULL, '1.0', NULL, 1, NULL, NULL, NULL);
8574INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (35, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 26, 1, 1, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL);8621INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (35, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'any', NULL, 1, 16, 26, 1, 1, NULL, NULL, '1.0', NULL, 10, NULL, NULL, NULL);
8575INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (36, 243606, '1.0-1', '2007-08-09 21:25:37.832976', 1, NULL, 5, 'commercialpackage (1.0-1) breezy; urgency=low8622INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (36, 243606, '1.0-1', '2007-08-09 21:25:37.832976', 1, NULL, 5, 'commercialpackage (1.0-1) breezy; urgency=low
85768623
8577 * Initial version8624 * Initial version
@@ -8597,7 +8644,7 @@
85973F4bEPeRcnUjCFI/hjR0kxg=86443F4bEPeRcnUjCFI/hjR0kxg=
8598=Tjln8645=Tjln
8599', 7, 243606, 27, 10, 1, 'Julian Edwards <launchpad@julian-edwards.com>', '3.6.2', '1.0', 'commercialpackage', 12, NULL, NULL, NULL);8646', 7, 243606, 27, 10, 1, 'Julian Edwards <launchpad@julian-edwards.com>', '3.6.2', '1.0', 'commercialpackage', 12, NULL, NULL, NULL);
8600INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (37, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 26, 1, 1, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL);8647INSERT INTO sourcepackagerelease (id, creator, version, dateuploaded, urgency, dscsigningkey, component, changelog_entry, builddepends, builddependsindep, architecturehintlist, dsc, section, maintainer, sourcepackagename, upload_distroseries, format, dsc_maintainer_rfc822, dsc_standards_version, dsc_format, dsc_binaries, upload_archive, copyright, build_conflicts, build_conflicts_indep) VALUES (37, 1, '1.0', '2006-04-11 11:19:01', 1, NULL, 1, NULL, NULL, NULL, 'i386', NULL, 1, 16, 26, 1, 1, NULL, NULL, '1.0', NULL, 11, NULL, NULL, NULL);
86018648
86028649
8603ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL;8650ALTER TABLE sourcepackagerelease ENABLE TRIGGER ALL;
86048651
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2009-11-02 15:33:35 +0000
+++ database/schema/comments.sql 2009-11-16 23:27:14 +0000
@@ -1531,14 +1531,13 @@
1531COMMENT ON COLUMN Builder.active IS 'Whether to present or not the builder in the public list of builders avaialble. It is used to hide transient or defunct builders while they get fixed.';1531COMMENT ON COLUMN Builder.active IS 'Whether to present or not the builder in the public list of builders avaialble. It is used to hide transient or defunct builders while they get fixed.';
15321532
1533-- BuildQueue1533-- BuildQueue
1534COMMENT ON TABLE BuildQueue IS 'BuildQueue: The queue of builds in progress/scheduled to run. This table is the core of the build daemon master. It lists all builds in progress or scheduled to start.';1534COMMENT ON TABLE BuildQueue IS 'BuildQueue: The queue of jobs in progress/scheduled to run on the Soyuz build farm.';
1535COMMENT ON COLUMN BuildQueue.build IS 'The build for which this queue item exists. This is how the buildd master will find all the files it needs to perform the build';
1536COMMENT ON COLUMN BuildQueue.builder IS 'The builder assigned to this build. Some builds will have a builder assigned to queue them up; some will be building on the specified builder already; others will not have a builder yet (NULL) and will be waiting to be assigned into a builder''s queue';1535COMMENT ON COLUMN BuildQueue.builder IS 'The builder assigned to this build. Some builds will have a builder assigned to queue them up; some will be building on the specified builder already; others will not have a builder yet (NULL) and will be waiting to be assigned into a builder''s queue';
1537COMMENT ON COLUMN BuildQueue.created IS 'The timestamp of the creation of this row. This is used by the buildd master scheduling algorithm to decide how soon to schedule a build to run on a given builder.';
1538COMMENT ON COLUMN BuildQueue.buildstart IS 'The timestamp of the start of the build run on the given builder. If this is NULL then the build is not running yet.';
1539COMMENT ON COLUMN BuildQueue.logtail IS 'The tail end of the log of the current build. This is updated regularly as the buildd master polls the buildd slaves. Once the build is complete; the full log will be lodged with the librarian and linked into the build table.';1536COMMENT ON COLUMN BuildQueue.logtail IS 'The tail end of the log of the current build. This is updated regularly as the buildd master polls the buildd slaves. Once the build is complete; the full log will be lodged with the librarian and linked into the build table.';
1540COMMENT ON COLUMN BuildQueue.lastscore IS 'The last score ascribed to this build record. This can be used in the UI among other places.';1537COMMENT ON COLUMN BuildQueue.lastscore IS 'The last score ascribed to this build record. This can be used in the UI among other places.';
1541COMMENT ON COLUMN BuildQueue.manual IS 'Indicates if the current record was or not rescored manually, if so it get skipped from the auto-score procedure.';1538COMMENT ON COLUMN BuildQueue.manual IS 'Indicates if the current record was or not rescored manually, if so it get skipped from the auto-score procedure.';
1539COMMENT ON COLUMN BuildQueue.job IS 'Foreign key to the `Job` table row with the generic job data.';
1540COMMENT ON COLUMN BuildQueue.job_type IS 'Type of job (enumeration value), enables us to find/query the correct table with the data specific to this type of job.';
15421541
1543-- Mirrors1542-- Mirrors
15441543
15451544
=== added file 'database/schema/patch-2207-09.0.sql'
--- database/schema/patch-2207-09.0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2207-09.0.sql 2009-11-16 23:27:14 +0000
@@ -0,0 +1,10 @@
1SET client_min_messages=ERROR;
2
3-- Per Bug #196774
4ALTER TABLE Packaging
5 DROP CONSTRAINT packaging_uniqueness,
6 ADD CONSTRAINT packaging__distroseries__sourcepackagename__key
7 UNIQUE (distroseries, sourcepackagename);
8
9INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 9, 0);
10
011
=== added file 'database/schema/patch-2207-11-0.sql'
--- database/schema/patch-2207-11-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2207-11-0.sql 2009-11-16 23:27:14 +0000
@@ -0,0 +1,87 @@
1-- Copyright 2009 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6-- The schema patch required for the Soyuz buildd generalisation, see
7-- https://dev.launchpad.net/Soyuz/Specs/BuilddGeneralisation for details.
8-- Bug #478919.
9
10-- Step 1
11-- The `BuildPackageJob` table captures whatever data is required for
12-- "normal" Soyuz build farm jobs that build source packages.
13
14CREATE TABLE buildpackagejob (
15 id serial PRIMARY KEY,
16 -- FK to the `Job` record with "generic" data about this source package
17 -- build job. Please note that the corresponding `BuildQueue` row will
18 -- have a FK referencing the same `Job` row.
19 job integer NOT NULL CONSTRAINT buildpackagejob__job__fk REFERENCES job,
20 -- FK to the associated `Build` record.
21 build integer NOT NULL CONSTRAINT buildpackagejob__build__fk REFERENCES build
22);
23
24-- Step 2
25-- Changes needed to the `BuildQueue` table.
26
27-- The 'job' and the 'job_type' columns will enable us to find the correct
28-- database rows that hold the generic and the specific data pertaining to
29-- the job respectively.
30ALTER TABLE ONLY buildqueue ADD COLUMN job integer;
31ALTER TABLE ONLY buildqueue ADD COLUMN job_type integer NOT NULL DEFAULT 1;
32
33-- Step 3
34-- Data migration for the existing `BuildQueue` records.
35CREATE OR REPLACE FUNCTION migrate_buildqueue_rows() RETURNS integer
36LANGUAGE plpgsql AS
37$$
38DECLARE
39 queue_row RECORD;
40 job_id integer;
41 buildpackagejob_id integer;
42 rows_migrated integer;
43BEGIN
44 rows_migrated := 0;
45 FOR queue_row IN SELECT * FROM buildqueue LOOP
46 INSERT INTO job(status, date_created, date_started) VALUES(0, queue_row.created, queue_row.buildstart);
47 -- Get the key of the `Job` row just inserted.
48 SELECT currval('job_id_seq') INTO job_id;
49 INSERT INTO buildpackagejob(job, build) VALUES(job_id, queue_row.build);
50 -- Get the key of the `BuildPackageJob` row just inserted.
51 SELECT currval('buildpackagejob_id_seq') INTO buildpackagejob_id;
52 UPDATE buildqueue SET job=job_id WHERE id=queue_row.id;
53 rows_migrated := rows_migrated + 1;
54 END LOOP;
55 RETURN rows_migrated;
56END;
57$$;
58
59-- Run the data migration function.
60SELECT * FROM migrate_buildqueue_rows();
61-- The `BuildQueue` data is migrated at this point, we can get rid of the
62-- data migration function.
63DROP FUNCTION migrate_buildqueue_rows();
64
65-- Now that the data was migrated we can make the 'job' column mandatory
66-- and define the foreign key constraint for it.
67ALTER TABLE ONLY buildqueue ALTER COLUMN job SET NOT NULL;
68ALTER TABLE ONLY buildqueue
69 ADD CONSTRAINT buildqueue__job__fk
70 FOREIGN KEY (job) REFERENCES job(id);
71
72-- Step 4
73-- Now remove the obsolete columns, constraints and indexes from `BuildQueue`.
74-- The latter will from now on refer to the `Build` record via the
75-- `Job`/`BuildPackageJob` tables (and not directly any more).
76DROP INDEX buildqueue__build__idx;
77ALTER TABLE ONLY buildqueue DROP CONSTRAINT "$1";
78ALTER TABLE ONLY buildqueue DROP COLUMN build;
79ALTER TABLE ONLY buildqueue DROP COLUMN created;
80ALTER TABLE ONLY buildqueue DROP COLUMN buildstart;
81
82-- Step 5
83-- Add indexes for the new `BuildQueue` columns.
84CREATE INDEX buildqueue__job__idx ON buildqueue(job);
85CREATE INDEX buildqueue__job_type__idx ON buildqueue(job_type);
86
87INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 11, 0);
088
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2009-11-06 01:16:21 +0000
+++ database/schema/security.cfg 2009-11-16 23:27:14 +0000
@@ -271,6 +271,7 @@
271public.shippingrun = SELECT, INSERT, UPDATE271public.shippingrun = SELECT, INSERT, UPDATE
272public.sourcepackagepublishinghistory = SELECT272public.sourcepackagepublishinghistory = SELECT
273public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE273public.seriessourcepackagebranch = SELECT, INSERT, UPDATE, DELETE
274public.sourcepackageformatselection = SELECT
274public.specificationbranch = SELECT, INSERT, UPDATE, DELETE275public.specificationbranch = SELECT, INSERT, UPDATE, DELETE
275public.specificationbug = SELECT, INSERT, DELETE276public.specificationbug = SELECT, INSERT, DELETE
276public.specificationdependency = SELECT, INSERT, DELETE277public.specificationdependency = SELECT, INSERT, DELETE
@@ -837,6 +838,8 @@
837public.archivearch = SELECT, UPDATE838public.archivearch = SELECT, UPDATE
838public.archivedependency = SELECT839public.archivedependency = SELECT
839public.buildqueue = SELECT, INSERT, UPDATE, DELETE840public.buildqueue = SELECT, INSERT, UPDATE, DELETE
841public.job = SELECT, INSERT, UPDATE, DELETE
842public.buildpackagejob = SELECT, INSERT, UPDATE, DELETE
840public.builder = SELECT, INSERT, UPDATE843public.builder = SELECT, INSERT, UPDATE
841public.build = SELECT, INSERT, UPDATE844public.build = SELECT, INSERT, UPDATE
842public.distribution = SELECT, UPDATE845public.distribution = SELECT, UPDATE
@@ -928,6 +931,8 @@
928public.build = SELECT, INSERT, UPDATE931public.build = SELECT, INSERT, UPDATE
929public.builder = SELECT, INSERT, UPDATE932public.builder = SELECT, INSERT, UPDATE
930public.buildqueue = SELECT, INSERT, UPDATE, DELETE933public.buildqueue = SELECT, INSERT, UPDATE, DELETE
934public.job = SELECT, INSERT, UPDATE, DELETE
935public.buildpackagejob = SELECT, INSERT, UPDATE, DELETE
931public.component = SELECT, INSERT, UPDATE936public.component = SELECT, INSERT, UPDATE
932public.componentselection = SELECT, INSERT, UPDATE937public.componentselection = SELECT, INSERT, UPDATE
933public.country = SELECT, INSERT, UPDATE938public.country = SELECT, INSERT, UPDATE
@@ -987,6 +992,7 @@
987public.sectionselection = SELECT, INSERT, UPDATE992public.sectionselection = SELECT, INSERT, UPDATE
988public.signedcodeofconduct = SELECT, INSERT, UPDATE993public.signedcodeofconduct = SELECT, INSERT, UPDATE
989public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE994public.sourcepackagefilepublishing = SELECT, INSERT, UPDATE
995public.sourcepackageformatselection = SELECT, INSERT
990public.sourcepackagename = SELECT, INSERT, UPDATE996public.sourcepackagename = SELECT, INSERT, UPDATE
991public.sourcepackagepublishinghistory = SELECT997public.sourcepackagepublishinghistory = SELECT
992public.securesourcepackagepublishinghistory = SELECT, INSERT, UPDATE998public.securesourcepackagepublishinghistory = SELECT, INSERT, UPDATE
@@ -1103,6 +1109,7 @@
1103public.archivepermission = SELECT1109public.archivepermission = SELECT
1104public.processor = SELECT1110public.processor = SELECT
1105public.processorfamily = SELECT1111public.processorfamily = SELECT
1112public.sourcepackageformatselection = SELECT
11061113
1107# Source and Binary packages and builds1114# Source and Binary packages and builds
1108public.sourcepackagename = SELECT, INSERT1115public.sourcepackagename = SELECT, INSERT
@@ -1114,6 +1121,8 @@
1114public.pocketchroot = SELECT1121public.pocketchroot = SELECT
1115public.build = SELECT, INSERT, UPDATE1122public.build = SELECT, INSERT, UPDATE
1116public.buildqueue = SELECT, INSERT, UPDATE1123public.buildqueue = SELECT, INSERT, UPDATE
1124public.job = SELECT, INSERT, UPDATE
1125public.buildpackagejob = SELECT, INSERT, UPDATE
11171126
1118# Thusly the librarian1127# Thusly the librarian
1119public.libraryfilecontent = SELECT, INSERT1128public.libraryfilecontent = SELECT, INSERT
@@ -1195,6 +1204,8 @@
1195public.distrocomponentuploader = SELECT1204public.distrocomponentuploader = SELECT
1196public.build = SELECT, INSERT, UPDATE1205public.build = SELECT, INSERT, UPDATE
1197public.buildqueue = SELECT, INSERT, UPDATE1206public.buildqueue = SELECT, INSERT, UPDATE
1207public.job = SELECT, INSERT, UPDATE
1208public.buildpackagejob = SELECT, INSERT, UPDATE
1198public.pocketchroot = SELECT1209public.pocketchroot = SELECT
1199public.sourcepackagerelease = SELECT, UPDATE1210public.sourcepackagerelease = SELECT, UPDATE
1200public.binarypackagerelease = SELECT, UPDATE1211public.binarypackagerelease = SELECT, UPDATE
12011212
=== modified file 'lib/canonical/launchpad/helpers.py'
--- lib/canonical/launchpad/helpers.py 2009-07-17 00:26:05 +0000
+++ lib/canonical/launchpad/helpers.py 2009-11-16 23:27:14 +0000
@@ -477,9 +477,9 @@
477 if fname.endswith(".diff.gz"):477 if fname.endswith(".diff.gz"):
478 return SourcePackageFileType.DIFF478 return SourcePackageFileType.DIFF
479 if fname.endswith(".orig.tar.gz"):479 if fname.endswith(".orig.tar.gz"):
480 return SourcePackageFileType.ORIG480 return SourcePackageFileType.ORIG_TARBALL
481 if fname.endswith(".tar.gz"):481 if fname.endswith(".tar.gz"):
482 return SourcePackageFileType.TARBALL482 return SourcePackageFileType.NATIVE_TARBALL
483483
484484
485BINARYPACKAGE_EXTENSIONS = {485BINARYPACKAGE_EXTENSIONS = {
486486
=== modified file 'lib/lp/archivepublisher/tests/deathrow.txt'
--- lib/lp/archivepublisher/tests/deathrow.txt 2009-08-28 07:34:44 +0000
+++ lib/lp/archivepublisher/tests/deathrow.txt 2009-11-16 23:27:14 +0000
@@ -106,7 +106,7 @@
106They all share a source file.106They all share a source file.
107107
108 >>> shared_file = test_publisher.addMockFile(108 >>> shared_file = test_publisher.addMockFile(
109 ... 'shared.tar.gz', filecontent='Y')109 ... 'shared_1.0.tar.gz', filecontent='Y')
110 >>> discard = removed_source.sourcepackagerelease.addFile(shared_file)110 >>> discard = removed_source.sourcepackagerelease.addFile(shared_file)
111 >>> discard = postponed_source.sourcepackagerelease.addFile(shared_file)111 >>> discard = postponed_source.sourcepackagerelease.addFile(shared_file)
112 >>> discard = published_source.sourcepackagerelease.addFile(shared_file)112 >>> discard = published_source.sourcepackagerelease.addFile(shared_file)
@@ -228,7 +228,7 @@
228 obsolete-bin_666_i386.deb: OK228 obsolete-bin_666_i386.deb: OK
229 obsolete_666.dsc: OK229 obsolete_666.dsc: OK
230 stuck-bin_666_i386.deb: OK230 stuck-bin_666_i386.deb: OK
231 shared.tar.gz: OK231 shared_1.0.tar.gz: OK
232 stuck_666.dsc: OK232 stuck_666.dsc: OK
233 stuck_667.dsc: OK233 stuck_667.dsc: OK
234 stuck_668.dsc: OK234 stuck_668.dsc: OK
@@ -265,9 +265,9 @@
265 used with different names for two distinct sourcepackages265 used with different names for two distinct sourcepackages
266 (openoffice and openoffice-l10n is an example);266 (openoffice and openoffice-l10n is an example);
267267
268 * The source file shared across publications ('shared.tar.gz') wasn't268 * The source file shared across publications ('shared_1.0.tar.gz')
269 removed as it is still related to a 'live' and a 'future-deletion'269 wasn't removed as it is still related to a 'live' and a
270 publications.270 'future-deletion' publications.
271271
272 * Dependent binaries are only possible via publication copies and are272 * Dependent binaries are only possible via publication copies and are
273 only removed 'atomically', i.e. since there is a 'live' publication273 only removed 'atomically', i.e. since there is a 'live' publication
@@ -316,7 +316,7 @@
316 obsolete-bin_666_i386.deb: REMOVED316 obsolete-bin_666_i386.deb: REMOVED
317 obsolete_666.dsc: REMOVED317 obsolete_666.dsc: REMOVED
318 stuck-bin_666_i386.deb: OK318 stuck-bin_666_i386.deb: OK
319 shared.tar.gz: OK319 shared_1.0.tar.gz: OK
320 stuck_666.dsc: REMOVED320 stuck_666.dsc: REMOVED
321 stuck_667.dsc: OK321 stuck_667.dsc: OK
322 stuck_668.dsc: OK322 stuck_668.dsc: OK
@@ -389,7 +389,7 @@
389 obsolete-bin_666_i386.deb: REMOVED389 obsolete-bin_666_i386.deb: REMOVED
390 obsolete_666.dsc: REMOVED390 obsolete_666.dsc: REMOVED
391 stuck-bin_666_i386.deb: REMOVED391 stuck-bin_666_i386.deb: REMOVED
392 shared.tar.gz: OK392 shared_1.0.tar.gz: OK
393 stuck_666.dsc: REMOVED393 stuck_666.dsc: REMOVED
394 stuck_667.dsc: OK394 stuck_667.dsc: OK
395 stuck_668.dsc: OK395 stuck_668.dsc: OK
396396
=== modified file 'lib/lp/archivepublisher/tests/test_publisher.py'
--- lib/lp/archivepublisher/tests/test_publisher.py 2009-08-28 07:34:44 +0000
+++ lib/lp/archivepublisher/tests/test_publisher.py 2009-11-16 23:27:14 +0000
@@ -280,7 +280,7 @@
280 owner=ubuntu_team, purpose=ArchivePurpose.PPA)280 owner=ubuntu_team, purpose=ArchivePurpose.PPA)
281281
282 pub_source = self.getPubSource(282 pub_source = self.getPubSource(
283 sourcename="foo", filename="foo.dsc", filecontent='Hello world',283 sourcename="foo", filename="foo_1.dsc", filecontent='Hello world',
284 status=PackagePublishingStatus.PENDING, archive=test_archive)284 status=PackagePublishingStatus.PENDING, archive=test_archive)
285285
286 publisher.A_publish(False)286 publisher.A_publish(False)
@@ -290,7 +290,7 @@
290 self.assertEqual(pub_source.status, PackagePublishingStatus.PENDING)290 self.assertEqual(pub_source.status, PackagePublishingStatus.PENDING)
291291
292 # nothing got published292 # nothing got published
293 foo_path = "%s/main/f/foo/foo.dsc" % self.pool_dir293 foo_path = "%s/main/f/foo/foo_1.dsc" % self.pool_dir
294 self.assertEqual(os.path.exists(foo_path), False)294 self.assertEqual(os.path.exists(foo_path), False)
295295
296 def testPublishingWorksForOtherArchives(self):296 def testPublishingWorksForOtherArchives(self):
@@ -309,7 +309,7 @@
309 test_archive)309 test_archive)
310310
311 pub_source = self.getPubSource(311 pub_source = self.getPubSource(
312 sourcename="foo", filename="foo.dsc",312 sourcename="foo", filename="foo_1.dsc",
313 filecontent='I am supposed to be a embargoed archive',313 filecontent='I am supposed to be a embargoed archive',
314 status=PackagePublishingStatus.PENDING, archive=test_archive)314 status=PackagePublishingStatus.PENDING, archive=test_archive)
315315
@@ -322,7 +322,7 @@
322 self.assertEqual(pub_source.status, PackagePublishingStatus.PUBLISHED)322 self.assertEqual(pub_source.status, PackagePublishingStatus.PUBLISHED)
323323
324 # nothing got published324 # nothing got published
325 foo_path = "%s/main/f/foo/foo.dsc" % test_pool_dir325 foo_path = "%s/main/f/foo/foo_1.dsc" % test_pool_dir
326 self.assertEqual(326 self.assertEqual(
327 open(foo_path).read().strip(),327 open(foo_path).read().strip(),
328 'I am supposed to be a embargoed archive',)328 'I am supposed to be a embargoed archive',)
@@ -401,11 +401,11 @@
401 owner=name16, distribution=ubuntu, purpose=ArchivePurpose.PPA)401 owner=name16, distribution=ubuntu, purpose=ArchivePurpose.PPA)
402402
403 pub_source = self.getPubSource(403 pub_source = self.getPubSource(
404 sourcename="foo", filename="foo.dsc", filecontent='Hello world',404 sourcename="foo", filename="foo_1.dsc", filecontent='Hello world',
405 status=PackagePublishingStatus.PENDING, archive=spiv.archive)405 status=PackagePublishingStatus.PENDING, archive=spiv.archive)
406406
407 pub_source = self.getPubSource(407 pub_source = self.getPubSource(
408 sourcename="foo", filename="foo.dsc", filecontent='Hello world',408 sourcename="foo", filename="foo_1.dsc", filecontent='Hello world',
409 status=PackagePublishingStatus.PUBLISHED, archive=name16.archive)409 status=PackagePublishingStatus.PUBLISHED, archive=name16.archive)
410410
411 self.assertEqual(4, ubuntu.getAllPPAs().count())411 self.assertEqual(4, ubuntu.getAllPPAs().count())
@@ -465,7 +465,7 @@
465 # Pending source and binary publications.465 # Pending source and binary publications.
466 # The binary description explores index formatting properties.466 # The binary description explores index formatting properties.
467 pub_source = self.getPubSource(467 pub_source = self.getPubSource(
468 sourcename="foo", filename="foo.dsc", filecontent='Hello world',468 sourcename="foo", filename="foo_1.dsc", filecontent='Hello world',
469 status=PackagePublishingStatus.PENDING, archive=cprov.archive)469 status=PackagePublishingStatus.PENDING, archive=cprov.archive)
470 pub_bin = self.getPubBinaries(470 pub_bin = self.getPubBinaries(
471 pub_source=pub_source,471 pub_source=pub_source,
@@ -507,7 +507,7 @@
507 'Format: 1.0',507 'Format: 1.0',
508 'Directory: pool/main/f/foo',508 'Directory: pool/main/f/foo',
509 'Files:',509 'Files:',
510 ' 3e25960a79dbc69b674cd4ec67a72c62 11 foo.dsc',510 ' 3e25960a79dbc69b674cd4ec67a72c62 11 foo_1.dsc',
511 ''],511 ''],
512 index_contents)512 index_contents)
513513
514514
=== modified file 'lib/lp/archiveuploader/dscfile.py'
--- lib/lp/archiveuploader/dscfile.py 2009-06-24 23:33:29 +0000
+++ lib/lp/archiveuploader/dscfile.py 2009-11-16 23:27:14 +0000
@@ -31,10 +31,13 @@
31 parse_tagfile, TagFileParseError)31 parse_tagfile, TagFileParseError)
32from lp.archiveuploader.utils import (32from lp.archiveuploader.utils import (
33 prefix_multi_line_string, safe_fix_maintainer, ParseMaintError,33 prefix_multi_line_string, safe_fix_maintainer, ParseMaintError,
34 re_valid_pkg_name, re_valid_version, re_issource)34 re_valid_pkg_name, re_valid_version, re_issource,
35 determine_source_file_type)
35from canonical.encoding import guess as guess_encoding36from canonical.encoding import guess as guess_encoding
36from lp.registry.interfaces.person import IPersonSet, PersonCreationRationale37from lp.registry.interfaces.person import IPersonSet, PersonCreationRationale
37from lp.soyuz.interfaces.archive import ArchivePurpose38from lp.registry.interfaces.sourcepackage import SourcePackageFileType
39from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet
40from lp.soyuz.interfaces.sourcepackageformat import SourcePackageFormat
38from canonical.launchpad.interfaces import (41from canonical.launchpad.interfaces import (
39 GPGVerificationError, IGPGHandler, IGPGKeySet,42 GPGVerificationError, IGPGHandler, IGPGKeySet,
40 ISourcePackageNameSet, NotFoundError)43 ISourcePackageNameSet, NotFoundError)
@@ -228,6 +231,9 @@
228 This method is an error generator, i.e, it returns an iterator over all231 This method is an error generator, i.e, it returns an iterator over all
229 exceptions that are generated while processing DSC file checks.232 exceptions that are generated while processing DSC file checks.
230 """233 """
234 # Avoid circular imports.
235 from lp.archiveuploader.nascentupload import EarlyReturnUploadError
236
231 for error in SourceUploadFile.verify(self):237 for error in SourceUploadFile.verify(self):
232 yield error238 yield error
233239
@@ -265,10 +271,17 @@
265 yield UploadError(271 yield UploadError(
266 "%s: invalid version %s" % (self.filename, self.dsc_version))272 "%s: invalid version %s" % (self.filename, self.dsc_version))
267273
268 if self.format != "1.0":274 try:
275 format_term = SourcePackageFormat.getTermByToken(self.format)
276 except LookupError:
277 raise EarlyReturnUploadError(
278 "Unsupported source format: %s" % self.format)
279
280 if not self.policy.distroseries.isSourcePackageFormatPermitted(
281 format_term.value):
269 yield UploadError(282 yield UploadError(
270 "%s: Format is not 1.0. This is incompatible with "283 "%s: format '%s' is not permitted in %s." %
271 "dpkg-source." % self.filename)284 (self.filename, self.format, self.policy.distroseries.name))
272285
273 # Validate the build dependencies286 # Validate the build dependencies
274 for field_name in ['build-depends', 'build-depends-indep']:287 for field_name in ['build-depends', 'build-depends-indep']:
@@ -323,8 +336,19 @@
323336
324 :raise: `NotFoundError` when the wanted file could not be found.337 :raise: `NotFoundError` when the wanted file could not be found.
325 """338 """
326 if (self.policy.archive.purpose == ArchivePurpose.PPA and339 # We cannot check the archive purpose for partner archives here,
327 filename.endswith('.orig.tar.gz')):340 # because the archive override rules have not been applied yet.
341 # Uploads destined for the Ubuntu main archive and the 'partner'
342 # component will eventually end up in the partner archive though.
343 if (self.policy.archive.purpose == ArchivePurpose.PRIMARY and
344 self.component_name == 'partner'):
345 archives = [
346 getUtility(IArchiveSet).getByDistroPurpose(
347 distribution=self.policy.distro,
348 purpose=ArchivePurpose.PARTNER)]
349 elif (self.policy.archive.purpose == ArchivePurpose.PPA and
350 determine_source_file_type(filename) ==
351 SourcePackageFileType.ORIG_TARBALL):
328 archives = [self.policy.archive, self.policy.distro.main_archive]352 archives = [self.policy.archive, self.policy.distro.main_archive]
329 else:353 else:
330 archives = [self.policy.archive]354 archives = [self.policy.archive]
@@ -348,11 +372,25 @@
348 We don't use the NascentUploadFile.verify here, only verify size372 We don't use the NascentUploadFile.verify here, only verify size
349 and checksum.373 and checksum.
350 """374 """
351 has_tar = False375
376 diff_count = 0
377 orig_tar_count = 0
378 native_tar_count = 0
379
352 files_missing = False380 files_missing = False
353 for sub_dsc_file in self.files:381 for sub_dsc_file in self.files:
354 if sub_dsc_file.filename.endswith("tar.gz"):382 filetype = determine_source_file_type(sub_dsc_file.filename)
355 has_tar = True383
384 if filetype == SourcePackageFileType.DIFF:
385 diff_count += 1
386 elif filetype == SourcePackageFileType.ORIG_TARBALL:
387 orig_tar_count += 1
388 elif filetype == SourcePackageFileType.NATIVE_TARBALL:
389 native_tar_count += 1
390 else:
391 yield UploadError('Unknown file: ' + sub_dsc_file.filename)
392 continue
393
356 try:394 try:
357 library_file, file_archive = self._getFileByName(395 library_file, file_archive = self._getFileByName(
358 sub_dsc_file.filename)396 sub_dsc_file.filename)
@@ -397,11 +435,37 @@
397 yield error435 yield error
398 files_missing = True436 files_missing = True
399437
400438 # Reject if we have more than one file of any type.
401 if not has_tar:439 if orig_tar_count > 1:
402 yield UploadError(440 yield UploadError(
403 "%s: does not mention any tar.gz or orig.tar.gz."441 "%s: has more than one orig.tar.*."
404 % self.filename)442 % self.filename)
443 if native_tar_count > 1:
444 yield UploadError(
445 "%s: has more than one tar.*."
446 % self.filename)
447 if diff_count > 1:
448 yield UploadError(
449 "%s: has more than one diff.gz."
450 % self.filename)
451
452 if ((orig_tar_count == 0 and native_tar_count == 0) or
453 (orig_tar_count > 0 and native_tar_count > 0)):
454 yield UploadError(
455 "%s: must have exactly one tar.* or orig.tar.*."
456 % self.filename)
457
458 # Format 1.0 must be native (exactly one tar.gz), or
459 # have an orig.tar.gz and a diff.gz. It cannot have
460 # compression types other than 'gz'.
461 if self.format == '1.0':
462 if ((diff_count == 0 and native_tar_count == 0) or
463 (diff_count > 0 and native_tar_count > 0)):
464 yield UploadError(
465 "%s: must have exactly one diff.gz or tar.gz."
466 % self.filename)
467 else:
468 raise AssertionError("Unknown source format.")
405469
406 if files_missing:470 if files_missing:
407 yield UploadError(471 yield UploadError(
408472
=== modified file 'lib/lp/archiveuploader/nascentupload.py'
--- lib/lp/archiveuploader/nascentupload.py 2009-11-09 17:54:02 +0000
+++ lib/lp/archiveuploader/nascentupload.py 2009-11-16 23:27:14 +0000
@@ -28,8 +28,10 @@
28from lp.archiveuploader.nascentuploadfile import (28from lp.archiveuploader.nascentuploadfile import (
29 UploadError, UploadWarning, CustomUploadFile, SourceUploadFile,29 UploadError, UploadWarning, CustomUploadFile, SourceUploadFile,
30 BaseBinaryUploadFile)30 BaseBinaryUploadFile)
31from lp.archiveuploader.utils import determine_source_file_type
31from lp.archiveuploader.permission import verify_upload32from lp.archiveuploader.permission import verify_upload
32from lp.registry.interfaces.pocket import PackagePublishingPocket33from lp.registry.interfaces.pocket import PackagePublishingPocket
34from lp.registry.interfaces.sourcepackage import SourcePackageFileType
33from lp.soyuz.interfaces.archive import ArchivePurpose, MAIN_ARCHIVE_PURPOSES35from lp.soyuz.interfaces.archive import ArchivePurpose, MAIN_ARCHIVE_PURPOSES
34from canonical.launchpad.interfaces import (36from canonical.launchpad.interfaces import (
35 IBinaryPackageNameSet, IDistributionSet, ILibraryFileAliasSet,37 IBinaryPackageNameSet, IDistributionSet, ILibraryFileAliasSet,
@@ -302,53 +304,35 @@
302 """Heuristic checks on a sourceful upload.304 """Heuristic checks on a sourceful upload.
303305
304 Raises AssertionError when called for a non-sourceful upload.306 Raises AssertionError when called for a non-sourceful upload.
305 Ensures a sourceful upload has, at least:307 Ensures a sourceful upload has exactly one DSC.
306
307 * One DSC
308 * One or none DIFF
309 * One or none ORIG
310 * One or none TAR
311 * If no DIFF is present it must have a TAR (native)
312
313 'hasorig' and 'native' attributes are set when an ORIG and/or an
314 TAR file, respectively, are present.
315 """308 """
316 assert self.sourceful, (309 assert self.sourceful, (
317 "Source consistency check called for a non-source upload")310 "Source consistency check called for a non-source upload")
318311
319 dsc = 0312 dsc = 0
320 diff = 0313 native_tarball = 0
321 orig = 0314 orig_tarball = 0
322 tar = 0
323315
324 for uploaded_file in self.changes.files:316 for uploaded_file in self.changes.files:
325 if uploaded_file.filename.endswith(".dsc"):317 filetype = determine_source_file_type(uploaded_file.filename)
318 if filetype == SourcePackageFileType.DSC:
326 dsc += 1319 dsc += 1
327 elif uploaded_file.filename.endswith(".diff.gz"):320 elif (filetype == SourcePackageFileType.NATIVE_TARBALL
328 diff += 1
329 elif uploaded_file.filename.endswith(".orig.tar.gz"):
330 orig += 1
331 elif (uploaded_file.filename.endswith(".tar.gz")
332 and not isinstance(uploaded_file, CustomUploadFile)):321 and not isinstance(uploaded_file, CustomUploadFile)):
333 tar += 1322 native_tarball += 1
334323 elif filetype == SourcePackageFileType.ORIG_TARBALL:
335 # Okay, let's check the sanity of the upload.324 orig_tarball += 1
325
326
327 # It is never sane to upload more than one source at a time.
336 if dsc > 1:328 if dsc > 1:
337 self.reject("Changes file lists more than one .dsc")329 self.reject("Changes file lists more than one .dsc")
338 if diff > 1:
339 self.reject("Changes file lists more than one .diff.gz")
340 if orig > 1:
341 self.reject("Changes file lists more than one orig.tar.gz")
342 if tar > 1:
343 self.reject("Changes file lists more than one native tar.gz")
344330
345 if dsc == 0:331 if dsc == 0:
346 self.reject("Sourceful upload without a .dsc")332 self.reject("Sourceful upload without a .dsc")
347 if diff == 0 and tar == 0:
348 self.reject("Sourceful upload without a diff or native tar")
349333
350 self.native = bool(tar)334 self.native = bool(native_tarball)
351 self.hasorig = bool(orig)335 self.hasorig = bool(orig_tarball)
352336
353 def _check_binaryful_consistency(self):337 def _check_binaryful_consistency(self):
354 """Heuristic checks on a binaryful upload.338 """Heuristic checks on a binaryful upload.
355339
=== modified file 'lib/lp/archiveuploader/nascentuploadfile.py'
--- lib/lp/archiveuploader/nascentuploadfile.py 2009-07-17 00:26:05 +0000
+++ lib/lp/archiveuploader/nascentuploadfile.py 2009-11-16 23:27:14 +0000
@@ -33,8 +33,9 @@
33from lp.archiveuploader.utils import (33from lp.archiveuploader.utils import (
34 prefix_multi_line_string, re_taint_free, re_isadeb, re_issource,34 prefix_multi_line_string, re_taint_free, re_isadeb, re_issource,
35 re_no_epoch, re_no_revision, re_valid_version, re_valid_pkg_name,35 re_no_epoch, re_no_revision, re_valid_version, re_valid_pkg_name,
36 re_extract_src_version)36 re_extract_src_version, determine_source_file_type)
37from canonical.encoding import guess as guess_encoding37from canonical.encoding import guess as guess_encoding
38from lp.registry.interfaces.sourcepackage import SourcePackageFileType
38from lp.soyuz.interfaces.binarypackagename import (39from lp.soyuz.interfaces.binarypackagename import (
39 IBinaryPackageNameSet)40 IBinaryPackageNameSet)
40from lp.soyuz.interfaces.binarypackagerelease import (41from lp.soyuz.interfaces.binarypackagerelease import (
@@ -351,7 +352,8 @@
351 "Architecture field." % (self.filename))352 "Architecture field." % (self.filename))
352353
353 version_chopped = re_no_epoch.sub('', self.version)354 version_chopped = re_no_epoch.sub('', self.version)
354 if self.filename.endswith("orig.tar.gz"):355 if determine_source_file_type(self.filename) == (
356 SourcePackageFileType.ORIG_TARBALL):
355 version_chopped = re_no_revision.sub('', version_chopped)357 version_chopped = re_no_revision.sub('', version_chopped)
356358
357 source_match = re_issource.match(self.filename)359 source_match = re_issource.match(self.filename)
358360
=== added directory 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt'
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz'
359Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 2009-11-16 23:27:14 +0000 differ361Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.debian.tar.gz 2009-11-16 23:27:14 +0000 differ
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1.dsc 2009-11-16 23:27:14 +0000
@@ -0,0 +1,16 @@
1Format: 3.0 (quilt)
2Source: bar
3Binary: bar
4Architecture: any
5Version: 1.0-1
6Maintainer: Launchpad team <launchpad@lists.canonical.com>
7Standards-Version: 3.6.2
8Checksums-Sha1:
9 73a04163fee97fd2257ab266bd48f1d3d528e012 164 bar_1.0.orig.tar.gz
10 abce262314a7c0ca00e43598f21b41a3e6ff6b21 688 bar_1.0-1.debian.tar.gz
11Checksums-Sha256:
12 f1ecff929899b567f45d6734b69d59a4f3c04dabce3cc8e6ed6d64073eda360e 164 bar_1.0.orig.tar.gz
13 ffdcce60fca14618f68483ca77a206f332a3773dc7ece1c3e6de55c0118c69c6 688 bar_1.0-1.debian.tar.gz
14Files:
15 fc1464e5985b962a042d5354452f361d 164 bar_1.0.orig.tar.gz
16 056db4dfe7de8322296b6d417592ee01 688 bar_1.0-1.debian.tar.gz
017
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0-1_source.changes 2009-11-16 23:27:14 +0000
@@ -0,0 +1,28 @@
1Format: 1.8
2Date: Thu, 16 Feb 2006 15:34:09 +0000
3Source: bar
4Binary: bar
5Architecture: source
6Version: 1.0-1
7Distribution: breezy
8Urgency: low
9Maintainer: Launchpad team <launchpad@lists.canonical.com>
10Changed-By: Daniel Silverstone <daniel.silverstone@canonical.com>
11Description:
12 bar - Stuff for testing
13Changes:
14 bar (1.0-1) breezy; urgency=low
15 .
16 * Initial version
17Checksums-Sha1:
18 bc97e185cf31af33bf8d109044ce51f32d09c229 645 bar_1.0-1.dsc
19 73a04163fee97fd2257ab266bd48f1d3d528e012 164 bar_1.0.orig.tar.gz
20 abce262314a7c0ca00e43598f21b41a3e6ff6b21 688 bar_1.0-1.debian.tar.gz
21Checksums-Sha256:
22 ae0fb16941a95518332a8ee962d00d55963b491c2df94b3f230a65d2bdbeedf8 645 bar_1.0-1.dsc
23 f1ecff929899b567f45d6734b69d59a4f3c04dabce3cc8e6ed6d64073eda360e 164 bar_1.0.orig.tar.gz
24 ffdcce60fca14618f68483ca77a206f332a3773dc7ece1c3e6de55c0118c69c6 688 bar_1.0-1.debian.tar.gz
25Files:
26 c320d2827f08f09ec2e1bbbac635225c 645 devel optional bar_1.0-1.dsc
27 fc1464e5985b962a042d5354452f361d 164 devel optional bar_1.0.orig.tar.gz
28 056db4dfe7de8322296b6d417592ee01 688 devel optional bar_1.0-1.debian.tar.gz
029
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz'
1Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 2009-11-16 23:27:14 +0000 differ30Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_3.0-quilt/bar_1.0.orig.tar.gz 2009-11-16 23:27:14 +0000 differ
=== added directory 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3'
=== added file 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.diff.gz'
2Binary files lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.diff.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.diff.gz 2009-11-16 23:27:14 +0000 differ31Binary files lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.diff.gz 1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.diff.gz 2009-11-16 23:27:14 +0000 differ
=== added file 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.dsc'
--- lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.dsc 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3.dsc 2009-11-16 23:27:14 +0000
@@ -0,0 +1,10 @@
1Format: 1.0
2Source: foocomm
3Version: 1.0-3
4Binary: foocomm
5Maintainer: Launchpad team <launchpad@lists.canonical.com>
6Architecture: any
7Standards-Version: 3.6.2
8Files:
9 ad436f97a58df5b233209857439f1e7c 171 foocomm_1.0.orig.tar.gz
10 e03c530973064ebbbde9226e03868cb1 595 foocomm_1.0-3.diff.gz
011
=== added file 'lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3_source.changes'
--- lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3_source.changes 1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/foocomm_1.0-3/foocomm_1.0-3_source.changes 2009-11-16 23:27:14 +0000
@@ -0,0 +1,27 @@
1Format: 1.7
2Date: Thu, 27 Feb 2006 15:34:09 +0000
3Source: foocomm
4Binary: foocomm
5Architecture: source
6Version: 1.0-3
7Distribution: breezy
8Urgency: low
9Maintainer: Launchpad team <launchpad@lists.canonical.com>
10Changed-By: Foo Bar <foo.bar@canonical.com>
11Description:
12 foocomm - Stuff for testing
13Changes:
14 foocomm (1.0-1) breezy; urgency=low
15 .
16 * Initial version
17 .
18 foocomm (1.0-2) breezy; urgency=low
19 .
20 * Version 2 testing
21 .
22 foocomm (1.0-3) breezy; urgency=low
23 .
24 * Version 3 testing, orig.tar.gz reuse from partner archive.
25Files:
26 5885c292c1f4a3611a6506e4fa4e80a8 291 partner/devel optional foocomm_1.0-3.dsc
27 e03c530973064ebbbde9226e03868cb1 595 partner/devel optional foocomm_1.0-3.diff.gz
028
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2009-10-26 18:40:04 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2009-11-16 23:27:14 +0000
@@ -946,6 +946,7 @@
946 except NotFoundError:946 except NotFoundError:
947 self.fail('bar_1.0.orig.tar.gz is not yet published.')947 self.fail('bar_1.0.orig.tar.gz is not yet published.')
948948
949 # Please note: this upload goes to the Ubuntu main archive.
949 upload_dir = self.queueUpload("bar_1.0-10")950 upload_dir = self.queueUpload("bar_1.0-10")
950 self.processUpload(self.uploadprocessor, upload_dir)951 self.processUpload(self.uploadprocessor, upload_dir)
951 # Discard the announcement email and check the acceptance message952 # Discard the announcement email and check the acceptance message
@@ -961,6 +962,7 @@
961 # Make the official bar orig.tar.gz available in the system.962 # Make the official bar orig.tar.gz available in the system.
962 self.uploadNewBarToUbuntu()963 self.uploadNewBarToUbuntu()
963964
965 # Please note: the upload goes to the PPA.
964 # Upload a higher version of 'bar' to a PPA that relies on the966 # Upload a higher version of 'bar' to a PPA that relies on the
965 # availability of orig.tar.gz published in ubuntu.967 # availability of orig.tar.gz published in ubuntu.
966 upload_dir = self.queueUpload("bar_1.0-10", "~name16/ubuntu")968 upload_dir = self.queueUpload("bar_1.0-10", "~name16/ubuntu")
@@ -1032,6 +1034,7 @@
1032 # Make the official bar orig.tar.gz available in the system.1034 # Make the official bar orig.tar.gz available in the system.
1033 self.uploadNewBarToUbuntu()1035 self.uploadNewBarToUbuntu()
10341036
1037 # Please note: the upload goes to the PPA.
1035 # Upload a higher version of 'bar' to a PPA that relies on the1038 # Upload a higher version of 'bar' to a PPA that relies on the
1036 # availability of orig.tar.gz published in the PPA itself.1039 # availability of orig.tar.gz published in the PPA itself.
1037 upload_dir = self.queueUpload("bar_1.0-10-ppa-orig", "~name16/ubuntu")1040 upload_dir = self.queueUpload("bar_1.0-10-ppa-orig", "~name16/ubuntu")
10381041
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-09 16:44:39 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-16 23:27:14 +0000
@@ -49,6 +49,8 @@
49from lp.soyuz.interfaces.archivepermission import (49from lp.soyuz.interfaces.archivepermission import (
50 ArchivePermissionType, IArchivePermissionSet)50 ArchivePermissionType, IArchivePermissionSet)
51from lp.soyuz.interfaces.component import IComponentSet51from lp.soyuz.interfaces.component import IComponentSet
52from lp.soyuz.interfaces.sourcepackageformat import (
53 ISourcePackageFormatSelectionSet, SourcePackageFormat)
52from lp.registry.interfaces.person import IPersonSet54from lp.registry.interfaces.person import IPersonSet
53from lp.registry.interfaces.sourcepackagename import (55from lp.registry.interfaces.sourcepackagename import (
54 ISourcePackageNameSet)56 ISourcePackageNameSet)
@@ -157,7 +159,7 @@
157 excName = str(excClass)159 excName = str(excClass)
158 raise self.failureException, "%s not raised" % excName160 raise self.failureException, "%s not raised" % excName
159161
160 def setupBreezy(self, name="breezy"):162 def setupBreezy(self, name="breezy", permitted_formats=None):
161 """Create a fresh distroseries in ubuntu.163 """Create a fresh distroseries in ubuntu.
162164
163 Use *initialiseFromParent* procedure to create 'breezy'165 Use *initialiseFromParent* procedure to create 'breezy'
@@ -168,6 +170,8 @@
168170
169 :param name: supply the name of the distroseries if you don't want171 :param name: supply the name of the distroseries if you don't want
170 it to be called "breezy"172 it to be called "breezy"
173 :param permitted_formats: list of SourcePackageFormats to allow
174 in the new distroseries. Only permits '1.0' by default.
171 """175 """
172 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')176 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
173 bat = self.ubuntu['breezy-autotest']177 bat = self.ubuntu['breezy-autotest']
@@ -185,6 +189,14 @@
185 self.breezy.changeslist = 'breezy-changes@ubuntu.com'189 self.breezy.changeslist = 'breezy-changes@ubuntu.com'
186 self.breezy.initialiseFromParent()190 self.breezy.initialiseFromParent()
187191
192 if permitted_formats is None:
193 permitted_formats = [SourcePackageFormat.FORMAT_1_0]
194
195 for format in permitted_formats:
196 if not self.breezy.isSourcePackageFormatPermitted(format):
197 getUtility(ISourcePackageFormatSelectionSet).add(
198 self.breezy, format)
199
188 def addMockFile(self, filename, content="anything"):200 def addMockFile(self, filename, content="anything"):
189 """Return a librarian file."""201 """Return a librarian file."""
190 return getUtility(ILibraryFileAliasSet).create(202 return getUtility(ILibraryFileAliasSet).create(
@@ -742,6 +754,53 @@
742 "Expected email containing 'Cannot mix partner files with "754 "Expected email containing 'Cannot mix partner files with "
743 "non-partner.', got:\n%s" % raw_msg)755 "non-partner.', got:\n%s" % raw_msg)
744756
757 def testPartnerReusingOrigFromPartner(self):
758 """Partner uploads reuse 'orig.tar.gz' from the partner archive."""
759 # Make the official bar orig.tar.gz available in the system.
760 uploadprocessor = self.setupBreezyAndGetUploadProcessor(
761 policy='absolutely-anything')
762
763 upload_dir = self.queueUpload("foocomm_1.0-1")
764 self.processUpload(uploadprocessor, upload_dir)
765
766 self.assertEqual(
767 uploadprocessor.last_processed_upload.queue_root.status,
768 PackageUploadStatus.NEW)
769
770 [queue_item] = self.breezy.getQueueItems(
771 status=PackageUploadStatus.NEW, name="foocomm",
772 version="1.0-1", exact_match=True)
773 queue_item.setAccepted()
774 queue_item.realiseUpload()
775 self.layer.commit()
776
777 archive = getUtility(IArchiveSet).getByDistroPurpose(
778 distribution=self.ubuntu, purpose=ArchivePurpose.PARTNER)
779 try:
780 self.ubuntu.getFileByName(
781 'foocomm_1.0.orig.tar.gz', archive=archive, source=True,
782 binary=False)
783 except NotFoundError:
784 self.fail('foocomm_1.0.orig.tar.gz is not yet published.')
785
786 # Please note: this upload goes to the Ubuntu main archive.
787 upload_dir = self.queueUpload("foocomm_1.0-3")
788 self.processUpload(uploadprocessor, upload_dir)
789 # Discard the announcement email and check the acceptance message
790 # content.
791 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
792 msg = message_from_string(raw_msg)
793 # This is now a MIMEMultipart message.
794 body = msg.get_payload(0)
795 body = body.get_payload(decode=True)
796
797 self.assertEqual(
798 '[ubuntu/breezy] foocomm 1.0-3 (Accepted)', msg['Subject'])
799 self.assertFalse(
800 'Unable to find foocomm_1.0.orig.tar.gz in upload or '
801 'distribution.' in body,
802 'Unable to find foocomm_1.0.orig.tar.gz')
803
745 def testPartnerUpload(self):804 def testPartnerUpload(self):
746 """Partner packages should be uploaded to the partner archive.805 """Partner packages should be uploaded to the partner archive.
747806
@@ -1420,6 +1479,28 @@
1420 ]1479 ]
1421 self.assertEmail(contents, recipients=recipients)1480 self.assertEmail(contents, recipients=recipients)
14221481
1482 def test30QuiltUploadToUnsupportingSeriesIsRejected(self):
1483 """Ensure that uploads to series without format support are rejected.
1484
1485 Series can restrict the source formats that they accept. Uploads
1486 should be rejected if an unsupported format is uploaded.
1487 """
1488 self.setupBreezy()
1489 self.layer.txn.commit()
1490 self.options.context = 'absolutely-anything'
1491 uploadprocessor = UploadProcessor(
1492 self.options, self.layer.txn, self.log)
1493
1494 # Upload the source.
1495 upload_dir = self.queueUpload("bar_1.0-1_3.0-quilt")
1496 self.processUpload(uploadprocessor, upload_dir)
1497 # Make sure it was rejected.
1498 from_addr, to_addrs, raw_msg = stub.test_emails.pop()
1499 self.assertTrue(
1500 "bar_1.0-1.dsc: format '3.0 (quilt)' is not permitted in "
1501 "breezy." in raw_msg,
1502 "Source was not rejected properly:\n%s" % raw_msg)
1503
14231504
1424def test_suite():1505def test_suite():
1425 return unittest.TestLoader().loadTestsFromName(__name__)1506 return unittest.TestLoader().loadTestsFromName(__name__)
14261507
=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py 2009-06-24 23:33:29 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py 2009-11-16 23:27:14 +0000
@@ -8,6 +8,8 @@
8import unittest8import unittest
9import sys9import sys
10import shutil10import shutil
11
12from lp.registry.interfaces.sourcepackage import SourcePackageFileType
11from lp.archiveuploader.tests import datadir13from lp.archiveuploader.tests import datadir
1214
1315
@@ -17,6 +19,25 @@
17 """lp.archiveuploader.utils should be importable"""19 """lp.archiveuploader.utils should be importable"""
18 import lp.archiveuploader.utils20 import lp.archiveuploader.utils
1921
22 def test_determine_source_file_type(self):
23 """lp.archiveuploader.utils.determine_source_file_type should work."""
24 from lp.archiveuploader.utils import determine_source_file_type
25
26 self.assertEquals(
27 SourcePackageFileType.DSC,
28 determine_source_file_type('foo_1.0-1.dsc'))
29 self.assertEquals(
30 SourcePackageFileType.DIFF,
31 determine_source_file_type('foo_1.0-1.diff.gz'))
32 self.assertEquals(
33 SourcePackageFileType.ORIG_TARBALL,
34 determine_source_file_type('foo_1.0.orig.tar.gz'))
35 self.assertEquals(
36 SourcePackageFileType.NATIVE_TARBALL,
37 determine_source_file_type('foo_1.0.tar.gz'))
38 self.assertEquals(None, determine_source_file_type('foo_1.0'))
39 self.assertEquals(None, determine_source_file_type('foo_1.0.blah.gz'))
40
20 def testPrefixMultilineString(self):41 def testPrefixMultilineString(self):
21 """lp.archiveuploader.utils.prefix_multi_line_string should work"""42 """lp.archiveuploader.utils.prefix_multi_line_string should work"""
22 from lp.archiveuploader.utils import prefix_multi_line_string43 from lp.archiveuploader.utils import prefix_multi_line_string
2344
=== modified file 'lib/lp/archiveuploader/utils.py'
--- lib/lp/archiveuploader/utils.py 2009-06-24 23:33:29 +0000
+++ lib/lp/archiveuploader/utils.py 2009-11-16 23:27:14 +0000
@@ -15,6 +15,8 @@
15 're_valid_pkg_name',15 're_valid_pkg_name',
16 're_changes_file_name',16 're_changes_file_name',
17 're_extract_src_version',17 're_extract_src_version',
18 'get_source_file_extension',
19 'determine_source_file_type',
18 'prefix_multi_line_string',20 'prefix_multi_line_string',
19 'safe_fix_maintainer',21 'safe_fix_maintainer',
20 'ParseMaintError',22 'ParseMaintError',
@@ -31,7 +33,14 @@
31re_taint_free = re.compile(r"^[-+~/\.\w]+$")33re_taint_free = re.compile(r"^[-+~/\.\w]+$")
3234
33re_isadeb = re.compile(r"(.+?)_(.+?)_(.+)\.(u?d?deb)$")35re_isadeb = re.compile(r"(.+?)_(.+?)_(.+)\.(u?d?deb)$")
34re_issource = re.compile(r"(.+)_(.+?)\.(orig\.tar\.gz|diff\.gz|tar\.gz|dsc)$")36
37source_file_exts = ['orig.tar.gz', 'diff.gz', 'tar.gz', 'dsc']
38re_issource = re.compile(
39 r"(.+)_(.+?)\.(%s)" % "|".join(
40 re.escape(ext) for ext in source_file_exts))
41
42re_is_orig_tar_ext = re.compile(r"^orig.tar.gz$")
43re_is_native_tar_ext = re.compile(r"^tar.gz$")
3544
36re_no_epoch = re.compile(r"^\d+\:")45re_no_epoch = re.compile(r"^\d+\:")
37re_no_revision = re.compile(r"-[^-]+$")46re_no_revision = re.compile(r"-[^-]+$")
@@ -44,6 +53,34 @@
44re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")53re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
4554
4655
56def get_source_file_extension(filename):
57 """Get the extension part of a source file name."""
58 match = re_issource.match(filename)
59 if match is None:
60 return None
61 return match.group(3)
62
63
64def determine_source_file_type(filename):
65 """Determine the SourcePackageFileType of the given filename."""
66 # Avoid circular imports.
67 from lp.registry.interfaces.sourcepackage import SourcePackageFileType
68
69 extension = get_source_file_extension(filename)
70 if extension is None:
71 return None
72 elif extension == "dsc":
73 return SourcePackageFileType.DSC
74 elif extension == "diff.gz":
75 return SourcePackageFileType.DIFF
76 elif re_is_orig_tar_ext.match(extension):
77 return SourcePackageFileType.ORIG_TARBALL
78 elif re_is_native_tar_ext.match(extension):
79 return SourcePackageFileType.NATIVE_TARBALL
80 else:
81 return None
82
83
47def prefix_multi_line_string(str, prefix, include_blank_lines=0):84def prefix_multi_line_string(str, prefix, include_blank_lines=0):
48 """Utility function to split an input string and prefix,85 """Utility function to split an input string and prefix,
4986
5087
=== modified file 'lib/lp/buildmaster/buildergroup.py'
--- lib/lp/buildmaster/buildergroup.py 2009-08-16 12:38:12 +0000
+++ lib/lp/buildmaster/buildergroup.py 2009-11-16 23:27:14 +0000
@@ -130,8 +130,9 @@
130 try:130 try:
131 build = getUtility(IBuildSet).getByBuildID(int(build_id))131 build = getUtility(IBuildSet).getByBuildID(int(build_id))
132 queue_item = getUtility(IBuildQueueSet).get(int(queue_item_id))132 queue_item = getUtility(IBuildQueueSet).get(int(queue_item_id))
133 # Also check it build and buildqueue are properly related.133 queued_build = getUtility(IBuildSet).getByQueueEntry(queue_item)
134 if queue_item.build.id != build.id:134 # Also check whether build and buildqueue are properly related.
135 if queued_build.id != build.id:
135 raise BuildJobMismatch('Job build entry mismatch')136 raise BuildJobMismatch('Job build entry mismatch')
136137
137 except (SQLObjectNotFound, NotFoundError, BuildJobMismatch), reason:138 except (SQLObjectNotFound, NotFoundError, BuildJobMismatch), reason:
@@ -159,9 +160,10 @@
159160
160 Invoke getFileFromSlave method with 'buildlog' identifier.161 Invoke getFileFromSlave method with 'buildlog' identifier.
161 """162 """
163 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
162 return queueItem.builder.transferSlaveFileToLibrarian(164 return queueItem.builder.transferSlaveFileToLibrarian(
163 'buildlog', queueItem.getLogFileName(),165 'buildlog', queueItem.getLogFileName(),
164 queueItem.build.archive.private)166 build.archive.private)
165167
166 def updateBuild(self, queueItem):168 def updateBuild(self, queueItem):
167 """Verify the current build job status.169 """Verify the current build job status.
@@ -199,7 +201,7 @@
199 "Unknown status code (%s) returned from status() probe."201 "Unknown status code (%s) returned from status() probe."
200 % builder_status)202 % builder_status)
201 queueItem.builder = None203 queueItem.builder = None
202 queueItem.buildstart = None204 queueItem.setDateStarted(None)
203 self.commit()205 self.commit()
204 return206 return
205207
@@ -261,17 +263,18 @@
261263
262 Store Buildlog, datebuilt, duration, dependencies.264 Store Buildlog, datebuilt, duration, dependencies.
263 """265 """
264 queueItem.build.buildlog = self.getLogFromSlave(queueItem)266 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
265 queueItem.build.builder = queueItem.builder267 build.buildlog = self.getLogFromSlave(queueItem)
266 queueItem.build.dependencies = dependencies268 build.builder = queueItem.builder
269 build.dependencies = dependencies
267 # XXX cprov 20060615 bug=120584: Currently buildduration includes270 # XXX cprov 20060615 bug=120584: Currently buildduration includes
268 # the scanner latency, it should really be asking the slave for271 # the scanner latency, it should really be asking the slave for
269 # the duration spent building locally.272 # the duration spent building locally.
270 queueItem.build.datebuilt = UTC_NOW273 build.datebuilt = UTC_NOW
271 # We need dynamic datetime.now() instance to be able to perform274 # We need dynamic datetime.now() instance to be able to perform
272 # the time operations for duration.275 # the time operations for duration.
273 RIGHT_NOW = datetime.datetime.now(pytz.timezone('UTC'))276 RIGHT_NOW = datetime.datetime.now(pytz.timezone('UTC'))
274 queueItem.build.buildduration = RIGHT_NOW - queueItem.buildstart277 build.buildduration = RIGHT_NOW - queueItem.date_started
275278
276279
277 def buildStatus_OK(self, queueItem, librarian, buildid,280 def buildStatus_OK(self, queueItem, librarian, buildid,
@@ -287,7 +290,7 @@
287 self.logger.debug("Processing successful build %s" % buildid)290 self.logger.debug("Processing successful build %s" % buildid)
288 # Explode before collect a binary that is denied in this291 # Explode before collect a binary that is denied in this
289 # distroseries/pocket292 # distroseries/pocket
290 build = queueItem.build293 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
291 if not build.archive.allowUpdatesToReleasePocket():294 if not build.archive.allowUpdatesToReleasePocket():
292 assert build.distroseries.canUploadToPocket(build.pocket), (295 assert build.distroseries.canUploadToPocket(build.pocket), (
293 "%s (%s) can not be built for pocket %s: illegal status"296 "%s (%s) can not be built for pocket %s: illegal status"
@@ -309,8 +312,9 @@
309 # can be correctly found during the upload:312 # can be correctly found during the upload:
310 # <archive_id>/distribution_name313 # <archive_id>/distribution_name
311 # for all destination archive types.314 # for all destination archive types.
312 archive = queueItem.build.archive315 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
313 distribution_name = queueItem.build.distribution.name316 archive = build.archive
317 distribution_name = build.distribution.name
314 target_path = '%s/%s' % (archive.id, distribution_name)318 target_path = '%s/%s' % (archive.id, distribution_name)
315 upload_path = os.path.join(upload_dir, target_path)319 upload_path = os.path.join(upload_dir, target_path)
316 os.makedirs(upload_path)320 os.makedirs(upload_path)
@@ -330,10 +334,10 @@
330 # add extra arguments for processing a binary upload334 # add extra arguments for processing a binary upload
331 extra_args = [335 extra_args = [
332 "--log-file", "%s" % uploader_logfilename,336 "--log-file", "%s" % uploader_logfilename,
333 "-d", "%s" % queueItem.build.distribution.name,337 "-d", "%s" % build.distribution.name,
334 "-s", "%s" % (queueItem.build.distroseries.name +338 "-s", "%s" % (build.distroseries.name +
335 pocketsuffix[queueItem.build.pocket]),339 pocketsuffix[build.pocket]),
336 "-b", "%s" % queueItem.build.id,340 "-b", "%s" % build.id,
337 "-J", "%s" % upload_leaf,341 "-J", "%s" % upload_leaf,
338 "%s" % root,342 "%s" % root,
339 ]343 ]
@@ -409,12 +413,11 @@
409 # uploader about this occurrence. The failure notification will413 # uploader about this occurrence. The failure notification will
410 # also contain the information required to manually reprocess the414 # also contain the information required to manually reprocess the
411 # binary upload when it was the case.415 # binary upload when it was the case.
412 build = getUtility(IBuildSet).getByBuildID(queueItem.build.id)416 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
413 if (build.buildstate != BuildStatus.FULLYBUILT or417 if (build.buildstate != BuildStatus.FULLYBUILT or
414 build.binarypackages.count() == 0):418 build.binarypackages.count() == 0):
415 self.logger.debug("Build %s upload failed." % build.id)419 self.logger.debug("Build %s upload failed." % build.id)
416 # update builder420 build.buildstate = BuildStatus.FAILEDTOUPLOAD
417 queueItem.build.buildstate = BuildStatus.FAILEDTOUPLOAD
418 # Retrieve log file content.421 # Retrieve log file content.
419 possible_locations = (422 possible_locations = (
420 'failed', 'failed-to-move', 'rejected', 'accepted')423 'failed', 'failed-to-move', 'rejected', 'accepted')
@@ -434,11 +437,13 @@
434 uploader_log_content = 'Could not find upload log file'437 uploader_log_content = 'Could not find upload log file'
435 # Store the upload_log_contents in librarian so it can be438 # Store the upload_log_contents in librarian so it can be
436 # accessed by anyone with permission to see the build.439 # accessed by anyone with permission to see the build.
437 queueItem.build.storeUploadLog(uploader_log_content)440 build.storeUploadLog(uploader_log_content)
438 # Notify the build failure.441 # Notify the build failure.
439 queueItem.build.notify(extra_info=uploader_log_content)442 build.notify(extra_info=uploader_log_content)
440 else:443 else:
441 self.logger.debug("Gathered build %s completely" % queueItem.name)444 self.logger.debug(
445 "Gathered build %s completely" %
446 build.sourcepackagerelease.name)
442447
443 # Release the builder for another job.448 # Release the builder for another job.
444 queueItem.builder.cleanSlave()449 queueItem.builder.cleanSlave()
@@ -456,10 +461,11 @@
456 set the job status as FAILEDTOBUILD, store available info and461 set the job status as FAILEDTOBUILD, store available info and
457 remove Buildqueue entry.462 remove Buildqueue entry.
458 """463 """
459 queueItem.build.buildstate = BuildStatus.FAILEDTOBUILD464 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
465 build.buildstate = BuildStatus.FAILEDTOBUILD
460 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)466 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)
461 queueItem.builder.cleanSlave()467 queueItem.builder.cleanSlave()
462 queueItem.build.notify()468 build.notify()
463 queueItem.destroySelf()469 queueItem.destroySelf()
464470
465 def buildStatus_DEPFAIL(self, queueItem, librarian, buildid,471 def buildStatus_DEPFAIL(self, queueItem, librarian, buildid,
@@ -470,7 +476,8 @@
470 MANUALDEPWAIT, store available information, remove BuildQueue476 MANUALDEPWAIT, store available information, remove BuildQueue
471 entry and release builder slave for another job.477 entry and release builder slave for another job.
472 """478 """
473 queueItem.build.buildstate = BuildStatus.MANUALDEPWAIT479 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
480 build.buildstate = BuildStatus.MANUALDEPWAIT
474 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)481 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)
475 self.logger.critical("***** %s is MANUALDEPWAIT *****"482 self.logger.critical("***** %s is MANUALDEPWAIT *****"
476 % queueItem.builder.name)483 % queueItem.builder.name)
@@ -485,12 +492,13 @@
485 job as CHROOTFAIL, store available information, remove BuildQueue492 job as CHROOTFAIL, store available information, remove BuildQueue
486 and release the builder.493 and release the builder.
487 """494 """
488 queueItem.build.buildstate = BuildStatus.CHROOTWAIT495 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
496 build.buildstate = BuildStatus.CHROOTWAIT
489 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)497 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)
490 self.logger.critical("***** %s is CHROOTWAIT *****" %498 self.logger.critical("***** %s is CHROOTWAIT *****" %
491 queueItem.builder.name)499 queueItem.builder.name)
492 queueItem.builder.cleanSlave()500 queueItem.builder.cleanSlave()
493 queueItem.build.notify()501 build.notify()
494 queueItem.destroySelf()502 queueItem.destroySelf()
495503
496 def buildStatus_BUILDERFAIL(self, queueItem, librarian, buildid,504 def buildStatus_BUILDERFAIL(self, queueItem, librarian, buildid,
@@ -507,10 +515,11 @@
507 ("Builder returned BUILDERFAIL when asked "515 ("Builder returned BUILDERFAIL when asked "
508 "for its status"))516 "for its status"))
509 # simply reset job517 # simply reset job
510 queueItem.build.buildstate = BuildStatus.NEEDSBUILD518 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
519 build.buildstate = BuildStatus.NEEDSBUILD
511 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)520 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)
512 queueItem.builder = None521 queueItem.builder = None
513 queueItem.buildstart = None522 queueItem.setDateStarted(None)
514523
515 def buildStatus_GIVENBACK(self, queueItem, librarian, buildid,524 def buildStatus_GIVENBACK(self, queueItem, librarian, buildid,
516 filemap=None, dependencies=None):525 filemap=None, dependencies=None):
@@ -522,7 +531,8 @@
522 """531 """
523 self.logger.warning("***** %s is GIVENBACK by %s *****"532 self.logger.warning("***** %s is GIVENBACK by %s *****"
524 % (buildid, queueItem.builder.name))533 % (buildid, queueItem.builder.name))
525 queueItem.build.buildstate = BuildStatus.NEEDSBUILD534 build = getUtility(IBuildSet).getByQueueEntry(queueItem)
535 build.buildstate = BuildStatus.NEEDSBUILD
526 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)536 self.storeBuildInfo(queueItem, librarian, buildid, dependencies)
527 # XXX cprov 2006-05-30: Currently this information is not537 # XXX cprov 2006-05-30: Currently this information is not
528 # properly presented in the Web UI. We will discuss it in538 # properly presented in the Web UI. We will discuss it in
@@ -530,7 +540,7 @@
530 # to use this content. For now we just ensure it's stored.540 # to use this content. For now we just ensure it's stored.
531 queueItem.builder.cleanSlave()541 queueItem.builder.cleanSlave()
532 queueItem.builder = None542 queueItem.builder = None
533 queueItem.buildstart = None543 queueItem.setDateStarted(None)
534 queueItem.logtail = None544 queueItem.logtail = None
535 queueItem.lastscore = 0545 queueItem.lastscore = 0
536546
537547
=== added directory 'lib/lp/buildmaster/interfaces'
=== added file 'lib/lp/buildmaster/interfaces/__init__.py'
=== added file 'lib/lp/buildmaster/interfaces/buildfarmjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmjob.py 1970-01-01 00:00:00 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmjob.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,71 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4# pylint: disable-msg=E0211,E0213
5
6"""Interface for Soyuz build farm jobs."""
7
8__metaclass__ = type
9
10__all__ = [
11 'IBuildFarmJob',
12 'BuildFarmJobType',
13 ]
14
15from zope.interface import Interface
16from lazr.enum import DBEnumeratedType, DBItem
17
18
19class BuildFarmJobType(DBEnumeratedType):
20 """Soyuz build farm job type.
21
22 An enumeration with the types of jobs that may be run on the Soyuz build
23 farm.
24 """
25
26 PACKAGEBUILD = DBItem(1, """
27 PackageBuildJob
28
29 Build a source package.
30 """)
31
32 BRANCHBUILD = DBItem(2, """
33 BranchBuildJob
34
35 Build a package from a bazaar branch.
36 """)
37
38 RECIPEBRANCHBUILD = DBItem(3, """
39 RecipeBranchBuildJob
40
41 Build a package from a bazaar branch and a recipe.
42 """)
43
44 TRANSLATION = DBItem(4, """
45 TranslationJob
46
47 Perform a translation job.
48 """)
49
50
51class IBuildFarmJob(Interface):
52 """Operations that Soyuz build farm jobs must implement."""
53
54 def score():
55 """Calculate a job score appropriate for the job type in question."""
56
57 def getLogFileName():
58 """The preferred file name for the log of this Soyuz job."""
59
60 def getName():
61 """An appropriate name for this Soyuz job."""
62
63 def jobStarted():
64 """'Job started' life cycle event, handle as appropriate."""
65
66 def jobReset():
67 """'Job reset' life cycle event, handle as appropriate."""
68
69 def jobAborted():
70 """'Job aborted' life cycle event, handle as appropriate."""
71
072
=== modified file 'lib/lp/buildmaster/master.py'
--- lib/lp/buildmaster/master.py 2009-10-26 18:40:04 +0000
+++ lib/lp/buildmaster/master.py 2009-11-16 23:27:14 +0000
@@ -280,8 +280,10 @@
280 "scanActiveBuilders() found %d active build(s) to check"280 "scanActiveBuilders() found %d active build(s) to check"
281 % queueItems.count())281 % queueItems.count())
282282
283 build_set = getUtility(IBuildSet)
283 for job in queueItems:284 for job in queueItems:
284 proc = job.archseries.processorfamily285 build = build_set.getByQueueEntry(job)
286 proc = build.distroarchseries.processorfamily
285 try:287 try:
286 builders = notes[proc]["builders"]288 builders = notes[proc]["builders"]
287 except KeyError:289 except KeyError:
@@ -309,7 +311,7 @@
309 % candidates.count())311 % candidates.count())
310312
311 for job in candidates:313 for job in candidates:
312 uptodate_build = getUtility(IBuildSet).getByBuildID(job.build.id)314 uptodate_build = getUtility(IBuildSet).getByQueueEntry(job)
313 if uptodate_build.buildstate != BuildStatus.NEEDSBUILD:315 if uptodate_build.buildstate != BuildStatus.NEEDSBUILD:
314 continue316 continue
315 job.score()317 job.score()
316318
=== added directory 'lib/lp/buildmaster/model'
=== added file 'lib/lp/buildmaster/model/__init__.py'
=== added file 'lib/lp/buildmaster/model/buildfarmjob.py'
--- lib/lp/buildmaster/model/buildfarmjob.py 1970-01-01 00:00:00 +0000
+++ lib/lp/buildmaster/model/buildfarmjob.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,40 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4__metaclass__ = type
5__all__ = ['BuildFarmJob']
6
7
8from zope.interface import implements
9
10from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
11
12
13class BuildFarmJob:
14 """Mix-in class for `IBuildFarmJob` implementations."""
15 implements(IBuildFarmJob)
16
17 def score(self):
18 """See `IBuildFarmJob`."""
19 raise NotImplementedError
20
21 def getLogFileName(self):
22 """See `IBuildFarmJob`."""
23 raise NotImplementedError
24
25 def getName(self):
26 """See `IBuildFarmJob`."""
27 raise NotImplementedError
28
29 def jobStarted(self):
30 """See `IBuildFarmJob`."""
31 pass
32
33 def jobReset(self):
34 """See `IBuildFarmJob`."""
35 pass
36
37 def jobAborted(self):
38 """See `IBuildFarmJob`."""
39 pass
40
041
=== modified file 'lib/lp/buildmaster/tests/queuebuilder.txt'
--- lib/lp/buildmaster/tests/queuebuilder.txt 2009-10-26 18:40:04 +0000
+++ lib/lp/buildmaster/tests/queuebuilder.txt 2009-11-16 23:27:14 +0000
@@ -229,7 +229,7 @@
229 >>> copied_pub = pub_failed.copyTo(229 >>> copied_pub = pub_failed.copyTo(
230 ... hoary, PackagePublishingPocket.RELEASE, warty.main_archive)230 ... hoary, PackagePublishingPocket.RELEASE, warty.main_archive)
231231
232 >>> from lp.soyuz.interfaces.build import BuildStatus232 >>> from lp.soyuz.interfaces.build import BuildStatus, IBuildSet
233 >>> failed_build = pub_failed.sourcepackagerelease.createBuild(233 >>> failed_build = pub_failed.sourcepackagerelease.createBuild(
234 ... warty['i386'], PackagePublishingPocket.RELEASE,234 ... warty['i386'], PackagePublishingPocket.RELEASE,
235 ... warty.main_archive, status=BuildStatus.FAILEDTOBUILD)235 ... warty.main_archive, status=BuildStatus.FAILEDTOBUILD)
@@ -343,7 +343,8 @@
343happen in parallel with build creation.343happen in parallel with build creation.
344344
345 >>> build_queue = active_jobs[0]345 >>> build_queue = active_jobs[0]
346 >>> print build_queue.build.title346 >>> build = getUtility(IBuildSet).getByQueueEntry(build_queue)
347 >>> print build.title
347 i386 build of test-buildd 667 in ubuntu hoary RELEASE348 i386 build of test-buildd 667 in ubuntu hoary RELEASE
348 >>> build_queue.lastscore349 >>> build_queue.lastscore
349 2505350 2505
@@ -351,15 +352,15 @@
351Check the published component name retriever, they might be different,352Check the published component name retriever, they might be different,
352i.e., the published component can be different than the original component.353i.e., the published component can be different than the original component.
353354
354 >>> print build_queue.build.current_component.name355 >>> print build.current_component.name
355 main356 main
356 >>> print build_queue.build.sourcepackagerelease.component.name357 >>> print build.sourcepackagerelease.component.name
357 main358 main
358359
359Missing BuildQueue records, resulting from given-back builds, are360Missing BuildQueue records, resulting from given-back builds, are
360created in the last stage of the queue-builder script.361created in the last stage of the queue-builder script.
361362
362 >>> given_back_build = build_queue.build363 >>> given_back_build = getUtility(IBuildSet).getByQueueEntry(build_queue)
363 >>> build_queue.destroySelf()364 >>> build_queue.destroySelf()
364 >>> flush_database_updates()365 >>> flush_database_updates()
365366
366367
=== modified file 'lib/lp/buildmaster/tests/test_manager.py'
--- lib/lp/buildmaster/tests/test_manager.py 2009-09-07 13:02:02 +0000
+++ lib/lp/buildmaster/tests/test_manager.py 2009-11-16 23:27:14 +0000
@@ -24,7 +24,7 @@
24from lp.buildmaster.tests.harness import BuilddManagerTestSetup24from lp.buildmaster.tests.harness import BuilddManagerTestSetup
25from canonical.launchpad.ftests import ANONYMOUS, login25from canonical.launchpad.ftests import ANONYMOUS, login
26from lp.soyuz.tests.soyuzbuilddhelpers import SaneBuildingSlave26from lp.soyuz.tests.soyuzbuilddhelpers import SaneBuildingSlave
27from lp.soyuz.interfaces.build import BuildStatus27from lp.soyuz.interfaces.build import BuildStatus, IBuildSet
28from lp.soyuz.interfaces.builder import IBuilderSet28from lp.soyuz.interfaces.builder import IBuilderSet
29from lp.soyuz.interfaces.buildqueue import IBuildQueueSet29from lp.soyuz.interfaces.buildqueue import IBuildQueueSet
30from lp.registry.interfaces.distribution import IDistributionSet30from lp.registry.interfaces.distribution import IDistributionSet
@@ -494,8 +494,9 @@
494494
495 self.assertTrue(job is not None)495 self.assertTrue(job is not None)
496 self.assertEqual(job.builder, builder)496 self.assertEqual(job.builder, builder)
497 self.assertTrue(job.buildstart is not None)497 self.assertTrue(job.date_started is not None)
498 self.assertEqual(job.build.buildstate, BuildStatus.BUILDING)498 build = getUtility(IBuildSet).getByQueueEntry(job)
499 self.assertEqual(build.buildstate, BuildStatus.BUILDING)
499 self.assertEqual(job.logtail, logtail)500 self.assertEqual(job.logtail, logtail)
500501
501 def _getManager(self):502 def _getManager(self):
@@ -617,8 +618,9 @@
617618
618 job = getUtility(IBuildQueueSet).get(job.id)619 job = getUtility(IBuildQueueSet).get(job.id)
619 self.assertTrue(job.builder is None)620 self.assertTrue(job.builder is None)
620 self.assertTrue(job.buildstart is None)621 self.assertTrue(job.date_started is None)
621 self.assertEqual(job.build.buildstate, BuildStatus.NEEDSBUILD)622 build = getUtility(IBuildSet).getByQueueEntry(job)
623 self.assertEqual(build.buildstate, BuildStatus.NEEDSBUILD)
622624
623 def testScanRescuesJobFromBrokenBuilder(self):625 def testScanRescuesJobFromBrokenBuilder(self):
624 # The job assigned to a broken builder is rescued.626 # The job assigned to a broken builder is rescued.
@@ -701,13 +703,14 @@
701 builder.builderok = True703 builder.builderok = True
702704
703 job = builder.currentjob705 job = builder.currentjob
706 build = getUtility(IBuildSet).getByQueueEntry(job)
704 self.assertEqual(707 self.assertEqual(
705 'i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE',708 'i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE',
706 job.build.title)709 build.title)
707710
708 self.assertEqual('BUILDING', job.build.buildstate.name)711 self.assertEqual('BUILDING', build.buildstate.name)
709 self.assertNotEqual(None, job.builder)712 self.assertNotEqual(None, job.builder)
710 self.assertNotEqual(None, job.buildstart)713 self.assertNotEqual(None, job.date_started)
711 self.assertNotEqual(None, job.logtail)714 self.assertNotEqual(None, job.logtail)
712715
713 transaction.commit()716 transaction.commit()
@@ -717,9 +720,10 @@
717 def assertJobIsClean(self, job_id):720 def assertJobIsClean(self, job_id):
718 """Re-fetch the `IBuildQueue` record and check if it's clean."""721 """Re-fetch the `IBuildQueue` record and check if it's clean."""
719 job = getUtility(IBuildQueueSet).get(job_id)722 job = getUtility(IBuildQueueSet).get(job_id)
720 self.assertEqual('NEEDSBUILD', job.build.buildstate.name)723 build = getUtility(IBuildSet).getByQueueEntry(job)
724 self.assertEqual('NEEDSBUILD', build.buildstate.name)
721 self.assertEqual(None, job.builder)725 self.assertEqual(None, job.builder)
722 self.assertEqual(None, job.buildstart)726 self.assertEqual(None, job.date_started)
723 self.assertEqual(None, job.logtail)727 self.assertEqual(None, job.logtail)
724728
725 def testResetDispatchResult(self):729 def testResetDispatchResult(self):
726730
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2009-11-07 16:14:22 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2009-11-16 23:27:14 +0000
@@ -851,6 +851,12 @@
851 :return: A string.851 :return: A string.
852 """852 """
853853
854 def isSourcePackageFormatPermitted(format):
855 """Check if the specified source format is allowed in this series.
856
857 :param format: The SourcePackageFormat to check.
858 """
859
854860
855class IDistroSeries(IDistroSeriesEditRestricted, IDistroSeriesPublic,861class IDistroSeries(IDistroSeriesEditRestricted, IDistroSeriesPublic,
856 IStructuralSubscriptionTarget):862 IStructuralSubscriptionTarget):
857863
=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
--- lib/lp/registry/interfaces/sourcepackage.py 2009-11-15 23:23:12 +0000
+++ lib/lp/registry/interfaces/sourcepackage.py 2009-11-16 23:27:14 +0000
@@ -284,7 +284,7 @@
284 which in turn lists the orig.tar.gz and diff.tar.gz files used to284 which in turn lists the orig.tar.gz and diff.tar.gz files used to
285 make up the package. """)285 make up the package. """)
286286
287 ORIG = DBItem(4, """287 ORIG_TARBALL = DBItem(4, """
288 Orig Tarball288 Orig Tarball
289289
290 This file is an Ubuntu "orig" file, typically an upstream tarball or290 This file is an Ubuntu "orig" file, typically an upstream tarball or
@@ -298,8 +298,8 @@
298 diff creates additional directories with patches and documentation298 diff creates additional directories with patches and documentation
299 used to build the binary packages for Ubuntu. """)299 used to build the binary packages for Ubuntu. """)
300300
301 TARBALL = DBItem(6, """301 NATIVE_TARBALL = DBItem(6, """
302 Tarball302 Native Tarball
303303
304 This is a tarball, usually of a mixture of Ubuntu and upstream code,304 This is a tarball, usually of a mixture of Ubuntu and upstream code,
305 used in the build process for this source package. """)305 used in the build process for this source package. """)
306306
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2009-11-07 16:14:22 +0000
+++ lib/lp/registry/model/distroseries.py 2009-11-16 23:27:14 +0000
@@ -118,6 +118,8 @@
118from canonical.launchpad.webapp.interfaces import (118from canonical.launchpad.webapp.interfaces import (
119 IStoreSelector, MAIN_STORE, NotFoundError, SLAVE_FLAVOR,119 IStoreSelector, MAIN_STORE, NotFoundError, SLAVE_FLAVOR,
120 TranslationUnavailable)120 TranslationUnavailable)
121from lp.soyuz.interfaces.sourcepackageformat import (
122 ISourcePackageFormatSelectionSet)
121123
122124
123class SeriesMixin:125class SeriesMixin:
@@ -1496,7 +1498,7 @@
1496 cur = cursor()1498 cur = cursor()
14971499
1498 # Perform the copies1500 # Perform the copies
1499 self._copy_component_and_section_selections(cur)1501 self._copy_component_section_and_format_selections(cur)
15001502
1501 # Prepare the list of distroarchseries for which binary packages1503 # Prepare the list of distroarchseries for which binary packages
1502 # shall be copied.1504 # shall be copied.
@@ -1557,9 +1559,9 @@
1557 PackagePublishingPocket.RELEASE)1559 PackagePublishingPocket.RELEASE)
1558 clone_packages(origin, destination, distroarchseries_list)1560 clone_packages(origin, destination, distroarchseries_list)
15591561
1560 def _copy_component_and_section_selections(self, cur):1562 def _copy_component_section_and_format_selections(self, cur):
1561 """Copy the section and component selections from the parent distro1563 """Copy the section, component and format selections from the parent
1562 series into this one.1564 distro series into this one.
1563 """1565 """
1564 # Copy the component selections1566 # Copy the component selections
1565 cur.execute('''1567 cur.execute('''
@@ -1573,6 +1575,13 @@
1573 SELECT %s as distroseries, ss.section AS section1575 SELECT %s as distroseries, ss.section AS section
1574 FROM SectionSelection AS ss WHERE ss.distroseries = %s1576 FROM SectionSelection AS ss WHERE ss.distroseries = %s
1575 ''' % sqlvalues(self.id, self.parent_series.id))1577 ''' % sqlvalues(self.id, self.parent_series.id))
1578 # Copy the source format selections
1579 cur.execute('''
1580 INSERT INTO SourcePackageFormatSelection (distroseries, format)
1581 SELECT %s as distroseries, spfs.format AS format
1582 FROM SourcePackageFormatSelection AS spfs
1583 WHERE spfs.distroseries = %s
1584 ''' % sqlvalues(self.id, self.parent_series.id))
15761585
1577 def copyTranslationsFromParent(self, transaction, logger=None):1586 def copyTranslationsFromParent(self, transaction, logger=None):
1578 """See `IDistroSeries`."""1587 """See `IDistroSeries`."""
@@ -1739,6 +1748,10 @@
1739 else:1748 else:
1740 return '%s%s' % (self.name, pocketsuffix[pocket])1749 return '%s%s' % (self.name, pocketsuffix[pocket])
17411750
1751 def isSourcePackageFormatPermitted(self, format):
1752 return getUtility(ISourcePackageFormatSelectionSet
1753 ).getBySeriesAndFormat(self, format) is not None
1754
17421755
1743class DistroSeriesSet:1756class DistroSeriesSet:
1744 implements(IDistroSeriesSet)1757 implements(IDistroSeriesSet)
17451758
=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py 2009-11-15 23:23:12 +0000
+++ lib/lp/registry/model/sourcepackage.py 2009-11-16 23:27:14 +0000
@@ -554,8 +554,10 @@
554 # It should present the builds in a more natural order.554 # It should present the builds in a more natural order.
555 if build_state in [BuildStatus.NEEDSBUILD, BuildStatus.BUILDING]:555 if build_state in [BuildStatus.NEEDSBUILD, BuildStatus.BUILDING]:
556 orderBy = ["-BuildQueue.lastscore"]556 orderBy = ["-BuildQueue.lastscore"]
557 clauseTables.append('BuildPackageJob')
558 condition_clauses.append('BuildPackageJob.build = Build.id')
557 clauseTables.append('BuildQueue')559 clauseTables.append('BuildQueue')
558 condition_clauses.append('BuildQueue.build = Build.id')560 condition_clauses.append('BuildQueue.job = BuildPackageJob.job')
559 elif build_state == BuildStatus.SUPERSEDED or build_state is None:561 elif build_state == BuildStatus.SUPERSEDED or build_state is None:
560 orderBy = ["-Build.datecreated"]562 orderBy = ["-Build.datecreated"]
561 else:563 else:
562564
=== modified file 'lib/lp/services/job/tests/test_job.py'
--- lib/lp/services/job/tests/test_job.py 2009-07-17 00:26:05 +0000
+++ lib/lp/services/job/tests/test_job.py 2009-11-16 23:27:14 +0000
@@ -8,6 +8,8 @@
8from unittest import TestLoader8from unittest import TestLoader
99
10import pytz10import pytz
11from zope.component import getUtility
12
11from canonical.database.constants import UTC_NOW13from canonical.database.constants import UTC_NOW
12from canonical.testing import LaunchpadZopelessLayer14from canonical.testing import LaunchpadZopelessLayer
13from storm.locals import Store15from storm.locals import Store
@@ -17,6 +19,8 @@
17from lp.services.job.interfaces.job import IJob, JobStatus19from lp.services.job.interfaces.job import IJob, JobStatus
18from lp.testing import TestCase20from lp.testing import TestCase
19from canonical.launchpad.webapp.testing import verifyObject21from canonical.launchpad.webapp.testing import verifyObject
22from canonical.launchpad.webapp.interfaces import (
23 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
2024
2125
22class TestJob(TestCase):26class TestJob(TestCase):
@@ -155,40 +159,53 @@
155159
156 layer = LaunchpadZopelessLayer160 layer = LaunchpadZopelessLayer
157161
162 def _sampleData(self):
163 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
164 return list(store.execute(Job.ready_jobs))
165
158 def test_ready_jobs(self):166 def test_ready_jobs(self):
159 """Job.ready_jobs should include new jobs."""167 """Job.ready_jobs should include new jobs."""
168 preexisting = self._sampleData()
160 job = Job()169 job = Job()
161 self.assertEqual(170 self.assertEqual(
162 [(job.id,)], list(Store.of(job).execute(Job.ready_jobs)))171 preexisting + [(job.id,)],
172 list(Store.of(job).execute(Job.ready_jobs)))
163173
164 def test_ready_jobs_started(self):174 def test_ready_jobs_started(self):
165 """Job.ready_jobs should not jobs that have been started."""175 """Job.ready_jobs should not jobs that have been started."""
176 preexisting = self._sampleData()
166 job = Job(_status=JobStatus.RUNNING)177 job = Job(_status=JobStatus.RUNNING)
167 self.assertEqual(178 self.assertEqual(
168 [], list(Store.of(job).execute(Job.ready_jobs)))179 preexisting, list(Store.of(job).execute(Job.ready_jobs)))
169180
170 def test_ready_jobs_lease_expired(self):181 def test_ready_jobs_lease_expired(self):
171 """Job.ready_jobs should include jobs with expired leases."""182 """Job.ready_jobs should include jobs with expired leases."""
183 preexisting = self._sampleData()
172 UNIX_EPOCH = datetime.fromtimestamp(0, pytz.timezone('UTC'))184 UNIX_EPOCH = datetime.fromtimestamp(0, pytz.timezone('UTC'))
173 job = Job(lease_expires=UNIX_EPOCH)185 job = Job(lease_expires=UNIX_EPOCH)
174 self.assertEqual(186 self.assertEqual(
175 [(job.id,)], list(Store.of(job).execute(Job.ready_jobs)))187 preexisting + [(job.id,)],
188 list(Store.of(job).execute(Job.ready_jobs)))
176189
177 def test_ready_jobs_lease_in_future(self):190 def test_ready_jobs_lease_in_future(self):
178 """Job.ready_jobs should not include jobs with active leases."""191 """Job.ready_jobs should not include jobs with active leases."""
192 preexisting = self._sampleData()
179 future = datetime.fromtimestamp(193 future = datetime.fromtimestamp(
180 time.time() + 1000, pytz.timezone('UTC'))194 time.time() + 1000, pytz.timezone('UTC'))
181 job = Job(lease_expires=future)195 job = Job(lease_expires=future)
182 self.assertEqual([], list(Store.of(job).execute(Job.ready_jobs)))196 self.assertEqual(
197 preexisting, list(Store.of(job).execute(Job.ready_jobs)))
183198
184 def test_ready_jobs_not_jobs_scheduled_in_future(self):199 def test_ready_jobs_not_jobs_scheduled_in_future(self):
185 """Job.ready_jobs does not included jobs scheduled for a time in the200 """Job.ready_jobs does not included jobs scheduled for a time in the
186 future.201 future.
187 """202 """
203 preexisting = self._sampleData()
188 future = datetime.fromtimestamp(204 future = datetime.fromtimestamp(
189 time.time() + 1000, pytz.timezone('UTC'))205 time.time() + 1000, pytz.timezone('UTC'))
190 job = Job(scheduled_start=future)206 job = Job(scheduled_start=future)
191 self.assertEqual([], list(Store.of(job).execute(Job.ready_jobs)))207 self.assertEqual(
208 preexisting, list(Store.of(job).execute(Job.ready_jobs)))
192209
193 def test_acquireLease(self):210 def test_acquireLease(self):
194 """Job.acquireLease should set job.lease_expires."""211 """Job.acquireLease should set job.lease_expires."""
195212
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2009-10-26 18:40:04 +0000
+++ lib/lp/soyuz/browser/build.py 2009-11-16 23:27:14 +0000
@@ -288,10 +288,10 @@
288 prefetched_data = dict()288 prefetched_data = dict()
289 build_ids = [build.id for build in builds]289 build_ids = [build.id for build in builds]
290 results = getUtility(IBuildQueueSet).getForBuilds(build_ids)290 results = getUtility(IBuildQueueSet).getForBuilds(build_ids)
291 for (buildqueue, builder) in results:291 for (buildqueue, _builder, build_job) in results:
292 # Get the build's id, 'buildqueue', 'sourcepackagerelease' and292 # Get the build's id, 'buildqueue', 'sourcepackagerelease' and
293 # 'buildlog' (from the result set) respectively.293 # 'buildlog' (from the result set) respectively.
294 prefetched_data[buildqueue.build.id] = buildqueue294 prefetched_data[build_job.build.id] = buildqueue
295295
296 complete_builds = []296 complete_builds = []
297 for build in builds:297 for build in builds:
298298
=== modified file 'lib/lp/soyuz/browser/builder.py'
--- lib/lp/soyuz/browser/builder.py 2009-09-17 14:45:15 +0000
+++ lib/lp/soyuz/browser/builder.py 2009-11-16 23:27:14 +0000
@@ -237,12 +237,12 @@
237 def current_build_duration(self):237 def current_build_duration(self):
238 """Return the delta representing the duration of the current job."""238 """Return the delta representing the duration of the current job."""
239 if (self.context.currentjob is None or239 if (self.context.currentjob is None or
240 self.context.currentjob.buildstart is None):240 self.context.currentjob.date_started is None):
241 return None241 return None
242 else:242 else:
243 UTC = pytz.timezone('UTC')243 UTC = pytz.timezone('UTC')
244 buildstart = self.context.currentjob.buildstart244 date_started = self.context.currentjob.date_started
245 return datetime.datetime.now(UTC) - buildstart245 return datetime.datetime.now(UTC) - date_started
246246
247 @property247 @property
248 def page_title(self):248 def page_title(self):
249249
=== modified file 'lib/lp/soyuz/browser/tests/builder-views.txt'
--- lib/lp/soyuz/browser/tests/builder-views.txt 2009-09-16 19:06:48 +0000
+++ lib/lp/soyuz/browser/tests/builder-views.txt 2009-11-16 23:27:14 +0000
@@ -1,7 +1,7 @@
1= Builder View Classes and Pages =1= Builder View Classes and Pages =
22
3 >>> from zope.component import getMultiAdapter, getUtility3 >>> from zope.component import getMultiAdapter, getUtility
4 >>> from canonical.launchpad.interfaces import IBuilderSet4 >>> from canonical.launchpad.interfaces import IBuildSet, IBuilderSet
5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
66
7 >>> builder = getUtility(IBuilderSet).get(1)7 >>> builder = getUtility(IBuilderSet).get(1)
@@ -158,7 +158,8 @@
158 >>> frog = getUtility(IBuilderSet)['frog']158 >>> frog = getUtility(IBuilderSet)['frog']
159 >>> frog.builderok = True159 >>> frog.builderok = True
160 >>> private_build.builder = frog160 >>> private_build.builder = frog
161 >>> private_job = BuildQueue(build=private_build, builder=frog)161 >>> private_job = private_build.createBuildQueueEntry()
162 >>> private_job.builder = frog
162 >>> private_job_id = private_job.id163 >>> private_job_id = private_job.id
163164
164 >>> from canonical.database.sqlbase import flush_database_caches165 >>> from canonical.database.sqlbase import flush_database_caches
@@ -175,7 +176,9 @@
175 >>> print frog.builderok176 >>> print frog.builderok
176 True177 True
177178
178 >>> print frog.currentjob.build.title179 >>> build_set = getUtility(IBuildSet)
180 >>> build = build_set.getByQueueEntry(frog.currentjob)
181 >>> print build.title
179 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE182 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE
180183
181 >>> print frog.failnotes184 >>> print frog.failnotes
@@ -199,7 +202,8 @@
199 >>> print admin_view.context.builderok202 >>> print admin_view.context.builderok
200 True203 True
201204
202 >>> print admin_view.context.currentjob.build.title205 >>> build = build_set.getByQueueEntry(admin_view.context.currentjob)
206 >>> print build.title
203 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE207 i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE
204208
205 >>> print admin_view.context.failnotes209 >>> print admin_view.context.failnotes
@@ -211,7 +215,7 @@
211215
212 >>> import datetime216 >>> import datetime
213 >>> import pytz217 >>> import pytz
214 >>> private_job.buildstart = (218 >>> private_job.setDateStarted(
215 ... datetime.datetime.now(pytz.UTC) - datetime.timedelta(10))219 ... datetime.datetime.now(pytz.UTC) - datetime.timedelta(10))
216 >>> print admin_view.current_build_duration220 >>> print admin_view.current_build_duration
217 10 days...221 10 days...
218222
=== modified file 'lib/lp/soyuz/configure.zcml'
--- lib/lp/soyuz/configure.zcml 2009-11-09 17:59:18 +0000
+++ lib/lp/soyuz/configure.zcml 2009-11-16 23:27:14 +0000
@@ -560,7 +560,7 @@
560560
561 <require561 <require
562 permission="zope.Public"562 permission="zope.Public"
563 set_attributes="lastscore builder buildstart logtail"/>563 set_attributes="lastscore builder logtail date_started"/>
564 </class>564 </class>
565565
566 <!-- BuildQueueSet -->566 <!-- BuildQueueSet -->
@@ -791,6 +791,28 @@
791 interface="lp.soyuz.interfaces.section.ISectionSet"/>791 interface="lp.soyuz.interfaces.section.ISectionSet"/>
792 </securedutility>792 </securedutility>
793793
794 <!-- SourcePackageFormatSelection -->
795
796 <class
797 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelection">
798 <allow
799 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelection"/>
800 </class>
801
802 <!-- SourcePackageFormatSelectionSet -->
803
804 <class
805 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelectionSet">
806 <allow
807 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet"/>
808 </class>
809 <securedutility
810 class="lp.soyuz.model.sourcepackageformat.SourcePackageFormatSelectionSet"
811 provides="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet">
812 <allow
813 interface="lp.soyuz.interfaces.sourcepackageformat.ISourcePackageFormatSelectionSet"/>
814 </securedutility>
815
794 <!-- SourcePackageReleaseFile -->816 <!-- SourcePackageReleaseFile -->
795817
796 <class818 <class
@@ -863,5 +885,11 @@
863 interface="lp.soyuz.interfaces.packagesetgroup.IPackagesetGroup"/>885 interface="lp.soyuz.interfaces.packagesetgroup.IPackagesetGroup"/>
864 </class>886 </class>
865887
888 <!-- BuildPackageJob -->
889 <class
890 class="lp.soyuz.model.buildpackagejob.BuildPackageJob">
891 <allow
892 interface="lp.soyuz.interfaces.buildpackagejob.IBuildPackageJob"/>
893 </class>
866894
867</configure>895</configure>
868896
=== modified file 'lib/lp/soyuz/doc/archive.txt'
--- lib/lp/soyuz/doc/archive.txt 2009-11-09 13:01:13 +0000
+++ lib/lp/soyuz/doc/archive.txt 2009-11-16 23:27:14 +0000
@@ -850,7 +850,7 @@
850850
851 >>> print_published_files(cprov_archive)851 >>> print_published_files(cprov_archive)
852 cdrkit - 1.0: foobar-1.0.dsc (DSC, 716 bytes)852 cdrkit - 1.0: foobar-1.0.dsc (DSC, 716 bytes)
853 iceweasel - 1.0: firefox_0.9.2.orig.tar.gz (ORIG, 9922560 bytes)853 iceweasel - 1.0: firefox_0.9.2.orig.tar.gz (ORIG_TARBALL, 9922560 bytes)
854 iceweasel - 1.0: iceweasel-1.0.dsc (DSC, 123 bytes)854 iceweasel - 1.0: iceweasel-1.0.dsc (DSC, 123 bytes)
855855
856Now we will emulate a duplicated reference to the same 'orig.tar.gz',856Now we will emulate a duplicated reference to the same 'orig.tar.gz',
@@ -867,9 +867,9 @@
867'firefox_0.9.2.orig.tar.gz' file.867'firefox_0.9.2.orig.tar.gz' file.
868868
869 >>> print_published_files(cprov_archive)869 >>> print_published_files(cprov_archive)
870 cdrkit - 1.0: firefox_0.9.2.orig.tar.gz (ORIG, 9922560 bytes)870 cdrkit - 1.0: firefox_0.9.2.orig.tar.gz (ORIG_TARBALL, 9922560 bytes)
871 cdrkit - 1.0: foobar-1.0.dsc (DSC, 716 bytes)871 cdrkit - 1.0: foobar-1.0.dsc (DSC, 716 bytes)
872 iceweasel - 1.0: firefox_0.9.2.orig.tar.gz (ORIG, 9922560 bytes)872 iceweasel - 1.0: firefox_0.9.2.orig.tar.gz (ORIG_TARBALL, 9922560 bytes)
873 iceweasel - 1.0: iceweasel-1.0.dsc (DSC, 123 bytes)873 iceweasel - 1.0: iceweasel-1.0.dsc (DSC, 123 bytes)
874874
875Similarly to what happen in the archive disk 'pool', where already875Similarly to what happen in the archive disk 'pool', where already
876876
=== modified file 'lib/lp/soyuz/doc/build-estimated-dispatch-time.txt'
--- lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2009-08-28 07:34:44 +0000
+++ lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2009-11-16 23:27:14 +0000
@@ -59,7 +59,8 @@
59 >>> UTC = pytz.timezone('UTC')59 >>> UTC = pytz.timezone('UTC')
60 >>> bob_the_builder = builder_set.get(1)60 >>> bob_the_builder = builder_set.get(1)
61 >>> cur_bqueue = bob_the_builder.currentjob61 >>> cur_bqueue = bob_the_builder.currentjob
62 >>> cur_build = cur_bqueue.build62 >>> from lp.soyuz.interfaces.build import IBuildSet
63 >>> cur_build = getUtility(IBuildSet).getByQueueEntry(cur_bqueue)
6364
64Make sure the job at hand is currently being built.65Make sure the job at hand is currently being built.
6566
@@ -73,16 +74,16 @@
73of job N in the build queue. These values will now be set for the job74of job N in the build queue. These values will now be set for the job
74that is currently building.75that is currently building.
7576
77 >>> from zope.security.proxy import removeSecurityProxy
76 >>> cur_bqueue.lastscore = 111178 >>> cur_bqueue.lastscore = 1111
77 >>> cur_bqueue.buildstart = datetime(2008, 4, 1, 10, 45, 39,79 >>> cur_bqueue.setDateStarted(
78 ... tzinfo=UTC)80 ... datetime(2008, 4, 1, 10, 45, 39, tzinfo=UTC))
79 >>> print cur_bqueue.buildstart81 >>> print cur_bqueue.date_started
80 2008-04-01 10:45:39+00:0082 2008-04-01 10:45:39+00:00
8183
82Please note that the "estimated build duration" is an internal property84Please note that the "estimated build duration" is an internal property
83and not meant to be viewed or modified by an end user.85and not meant to be viewed or modified by an end user.
8486
85 >>> from zope.security.proxy import removeSecurityProxy
86 >>> naked_build = removeSecurityProxy(cur_build)87 >>> naked_build = removeSecurityProxy(cur_build)
87 >>> naked_build.estimated_build_duration = timedelta(minutes=56)88 >>> naked_build.estimated_build_duration = timedelta(minutes=56)
8889
8990
=== modified file 'lib/lp/soyuz/doc/buildd-dispatching.txt'
--- lib/lp/soyuz/doc/buildd-dispatching.txt 2009-10-14 08:20:40 +0000
+++ lib/lp/soyuz/doc/buildd-dispatching.txt 2009-11-16 23:27:14 +0000
@@ -134,18 +134,20 @@
134134
135 >>> job.id135 >>> job.id
136 2136 2
137 >>> job.build.buildstate.name137 >>> from lp.soyuz.interfaces.build import IBuildSet
138 >>> build = getUtility(IBuildSet).getByQueueEntry(job)
139 >>> build.buildstate.name
138 'NEEDSBUILD'140 'NEEDSBUILD'
139 >>> job.builder is None141 >>> job.builder is None
140 True142 True
141 >>> job.buildstart is None143 >>> job.date_started is None
142 True144 True
143 >>> job.is_virtualized145 >>> build.is_virtualized
144 False146 False
145147
146The build start time is not set yet either.148The build start time is not set yet either.
147149
148 >>> print job.build.date_first_dispatched150 >>> print build.date_first_dispatched
149 None151 None
150152
151Update the SourcePackageReleaseFile corresponding to this job:153Update the SourcePackageReleaseFile corresponding to this job:
@@ -154,7 +156,7 @@
154 >>> alias_id = librarian_client.addFile(156 >>> alias_id = librarian_client.addFile(
155 ... 'foo.dsc', len(content), StringIO(content), 'application/dsc')157 ... 'foo.dsc', len(content), StringIO(content), 'application/dsc')
156158
157 >>> sprf = job.build.sourcepackagerelease.files[0]159 >>> sprf = build.sourcepackagerelease.files[0]
158 >>> from zope.security.proxy import removeSecurityProxy160 >>> from zope.security.proxy import removeSecurityProxy
159 >>> naked_sprf = removeSecurityProxy(sprf)161 >>> naked_sprf = removeSecurityProxy(sprf)
160 >>> naked_sprf.libraryfile = getUtility(ILibraryFileAliasSet)[alias_id]162 >>> naked_sprf.libraryfile = getUtility(ILibraryFileAliasSet)[alias_id]
@@ -167,35 +169,20 @@
167169
168Verify if the job (BuildQueue) was updated appropriately:170Verify if the job (BuildQueue) was updated appropriately:
169171
170 >>> def checkTimes(expected, actual):
171 ... if expected != actual:
172 ... return "expected: %s, actual: %s" % (expected, actual)
173 ... else:
174 ... return "OK"
175
176 >>> job.builder.id == bob_builder.id172 >>> job.builder.id == bob_builder.id
177 True173 True
178174
179 >>> job.build.buildstate.name175 >>> build = getUtility(IBuildSet).getByQueueEntry(job)
176 >>> build.buildstate.name
180 'BUILDING'177 'BUILDING'
181178
182 >>> from canonical.database.sqlbase import get_transaction_timestamp
183 >>> checkTimes(get_transaction_timestamp(), job.buildstart)
184 'OK'
185
186The build start time will be set to the same value.
187
188 >>> checkTimes(get_transaction_timestamp(),
189 ... job.build.date_first_dispatched)
190 'OK'
191
192Shutdown builder, mark the build record as failed and remove the179Shutdown builder, mark the build record as failed and remove the
193buildqueue record, so the build was eliminated:180buildqueue record, so the build was eliminated:
194181
195 >>> BuilddSlaveTestSetup().tearDown()182 >>> BuilddSlaveTestSetup().tearDown()
196183
197 >>> from lp.soyuz.interfaces.build import BuildStatus184 >>> from lp.soyuz.interfaces.build import BuildStatus
198 >>> job.build.buildstate = BuildStatus.FAILEDTOBUILD185 >>> build.buildstate = BuildStatus.FAILEDTOBUILD
199 >>> job.destroySelf()186 >>> job.destroySelf()
200 >>> flush_database_updates()187 >>> flush_database_updates()
201188
@@ -217,12 +204,13 @@
217 3204 3
218 >>> ppa_job.builder == None205 >>> ppa_job.builder == None
219 True206 True
220 >>> ppa_job.buildstart == None207 >>> ppa_job.date_started == None
221 True208 True
222209
223The build job's archive requires virtualized builds.210The build job's archive requires virtualized builds.
224211
225 >>> ppa_job.build.archive.require_virtualized212 >>> build = getUtility(IBuildSet).getByQueueEntry(ppa_job)
213 >>> build.archive.require_virtualized
226 True214 True
227215
228But the builder is not virtualized.216But the builder is not virtualized.
@@ -249,10 +237,10 @@
249 >>> from lp.soyuz.model.publishing import (237 >>> from lp.soyuz.model.publishing import (
250 ... SourcePackagePublishingHistory)238 ... SourcePackagePublishingHistory)
251 >>> [old_pub] = SourcePackagePublishingHistory.selectBy(239 >>> [old_pub] = SourcePackagePublishingHistory.selectBy(
252 ... distroseries=ppa_job.build.distroseries,240 ... distroseries=build.distroseries,
253 ... sourcepackagerelease=ppa_job.build.sourcepackagerelease)241 ... sourcepackagerelease=build.sourcepackagerelease)
254 >>> new_pub = old_pub.copyTo(242 >>> new_pub = old_pub.copyTo(
255 ... old_pub.distroseries, old_pub.pocket, ppa_job.build.archive)243 ... old_pub.distroseries, old_pub.pocket, build.archive)
256244
257 >>> bob_builder.virtualized = True245 >>> bob_builder.virtualized = True
258 >>> syncUpdate(bob_builder)246 >>> syncUpdate(bob_builder)
@@ -293,19 +281,16 @@
293 >>> ppa_job.builder.name281 >>> ppa_job.builder.name
294 u'bob'282 u'bob'
295283
296 >>> ppa_job.build.buildstate.name284 >>> build.buildstate.name
297 'BUILDING'285 'BUILDING'
298286
299 >>> ppa_job.buildstart == get_transaction_timestamp()
300 True
301
302Shutdown builder slave, mark the ppa build record as failed, remove the287Shutdown builder slave, mark the ppa build record as failed, remove the
303buildqueue record and make 'bob' builder non-virtual again, so the288buildqueue record and make 'bob' builder non-virtual again, so the
304environment is back to the initial state.289environment is back to the initial state.
305290
306 >>> BuilddSlaveTestSetup().tearDown()291 >>> BuilddSlaveTestSetup().tearDown()
307292
308 >>> ppa_job.build.buildstate = BuildStatus.FAILEDTOBUILD293 >>> build.buildstate = BuildStatus.FAILEDTOBUILD
309 >>> ppa_job.destroySelf()294 >>> ppa_job.destroySelf()
310 >>> bob_builder.virtualized = False295 >>> bob_builder.virtualized = False
311 >>> flush_database_updates()296 >>> flush_database_updates()
@@ -332,9 +317,9 @@
332 4317 4
333 >>> print sec_job.builder318 >>> print sec_job.builder
334 None319 None
335 >>> print sec_job.buildstart320 >>> print sec_job.date_started
336 None321 None
337 >>> sec_job.is_virtualized322 >>> sec_build.is_virtualized
338 False323 False
339324
340In normal conditions the next available candidate would be the job325In normal conditions the next available candidate would be the job
341326
=== modified file 'lib/lp/soyuz/doc/buildd-scoring.txt'
--- lib/lp/soyuz/doc/buildd-scoring.txt 2009-08-30 23:57:41 +0000
+++ lib/lp/soyuz/doc/buildd-scoring.txt 2009-11-16 23:27:14 +0000
@@ -49,7 +49,7 @@
49 >>> def setUpBuildQueueEntry(49 >>> def setUpBuildQueueEntry(
50 ... component_name='main', urgency=SourcePackageUrgency.HIGH,50 ... component_name='main', urgency=SourcePackageUrgency.HIGH,
51 ... pocket=PackagePublishingPocket.RELEASE,51 ... pocket=PackagePublishingPocket.RELEASE,
52 ... date_created=LOCAL_NOW, manual=False):52 ... date_created=LOCAL_NOW, manual=False, archive=None):
53 ... global version53 ... global version
54 ... commit()54 ... commit()
55 ... LaunchpadZopelessLayer.switchDbUser('launchpad')55 ... LaunchpadZopelessLayer.switchDbUser('launchpad')
@@ -57,7 +57,7 @@
57 ... sourcename='test-build', version=str(version),57 ... sourcename='test-build', version=str(version),
58 ... distroseries=hoary, component=component_name,58 ... distroseries=hoary, component=component_name,
59 ... urgency=urgency, pocket=pocket,59 ... urgency=urgency, pocket=pocket,
60 ... status=PackagePublishingStatus.PUBLISHED)60 ... status=PackagePublishingStatus.PUBLISHED, archive=archive)
61 ... commit()61 ... commit()
62 ... LaunchpadZopelessLayer.switchDbUser(test_dbuser)62 ... LaunchpadZopelessLayer.switchDbUser(test_dbuser)
63 ... version += 163 ... version += 1
@@ -65,7 +65,7 @@
65 ... hoary386, pub.pocket, pub.archive)65 ... hoary386, pub.pocket, pub.archive)
66 ...66 ...
67 ... build_queue = build.createBuildQueueEntry()67 ... build_queue = build.createBuildQueueEntry()
68 ... build_queue.created = date_created68 ... build_queue.job.date_created = date_created
69 ... build_queue.manual = manual69 ... build_queue.manual = manual
70 ...70 ...
71 ... return build_queue71 ... return build_queue
@@ -86,8 +86,10 @@
8686
87 >>> commit()87 >>> commit()
88 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')88 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
89 >>> bq0.build.archive.buildd_secret = "secret"89 >>> from lp.soyuz.interfaces.build import IBuildSet
90 >>> bq0.build.archive.private = True90 >>> build = getUtility(IBuildSet).getByQueueEntry(bq0)
91 >>> build.archive.buildd_secret = "secret"
92 >>> build.archive.private = True
91 >>> bq0.score()93 >>> bq0.score()
92 >>> bq0.lastscore94 >>> bq0.lastscore
93 1251595 12515
@@ -96,19 +98,19 @@
96IArchive.relative_build_score to boost by 100 changes the lastscore value98IArchive.relative_build_score to boost by 100 changes the lastscore value
97appropriately.99appropriately.
98100
99 >>> bq0.build.archive.relative_build_score = 100101 >>> build.archive.relative_build_score = 100
100 >>> bq0.score()102 >>> bq0.score()
101 >>> bq0.lastscore103 >>> bq0.lastscore
102 12615104 12615
103105
104The delta can also be negative.106The delta can also be negative.
105107
106 >>> bq0.build.archive.relative_build_score = -100108 >>> build.archive.relative_build_score = -100
107 >>> bq0.score()109 >>> bq0.score()
108 >>> bq0.lastscore110 >>> bq0.lastscore
109 12415111 12415
110112
111 >>> bq0.build.archive.relative_build_score = 0113 >>> build.archive.relative_build_score = 0
112 >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)114 >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)
113115
114116
@@ -250,9 +252,15 @@
250they all have a fixed score of -10. They will get built in the order252they all have a fixed score of -10. They will get built in the order
251they were created.253they were created.
252254
253 >>> from canonical.launchpad.interfaces import ArchivePurpose255 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
254 >>> bqc = setUpBuildQueueEntry()256 >>> from canonical.launchpad.interfaces import (
255 >>> bqc.build.archive.purpose = ArchivePurpose.COPY257 ... ArchivePurpose, IArchiveSet)
258 >>> copy = getUtility(IArchiveSet).new(
259 ... owner=ubuntu.owner, purpose=ArchivePurpose.COPY,
260 ... name='test-rebuild')
261
262 >>> bqc = setUpBuildQueueEntry(archive=copy)
263 >>> build = getUtility(IBuildSet).getByQueueEntry(bqc)
256 >>> bqc.score()264 >>> bqc.score()
257 >>> bqc.lastscore265 >>> bqc.lastscore
258 -10266 -10
259267
=== modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt'
--- lib/lp/soyuz/doc/buildd-slavescanner.txt 2009-11-05 10:51:36 +0000
+++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2009-11-16 23:27:14 +0000
@@ -188,10 +188,11 @@
188To make testing easier we provide a convenience function to put a BuildQueue188To make testing easier we provide a convenience function to put a BuildQueue
189object into a preset fixed state:189object into a preset fixed state:
190190
191 >>> from zope.security.proxy import removeSecurityProxy
191 >>> default_start = datetime.datetime(2005, 1, 1, 8, 0, 0, tzinfo=UTC)192 >>> default_start = datetime.datetime(2005, 1, 1, 8, 0, 0, tzinfo=UTC)
192 >>> def setupBuildQueue(build_queue, builder):193 >>> def setupBuildQueue(build_queue, builder):
193 ... build_queue.builder = builder194 ... build_queue.builder = builder
194 ... build_queue.buildstart = default_start195 ... build_queue.setDateStarted(default_start)
195196
196Remove any previous buildmaster ROOT directory, to avoid any garbage197Remove any previous buildmaster ROOT directory, to avoid any garbage
197lock conflict (it would be recreated automatically if necessary)198lock conflict (it would be recreated automatically if necessary)
@@ -216,7 +217,7 @@
216 >>> from canonical.launchpad.ftests import syncUpdate217 >>> from canonical.launchpad.ftests import syncUpdate
217 >>> if a_builder.currentjob is not None:218 >>> if a_builder.currentjob is not None:
218 ... currentjob = a_builder.currentjob219 ... currentjob = a_builder.currentjob
219 ... currentjob.buildstart = None220 ... currentjob.setDateStarted(None)
220 ... currentjob.builder = None221 ... currentjob.builder = None
221 ... syncUpdate(currentjob)222 ... syncUpdate(currentjob)
222223
@@ -236,17 +237,18 @@
236Do the test execution:237Do the test execution:
237238
238 >>> buildergroup.updateBuild(bqItem3)239 >>> buildergroup.updateBuild(bqItem3)
239 >>> bqItem3.build.builder is not None240 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3)
240 True241 >>> build.builder is not None
241 >>> bqItem3.build.datebuilt is not None242 True
242 True243 >>> build.datebuilt is not None
243 >>> bqItem3.build.buildduration is not None244 True
244 True245 >>> build.buildduration is not None
245 >>> bqItem3.build.buildlog is not None246 True
247 >>> build.buildlog is not None
246 True248 True
247 >>> check_mail_sent(last_stub_mail_count)249 >>> check_mail_sent(last_stub_mail_count)
248 True250 True
249 >>> bqItem3.build.buildstate.title251 >>> build.buildstate.title
250 'Failed to build'252 'Failed to build'
251253
252Cleanup in preparation for the next test:254Cleanup in preparation for the next test:
@@ -270,19 +272,20 @@
270272
271 >>> buildergroup.updateBuild(bqItem4)273 >>> buildergroup.updateBuild(bqItem4)
272 CRITICAL:root:***** bob is MANUALDEPWAIT *****274 CRITICAL:root:***** bob is MANUALDEPWAIT *****
273 >>> bqItem4.build.builder is not None275 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem4)
274 True276 >>> build.builder is not None
275 >>> bqItem4.build.datebuilt is not None277 True
276 True278 >>> build.datebuilt is not None
277 >>> bqItem4.build.buildduration is not None279 True
278 True280 >>> build.buildduration is not None
279 >>> bqItem4.build.buildlog is not None281 True
282 >>> build.buildlog is not None
280 True283 True
281 >>> check_mail_sent(last_stub_mail_count)284 >>> check_mail_sent(last_stub_mail_count)
282 False285 False
283 >>> bqItem4.build.dependencies286 >>> build.dependencies
284 u'baz (>= 1.0.1)'287 u'baz (>= 1.0.1)'
285 >>> bqItem4.build.buildstate.title288 >>> build.buildstate.title
286 'Dependency wait'289 'Dependency wait'
287290
288Cleanup in preparation for the next test:291Cleanup in preparation for the next test:
@@ -302,17 +305,18 @@
302 ... WaitingSlave('BuildStatus.CHROOTFAIL'))305 ... WaitingSlave('BuildStatus.CHROOTFAIL'))
303 >>> buildergroup.updateBuild(bqItem5)306 >>> buildergroup.updateBuild(bqItem5)
304 CRITICAL:root:***** bob is CHROOTWAIT *****307 CRITICAL:root:***** bob is CHROOTWAIT *****
305 >>> bqItem5.build.builder is not None308 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem5)
306 True309 >>> build.builder is not None
307 >>> bqItem5.build.datebuilt is not None310 True
308 True311 >>> build.datebuilt is not None
309 >>> bqItem5.build.buildduration is not None312 True
310 True313 >>> build.buildduration is not None
311 >>> bqItem5.build.buildlog is not None314 True
315 >>> build.buildlog is not None
312 True316 True
313 >>> check_mail_sent(last_stub_mail_count)317 >>> check_mail_sent(last_stub_mail_count)
314 True318 True
315 >>> bqItem5.build.buildstate.title319 >>> build.buildstate.title
316 'Chroot problem'320 'Chroot problem'
317321
318Cleanup in preparation for the next test:322Cleanup in preparation for the next test:
@@ -343,7 +347,8 @@
343 True347 True
344 >>> check_mail_sent(last_stub_mail_count)348 >>> check_mail_sent(last_stub_mail_count)
345 False349 False
346 >>> bqItem6.build.buildstate.title350 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem6)
351 >>> build.buildstate.title
347 'Needs building'352 'Needs building'
348353
349Cleanup in preparation for the next test:354Cleanup in preparation for the next test:
@@ -384,6 +389,8 @@
384 >>> setupBuildQueue(bqItem8, a_builder)389 >>> setupBuildQueue(bqItem8, a_builder)
385 >>> last_stub_mail_count = len(stub.test_emails)390 >>> last_stub_mail_count = len(stub.test_emails)
386391
392 >>> bqItem8.builder.setSlaveForTesting(BuildingSlave())
393 >>> buildergroup.updateBuild(bqItem8)
387 >>> bqItem8.builder.setSlaveForTesting(AbortedSlave())394 >>> bqItem8.builder.setSlaveForTesting(AbortedSlave())
388 >>> bqItem8.builder.name395 >>> bqItem8.builder.name
389 u'bob'396 u'bob'
@@ -445,17 +452,18 @@
445FAILEDTOUPLOAD:452FAILEDTOUPLOAD:
446453
447 >>> buildergroup.updateBuild(bqItem10)454 >>> buildergroup.updateBuild(bqItem10)
448 >>> bqItem10.build.builder is not None455 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10)
449 True456 >>> build.builder is not None
450 >>> bqItem10.build.datebuilt is not None457 True
451 True458 >>> build.datebuilt is not None
452 >>> bqItem10.build.buildduration is not None459 True
453 True460 >>> build.buildduration is not None
454 >>> bqItem10.build.buildlog is not None461 True
462 >>> build.buildlog is not None
455 True463 True
456 >>> check_mail_sent(last_stub_mail_count)464 >>> check_mail_sent(last_stub_mail_count)
457 True465 True
458 >>> bqItem10.build.buildstate.title466 >>> build.buildstate.title
459 'Failed to upload'467 'Failed to upload'
460468
461Let's check the emails generated by this 'failure'469Let's check the emails generated by this 'failure'
@@ -493,7 +501,7 @@
493output is both emailed in an immediate notification, and stored in the501output is both emailed in an immediate notification, and stored in the
494librarian for future reference.502librarian for future reference.
495503
496 >>> bqItem10.build.upload_log is not None504 >>> build.upload_log is not None
497 True505 True
498506
499What we can clearly notice is that the buildlog is still containing507What we can clearly notice is that the buildlog is still containing
@@ -514,16 +522,16 @@
514522
515 >>> bqItem10 = getUtility(IBuildSet).getByBuildID(523 >>> bqItem10 = getUtility(IBuildSet).getByBuildID(
516 ... 6).createBuildQueueEntry()524 ... 6).createBuildQueueEntry()
525 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10)
517526
518XXX: The pocket attribute is not intended to be changed in regular code, but527XXX: The pocket attribute is not intended to be changed in regular code, but
519for this test we want to change it on the fly. An alternative would be to add528for this test we want to change it on the fly. An alternative would be to add
520new sample data for a build that can be uploaded with binary packages attached529new sample data for a build that can be uploaded with binary packages attached
521to it.530to it.
522531
523 >>> from zope.security.proxy import removeSecurityProxy
524 >>> from lp.registry.interfaces.pocket import PackagePublishingPocket532 >>> from lp.registry.interfaces.pocket import PackagePublishingPocket
525 >>> removeSecurityProxy(533 >>> removeSecurityProxy(
526 ... bqItem10.build).pocket = PackagePublishingPocket.UPDATES534 ... build).pocket = PackagePublishingPocket.UPDATES
527 >>> setupBuildQueue(bqItem10, a_builder)535 >>> setupBuildQueue(bqItem10, a_builder)
528 >>> last_stub_mail_count = len(stub.test_emails)536 >>> last_stub_mail_count = len(stub.test_emails)
529537
@@ -535,22 +543,22 @@
535the build record to FULLYBUILT, as the process-upload would do:543the build record to FULLYBUILT, as the process-upload would do:
536544
537 >>> from canonical.launchpad.interfaces import BuildStatus545 >>> from canonical.launchpad.interfaces import BuildStatus
538 >>> bqItem10.build.buildstate = BuildStatus.FULLYBUILT546 >>> build.buildstate = BuildStatus.FULLYBUILT
539547
540Now the updateBuild should recognize this build record as a548Now the updateBuild should recognize this build record as a
541Successfully built and uploaded procedure, not sending any549Successfully built and uploaded procedure, not sending any
542notification and updating the build information:550notification and updating the build information:
543551
544 >>> buildergroup.updateBuild(bqItem10)552 >>> buildergroup.updateBuild(bqItem10)
545 >>> bqItem10.build.builder is not None553 >>> build.builder is not None
546 True554 True
547 >>> bqItem10.build.datebuilt is not None555 >>> build.datebuilt is not None
548 True556 True
549 >>> bqItem10.build.buildduration is not None557 >>> build.buildduration is not None
550 True558 True
551 >>> bqItem10.build.buildlog is not None559 >>> build.buildlog is not None
552 True560 True
553 >>> bqItem10.build.buildstate.title561 >>> build.buildstate.title
554 'Successfully built'562 'Successfully built'
555 >>> check_mail_sent(last_stub_mail_count)563 >>> check_mail_sent(last_stub_mail_count)
556 False564 False
@@ -558,7 +566,7 @@
558We do not store any build log information when the binary upload566We do not store any build log information when the binary upload
559processing succeeded.567processing succeeded.
560568
561 >>> bqItem10.build.upload_log is None569 >>> build.upload_log is None
562 True570 True
563571
564Cleanup in preparation for the next test:572Cleanup in preparation for the next test:
@@ -585,13 +593,14 @@
585593
586 >>> bqItem11.builder is None594 >>> bqItem11.builder is None
587 True595 True
588 >>> bqItem11.buildstart is None596 >>> bqItem11.date_started is None
589 True597 True
590 >>> bqItem11.lastscore598 >>> bqItem11.lastscore
591 0599 0
592 >>> check_mail_sent(last_stub_mail_count)600 >>> check_mail_sent(last_stub_mail_count)
593 False601 False
594 >>> bqItem11.build.buildstate.title602 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem11)
603 >>> build.buildstate.title
595 'Needs building'604 'Needs building'
596605
597Cleanup in preparation for the next test:606Cleanup in preparation for the next test:
@@ -790,11 +799,11 @@
790tests.799tests.
791800
792 >>> current_job = a_builder.currentjob801 >>> current_job = a_builder.currentjob
793 >>> resurrect_build = current_job.build802 >>> resurrect_build = getUtility(IBuildSet).getByQueueEntry(current_job)
794 >>> resurrect_build.buildstate = BuildStatus.NEEDSBUILD803 >>> resurrect_build.buildstate = BuildStatus.NEEDSBUILD
795 >>> syncUpdate(resurrect_build)804 >>> syncUpdate(resurrect_build)
796 >>> current_job.builder = None805 >>> current_job.builder = None
797 >>> current_job.buildstart = None806 >>> current_job.setDateStarted(None)
798 >>> syncUpdate(current_job)807 >>> syncUpdate(current_job)
799808
800IBuilder.findCandidate also identifies if there are builds for809IBuilder.findCandidate also identifies if there are builds for
@@ -802,7 +811,8 @@
802corresponding build record as SUPERSEDED.811corresponding build record as SUPERSEDED.
803812
804 >>> old_candidate = a_builder.findBuildCandidate()813 >>> old_candidate = a_builder.findBuildCandidate()
805 >>> print old_candidate.build.buildstate.name814 >>> build = getUtility(IBuildSet).getByQueueEntry(old_candidate)
815 >>> print build.buildstate.name
806 NEEDSBUILD816 NEEDSBUILD
807817
808The 'candidate' is constant until we dispatch it.818The 'candidate' is constant until we dispatch it.
@@ -814,7 +824,7 @@
814Now let's disable the archive of the associated build record and see824Now let's disable the archive of the associated build record and see
815whether the candidate will still be found.825whether the candidate will still be found.
816826
817 >>> old_candidate.build.archive.enabled = False827 >>> build.archive.enabled = False
818 >>> new_candidate = a_builder.findBuildCandidate()828 >>> new_candidate = a_builder.findBuildCandidate()
819 >>> new_candidate is None829 >>> new_candidate is None
820 True830 True
@@ -823,7 +833,7 @@
823archives are ignored. Now let's re-enable that archive and the build833archives are ignored. Now let's re-enable that archive and the build
824candidate will be found again.834candidate will be found again.
825835
826 >>> old_candidate.build.archive.enabled = True836 >>> build.archive.enabled = True
827 >>> new_candidate = a_builder.findBuildCandidate()837 >>> new_candidate = a_builder.findBuildCandidate()
828 >>> new_candidate.id == old_candidate.id838 >>> new_candidate.id == old_candidate.id
829 True839 True
@@ -836,9 +846,9 @@
836 >>> from canonical.launchpad.interfaces import PackagePublishingStatus846 >>> from canonical.launchpad.interfaces import PackagePublishingStatus
837 >>> from canonical.testing.layers import LaunchpadZopelessLayer847 >>> from canonical.testing.layers import LaunchpadZopelessLayer
838848
839 >>> spr = old_candidate.build.sourcepackagerelease849 >>> spr = build.sourcepackagerelease
840 >>> secure_pub = removeSecurityProxy(850 >>> secure_pub = removeSecurityProxy(
841 ... old_candidate).build.current_source_publication.secure_record851 ... build).current_source_publication.secure_record
842 >>> commit()852 >>> commit()
843 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')853 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
844 >>> secure_pub.status = PackagePublishingStatus.SUPERSEDED854 >>> secure_pub.status = PackagePublishingStatus.SUPERSEDED
@@ -854,7 +864,7 @@
854Because the 'previous' candidate was marked as superseded, so it's not864Because the 'previous' candidate was marked as superseded, so it's not
855part of the candidates list anymore.865part of the candidates list anymore.
856866
857 >>> print old_candidate.build.buildstate.name867 >>> print build.buildstate.name
858 SUPERSEDED868 SUPERSEDED
859869
860If the candidate is for a private build whose source has not been870If the candidate is for a private build whose source has not been
@@ -862,9 +872,10 @@
862published. We need to tweak the status of the publishing record again872published. We need to tweak the status of the publishing record again
863to demonstrate this, and also make the archive private:873to demonstrate this, and also make the archive private:
864874
865 >>> source = new_candidate.build.sourcepackagerelease875 >>> build = getUtility(IBuildSet).getByQueueEntry(new_candidate)
876 >>> source = build.sourcepackagerelease
866 >>> secure_pub = removeSecurityProxy(877 >>> secure_pub = removeSecurityProxy(
867 ... new_candidate).build.current_source_publication.secure_record878 ... build).current_source_publication.secure_record
868 >>> commit()879 >>> commit()
869 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')880 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
870 >>> secure_pub.status = PackagePublishingStatus.PENDING881 >>> secure_pub.status = PackagePublishingStatus.PENDING
@@ -903,22 +914,23 @@
903914
904 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')915 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
905 >>> secure_pub = removeSecurityProxy(916 >>> secure_pub = removeSecurityProxy(
906 ... new_candidate).build.current_source_publication.secure_record917 ... build).current_source_publication.secure_record
907 >>> secure_pub.status = PackagePublishingStatus.DELETED918 >>> secure_pub.status = PackagePublishingStatus.DELETED
908 >>> secure_pub = removeSecurityProxy(919 >>> secure_pub = removeSecurityProxy(
909 ... new_candidate).build.current_source_publication.secure_record920 ... build).current_source_publication.secure_record
910 >>> secure_pub.status = PackagePublishingStatus.SUPERSEDED921 >>> secure_pub.status = PackagePublishingStatus.SUPERSEDED
911 >>> commit()922 >>> commit()
912 >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser)923 >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser)
913924
914 >>> print current_job.build.buildstate.name925 >>> build = getUtility(IBuildSet).getByQueueEntry(current_job)
926 >>> print build.buildstate.name
915 NEEDSBUILD927 NEEDSBUILD
916928
917 >>> another_candidate = a_builder.findBuildCandidate()929 >>> another_candidate = a_builder.findBuildCandidate()
918 >>> print another_candidate930 >>> print another_candidate
919 None931 None
920932
921 >>> print current_job.build.buildstate.name933 >>> print build.buildstate.name
922 SUPERSEDED934 SUPERSEDED
923935
924We'll reset the archive back to non-private for further tests:936We'll reset the archive back to non-private for further tests:
@@ -1147,7 +1159,8 @@
1147 >>> cprov_archive.private = True1159 >>> cprov_archive.private = True
1148 >>> cprov_archive.buildd_secret = "secret"1160 >>> cprov_archive.buildd_secret = "secret"
1149 >>> cprov_archive.require_virtualized = False1161 >>> cprov_archive.require_virtualized = False
1150 >>> for build_file in candidate.files:1162 >>> build = getUtility(IBuildSet).getByQueueEntry(candidate)
1163 >>> for build_file in build.sourcepackagerelease.files:
1151 ... removeSecurityProxy(build_file).libraryfile.restricted = True1164 ... removeSecurityProxy(build_file).libraryfile.restricted = True
1152 >>> commit()1165 >>> commit()
1153 >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)1166 >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)
@@ -1169,7 +1182,8 @@
1169archive and not the one from the PPA, which on the absence of ancestry1182archive and not the one from the PPA, which on the absence of ancestry
1170defaults to 'universe'.1183defaults to 'universe'.
11711184
1172 >>> print candidate.build.current_component.name1185 >>> build = getUtility(IBuildSet).getByQueueEntry(candidate)
1186 >>> print build.current_component.name
1173 main1187 main
11741188
1175This is so that the mangling tools will run over the built packages.1189This is so that the mangling tools will run over the built packages.
@@ -1196,7 +1210,7 @@
1196We will create an ancestry in the primary archive target to the 'main'1210We will create an ancestry in the primary archive target to the 'main'
1197component and this time the dispatching will follow that component.1211component and this time the dispatching will follow that component.
11981212
1199 >>> sourcename = candidate.build.sourcepackagerelease.name1213 >>> sourcename = build.sourcepackagerelease.name
12001214
1201 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')1215 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
1202 >>> login('foo.bar@canonical.com')1216 >>> login('foo.bar@canonical.com')
@@ -1227,14 +1241,14 @@
12271241
1228 >>> candidate = a_build.createBuildQueueEntry()1242 >>> candidate = a_build.createBuildQueueEntry()
1229 >>> setupBuildQueue(candidate, a_builder)1243 >>> setupBuildQueue(candidate, a_builder)
1230 >>> candidate.build.upload_log = None1244 >>> build.upload_log = None
1231 >>> candidate.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))1245 >>> candidate.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))
1232 >>> buildergroup.updateBuild(candidate)1246 >>> buildergroup.updateBuild(candidate)
12331247
1234 >>> candidate.build.archive.private1248 >>> build.archive.private
1235 True1249 True
12361250
1237 >>> lfa = candidate.build.buildlog1251 >>> lfa = build.buildlog
1238 >>> lfa.restricted1252 >>> lfa.restricted
1239 True1253 True
1240 >>> print lfa.filename1254 >>> print lfa.filename
@@ -1269,7 +1283,8 @@
12691283
1270 >>> cprov_archive.private = False1284 >>> cprov_archive.private = False
1271 >>> cprov_archive.require_virtualized = True1285 >>> cprov_archive.require_virtualized = True
1272 >>> for build_file in candidate.files:1286 >>> build = getUtility(IBuildSet).getByQueueEntry(candidate)
1287 >>> for build_file in build.sourcepackagerelease.files:
1273 ... removeSecurityProxy(build_file).libraryfile.restricted = False1288 ... removeSecurityProxy(build_file).libraryfile.restricted = False
1274 >>> mark_archive = getUtility(IPersonSet).getByName('mark').archive1289 >>> mark_archive = getUtility(IPersonSet).getByName('mark').archive
12751290
@@ -1388,7 +1403,8 @@
1388 >>> a_builder.currentjob.destroySelf()1403 >>> a_builder.currentjob.destroySelf()
13891404
1390 >>> bqItem3 = a_build.createBuildQueueEntry()1405 >>> bqItem3 = a_build.createBuildQueueEntry()
1391 >>> removeSecurityProxy(bqItem3.build).pocket = (1406 >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3)
1407 >>> removeSecurityProxy(build).pocket = (
1392 ... PackagePublishingPocket.UPDATES)1408 ... PackagePublishingPocket.UPDATES)
1393 >>> last_stub_mail_count = len(stub.test_emails)1409 >>> last_stub_mail_count = len(stub.test_emails)
1394 >>> a_builder.dispatchBuildCandidate(bqItem3)1410 >>> a_builder.dispatchBuildCandidate(bqItem3)
@@ -1410,7 +1426,7 @@
1410 >>> a_builder.currentjob.destroySelf()1426 >>> a_builder.currentjob.destroySelf()
14111427
1412 >>> bqItem3 = a_build.createBuildQueueEntry()1428 >>> bqItem3 = a_build.createBuildQueueEntry()
1413 >>> removeSecurityProxy(bqItem3.build).pocket = (1429 >>> removeSecurityProxy(build).pocket = (
1414 ... PackagePublishingPocket.PROPOSED)1430 ... PackagePublishingPocket.PROPOSED)
1415 >>> last_stub_mail_count = len(stub.test_emails)1431 >>> last_stub_mail_count = len(stub.test_emails)
1416 >>> a_builder.dispatchBuildCandidate(bqItem3)1432 >>> a_builder.dispatchBuildCandidate(bqItem3)
@@ -1433,7 +1449,7 @@
1433 >>> a_builder.currentjob.destroySelf()1449 >>> a_builder.currentjob.destroySelf()
14341450
1435 >>> bqItem3 = a_build.createBuildQueueEntry()1451 >>> bqItem3 = a_build.createBuildQueueEntry()
1436 >>> removeSecurityProxy(bqItem3.build).pocket = (1452 >>> removeSecurityProxy(build).pocket = (
1437 ... PackagePublishingPocket.BACKPORTS)1453 ... PackagePublishingPocket.BACKPORTS)
1438 >>> last_stub_mail_count = len(stub.test_emails)1454 >>> last_stub_mail_count = len(stub.test_emails)
1439 >>> a_builder.dispatchBuildCandidate(bqItem3)1455 >>> a_builder.dispatchBuildCandidate(bqItem3)
@@ -1456,9 +1472,9 @@
1456 >>> a_builder.currentjob.destroySelf()1472 >>> a_builder.currentjob.destroySelf()
14571473
1458 >>> bqItem3 = a_build.createBuildQueueEntry()1474 >>> bqItem3 = a_build.createBuildQueueEntry()
1459 >>> removeSecurityProxy(bqItem3.build).buildstate = (1475 >>> removeSecurityProxy(build).buildstate = (
1460 ... BuildStatus.NEEDSBUILD)1476 ... BuildStatus.NEEDSBUILD)
1461 >>> removeSecurityProxy(bqItem3.build).pocket = (1477 >>> removeSecurityProxy(build).pocket = (
1462 ... PackagePublishingPocket.SECURITY)1478 ... PackagePublishingPocket.SECURITY)
1463 >>> last_stub_mail_count = len(stub.test_emails)1479 >>> last_stub_mail_count = len(stub.test_emails)
14641480
14651481
=== modified file 'lib/lp/soyuz/doc/builder.txt'
--- lib/lp/soyuz/doc/builder.txt 2009-08-27 19:09:44 +0000
+++ lib/lp/soyuz/doc/builder.txt 2009-11-16 23:27:14 +0000
@@ -45,8 +45,10 @@
4545
46 >>> from lp.soyuz.interfaces.archive import ArchivePurpose46 >>> from lp.soyuz.interfaces.archive import ArchivePurpose
47 >>> from zope.security.proxy import removeSecurityProxy47 >>> from zope.security.proxy import removeSecurityProxy
48 >>> from lp.soyuz.interfaces.build import IBuildSet
49 >>> build = getUtility(IBuildSet).getByQueueEntry(builder.currentjob)
48 >>> builder_archive = removeSecurityProxy(50 >>> builder_archive = removeSecurityProxy(
49 ... builder.currentjob.build.archive)51 ... build.archive)
50 >>> saved_purpose = builder_archive.purpose52 >>> saved_purpose = builder_archive.purpose
51 >>> builder_archive.purpose = ArchivePurpose.COPY53 >>> builder_archive.purpose = ArchivePurpose.COPY
5254
5355
=== modified file 'lib/lp/soyuz/doc/buildqueue.txt'
--- lib/lp/soyuz/doc/buildqueue.txt 2009-08-28 07:34:44 +0000
+++ lib/lp/soyuz/doc/buildqueue.txt 2009-11-16 23:27:14 +0000
@@ -31,19 +31,21 @@
31The IBuild record related to this job is provided by the 'build'31The IBuild record related to this job is provided by the 'build'
32attribute:32attribute:
3333
34 >>> bq.build.id34 >>> from lp.soyuz.interfaces.build import IBuildSet
35 >>> build = getUtility(IBuildSet).getByQueueEntry(bq)
36 >>> build.id
35 837 8
36 >>> bq.build.buildstate.name38 >>> build.buildstate.name
37 'BUILDING'39 'BUILDING'
3840
39The static timestamps, representing when the record was initialised41The static timestamps, representing when the record was initialised
40(inserted) and when the job was dispatched are provided as datetime42(inserted) and when the job was dispatched are provided as datetime
41instances:43instances:
4244
43 >>> bq.created45 >>> bq.job.date_created
44 datetime.datetime(2005, 6, 15, 9, 14, 12, 820778, tzinfo=<UTC>)46 datetime.datetime(2005, 6, 15, 9, 14, 12, 820778, tzinfo=<UTC>)
4547
46 >>> bq.buildstart48 >>> bq.date_started
47 datetime.datetime(2005, 6, 15, 9, 20, 12, 820778, tzinfo=<UTC>)49 datetime.datetime(2005, 6, 15, 9, 20, 12, 820778, tzinfo=<UTC>)
4850
49Check Builder foreign key, which indicated which builder 'is processing'51Check Builder foreign key, which indicated which builder 'is processing'
@@ -77,29 +79,6 @@
77 >>> bq.manual79 >>> bq.manual
78 False80 False
7981
80BuildQueue provides a property which calculates the partial duration
81of the build procedure (NOW - buildstart), it's mainly used in the UI.
82
83 >>> bq.buildduration
84 datetime.timedelta(...)
85
86Some local properties inherited from related content classes:
87
88 >>> bq.archseries.id == bq.build.distroarchseries.id
89 True
90 >>> bq.urgency == bq.build.sourcepackagerelease.urgency
91 True
92 >>> bq.archhintlist == bq.build.sourcepackagerelease.architecturehintlist
93 True
94 >>> bq.name == bq.build.sourcepackagerelease.name
95 True
96 >>> bq.version == bq.build.sourcepackagerelease.version
97 True
98 >>> bq.files.count() == bq.build.sourcepackagerelease.files.count()
99 True
100 >>> bq.builddependsindep == bq.build.sourcepackagerelease.builddependsindep
101 True
102
103BuildQueue provides the name for the logfile resulting from the build:82BuildQueue provides the name for the logfile resulting from the build:
10483
105 >>> bq.getLogFileName()84 >>> bq.getLogFileName()
@@ -131,11 +110,12 @@
131110
132 >>> print job.builder.name111 >>> print job.builder.name
133 bob112 bob
134 >>> job.buildstart is not None113 >>> job.date_started is not None
135 True114 True
136 >>> print job.logtail115 >>> print job.logtail
137 Dummy sampledata entry, not processing116 Dummy sampledata entry, not processing
138 >>> print job.build.buildstate.name117 >>> build = getUtility(IBuildSet).getByQueueEntry(job)
118 >>> print build.buildstate.name
139 BUILDING119 BUILDING
140 >>> print job.lastscore120 >>> print job.lastscore
141 1121 1
@@ -150,11 +130,11 @@
150130
151 >>> print job.builder131 >>> print job.builder
152 None132 None
153 >>> print job.buildstart133 >>> print job.date_started
154 None134 None
155 >>> print job.logtail135 >>> print job.logtail
156 None136 None
157 >>> print job.build.buildstate.name137 >>> print build.buildstate.name
158 NEEDSBUILD138 NEEDSBUILD
159 >>> print job.lastscore139 >>> print job.lastscore
160 1140 1
@@ -169,9 +149,9 @@
169149
170 >>> print job.builder.name150 >>> print job.builder.name
171 bob151 bob
172 >>> job.buildstart is not None152 >>> job.date_started is not None
173 True153 True
174 >>> print job.build.buildstate.name154 >>> print build.buildstate.name
175 BUILDING155 BUILDING
176156
177157
@@ -266,7 +246,7 @@
266and restricted246and restricted
267247
268 >>> for bq in bqset.calculateCandidates(archseries):248 >>> for bq in bqset.calculateCandidates(archseries):
269 ... build = bq.build249 ... build = getUtility(IBuildSet).getByQueueEntry(bq)
270 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)250 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)
271 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)251 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)
272 i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2)252 i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2)
@@ -298,7 +278,7 @@
298as intended.278as intended.
299279
300 >>> for bq in bqset.calculateCandidates(archseries):280 >>> for bq in bqset.calculateCandidates(archseries):
301 ... build = bq.build281 ... build = getUtility(IBuildSet).getByQueueEntry(bq)
302 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)282 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)
303 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)283 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)
304 i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2)284 i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2)
@@ -310,7 +290,7 @@
310290
311 >>> archseries = [hoary['hppa']]291 >>> archseries = [hoary['hppa']]
312 >>> for bq in bqset.calculateCandidates(archseries):292 >>> for bq in bqset.calculateCandidates(archseries):
313 ... build = bq.build293 ... build = getUtility(IBuildSet).getByQueueEntry(bq)
314 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)294 ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id)
315 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)295 hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4)
316 hppa build of alsa-utils 1.0.9a-4 in ubuntu hoary RELEASE (500, 3)296 hppa build of alsa-utils 1.0.9a-4 in ubuntu hoary RELEASE (500, 3)
317297
=== modified file 'lib/lp/soyuz/doc/initialise-from-parent.txt'
--- lib/lp/soyuz/doc/initialise-from-parent.txt 2009-10-26 18:40:04 +0000
+++ lib/lp/soyuz/doc/initialise-from-parent.txt 2009-11-16 23:27:14 +0000
@@ -172,3 +172,10 @@
172 >>> pmount_source.sourcepackagerelease.getBuildByArch(172 >>> pmount_source.sourcepackagerelease.getBuildByArch(
173 ... foobuntu['hppa'], ubuntu.main_archive) is None173 ... foobuntu['hppa'], ubuntu.main_archive) is None
174 True174 True
175
176initialiseFromParent also copies the permitted source formats from the
177parent series.
178
179 >>> from lp.soyuz.interfaces.sourcepackageformat import SourcePackageFormat
180 >>> foobuntu.isSourcePackageFormatPermitted(SourcePackageFormat.FORMAT_1_0)
181 True
175182
=== modified file 'lib/lp/soyuz/interfaces/build.py'
--- lib/lp/soyuz/interfaces/build.py 2009-10-26 18:40:04 +0000
+++ lib/lp/soyuz/interfaces/build.py 2009-11-16 23:27:14 +0000
@@ -524,6 +524,13 @@
524 :rtype: ``dict``.524 :rtype: ``dict``.
525 """525 """
526526
527 def getByQueueEntry(queue_entry):
528 """Return an IBuild instance for the given build queue entry.
529
530 Retrieve the only one possible build record associated with the given
531 build queue entry. If not found, return None.
532 """
533
527534
528class IBuildRescoreForm(Interface):535class IBuildRescoreForm(Interface):
529 """Form for rescoring a build."""536 """Form for rescoring a build."""
530537
=== added file 'lib/lp/soyuz/interfaces/buildpackagejob.py'
--- lib/lp/soyuz/interfaces/buildpackagejob.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/interfaces/buildpackagejob.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,34 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4# pylint: disable-msg=E0211,E0213
5
6"""BuildPackageJob interfaces."""
7
8__metaclass__ = type
9
10__all__ = [
11 'IBuildPackageJob',
12 ]
13
14from zope.schema import Int
15
16from canonical.launchpad import _
17from lazr.restful.fields import Reference
18from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
19from lp.services.job.interfaces.job import IJob
20from lp.soyuz.interfaces.build import IBuild
21
22
23class IBuildPackageJob(IBuildFarmJob):
24 """A read-only interface for build package jobs."""
25 id = Int(title=_('ID'), required=True, readonly=True)
26
27 job = Reference(
28 IJob, title=_("Job"), required=True, readonly=True,
29 description=_("Data common to all job types."))
30
31 build = Reference(
32 IBuild, title=_("Build"),
33 required=True,readonly=True,
34 description=_("Build record associated with this job."))
035
=== modified file 'lib/lp/soyuz/interfaces/buildqueue.py'
--- lib/lp/soyuz/interfaces/buildqueue.py 2009-06-25 04:06:00 +0000
+++ lib/lp/soyuz/interfaces/buildqueue.py 2009-11-16 23:27:14 +0000
@@ -13,6 +13,14 @@
13 ]13 ]
1414
15from zope.interface import Interface, Attribute15from zope.interface import Interface, Attribute
16from zope.schema import Choice, Datetime
17
18from lazr.restful.fields import Reference
19
20from canonical.launchpad import _
21from lp.buildmaster.interfaces.buildfarmjob import (
22 IBuildFarmJob, BuildFarmJobType)
23from lp.services.job.interfaces.job import IJob
1624
1725
18class IBuildQueue(Interface):26class IBuildQueue(Interface):
@@ -30,59 +38,24 @@
30 """38 """
3139
32 id = Attribute("Job identifier")40 id = Attribute("Job identifier")
33 build = Attribute("The IBuild record that originated this job")
34 builder = Attribute("The IBuilder instance processing this job")41 builder = Attribute("The IBuilder instance processing this job")
35 created = Attribute("The datetime that the queue entry was created")
36 buildstart = Attribute("The datetime of the last build attempt")
37 logtail = Attribute("The current tail of the log of the build")42 logtail = Attribute("The current tail of the log of the build")
38 lastscore = Attribute("Last score to be computed for this job")43 lastscore = Attribute("Last score to be computed for this job")
39 manual = Attribute("Whether or not the job was manually scored")44 manual = Attribute("Whether or not the job was manually scored")
4045
41 # properties inherited from related Content classes.46 job = Reference(
42 archseries = Attribute(47 IJob, title=_("Job"), required=True, readonly=True,
43 "DistroArchSeries target of the IBuild releated to this job.")48 description=_("Data common to all job types."))
44 name = Attribute(49
45 "Name of the ISourcePackageRelease releated to this job.")50 job_type = Choice(
46 version = Attribute(51 title=_('Job type'), required=True, vocabulary=BuildFarmJobType,
47 "Version of the ISourcePackageRelease releated to this job.")52 description=_("The type of this job."))
48 files = Attribute(
49 "Collection of files related to the ISourcePackageRelease "
50 "releated to this job.")
51 urgency = Attribute(
52 "Urgency of the ISourcePackageRelease releated to this job.")
53 archhintlist = Attribute(
54 "architecturehintlist of the ISourcePackageRelease releated "
55 "to this job.")
56 builddependsindep = Attribute(
57 "builddependsindep of the ISourcePackageRelease releated to "
58 "this job.")
59 buildduration = Attribute(
60 "Duration of the job, calculated on-the-fly based on buildstart.")
61 is_virtualized = Attribute("See IBuild.is_virtualized.")
6253
63 def manualScore(value):54 def manualScore(value):
64 """Manually set a score value to a queue item and lock it."""55 """Manually set a score value to a queue item and lock it."""
6556
66 def score():57 def score():
67 """Perform scoring based on heuristic values.58 """The job score calculated for the job type in question."""
68
69 Creates a 'score' (priority) value based on:
70
71 * Component: main component gets higher values
72 (main, 1000, restricted, 750, universe, 250, multiverse, 0)
73
74 * Urgency: EMERGENCY sources gets higher values
75 (EMERGENCY, 20, HIGH, 15, MEDIUM, 10, LOW, 5)
76
77 * Queue time: old records gets a relative higher priority
78 (The rate against component is something like: a 'multiverse'
79 build will be as important as a 'main' after 40 hours in queue)
80
81 This method automatically updates IBuildQueue.lastscore value and
82 skips 'manually-scored' records.
83
84 This method use any logger available in the standard logging system.
85 """
8659
87 def destroySelf():60 def destroySelf():
88 """Delete this entry from the database."""61 """Delete this entry from the database."""
@@ -121,6 +94,17 @@
121 Clean the builder for another jobs.94 Clean the builder for another jobs.
122 """95 """
12396
97 specific_job = Reference(
98 IBuildFarmJob, title=_("Job"),
99 description=_("Data and operations common to all build farm jobs."))
100
101 def setDateStarted(timestamp):
102 """Sets the date started property to the given value."""
103
104 date_started = Datetime(
105 title=_('Start time'),
106 description=_('Time when the job started.'))
107
124108
125class IBuildQueueSet(Interface):109class IBuildQueueSet(Interface):
126 """Launchpad Auto Build queue set handler and auxiliary methods."""110 """Launchpad Auto Build queue set handler and auxiliary methods."""
@@ -165,4 +149,3 @@
165 Retrieve the build queue and related builder rows associated with the149 Retrieve the build queue and related builder rows associated with the
166 builds in question where they exist.150 builds in question where they exist.
167 """151 """
168
169152
=== added file 'lib/lp/soyuz/interfaces/sourcepackageformat.py'
--- lib/lp/soyuz/interfaces/sourcepackageformat.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/interfaces/sourcepackageformat.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,64 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Source package format interfaces."""
5
6__metaclass__ = type
7
8__all__ = [
9 'SourcePackageFormat',
10 'ISourcePackageFormatSelection',
11 'ISourcePackageFormatSelectionSet',
12 ]
13
14from zope.interface import Attribute, Interface
15from lazr.enum import DBEnumeratedType, DBItem
16
17
18class SourcePackageFormat(DBEnumeratedType):
19 """Source package format
20
21 There are currently three formats of Debian source packages. The Format
22 field in the .dsc file must specify one of these formats.
23 """
24
25 FORMAT_1_0 = DBItem(0, """
26 1.0
27
28 Specifies either a native (having a single tar.gz) or non-native
29 (having an orig.tar.gz and a diff.gz) package. Supports only gzip
30 compression.
31 """)
32
33 FORMAT_3_0_QUILT = DBItem(1, """
34 3.0 (quilt)
35
36 Specifies a non-native package, with an orig.tar.* and a debian.tar.*.
37 Supports gzip and bzip2 compression.
38 """)
39
40 FORMAT_3_0_NATIVE = DBItem(2, """
41 3.0 (native)
42
43 Specifies a native package, with a single tar.*. Supports gzip and
44 bzip2 compression.
45 """)
46
47
48class ISourcePackageFormatSelection(Interface):
49 """A source package format allowed within a DistroSeries."""
50
51 id = Attribute("ID")
52 distroseries = Attribute("Target series")
53 format = Attribute("Permitted source package format")
54
55
56class ISourcePackageFormatSelectionSet(Interface):
57 """Set manipulation tools for the SourcePackageFormatSelection table."""
58
59 def getBySeriesAndFormat(distroseries, format):
60 """Return the ISourcePackageFormatSelection for the given series and
61 format."""
62
63 def add(distroseries, format):
64 """Allow the given source package format in the given series."""
065
=== modified file 'lib/lp/soyuz/model/build.py'
--- lib/lp/soyuz/model/build.py 2009-10-26 18:40:04 +0000
+++ lib/lp/soyuz/model/build.py 2009-11-16 23:27:14 +0000
@@ -18,7 +18,6 @@
18from zope.security.proxy import removeSecurityProxy18from zope.security.proxy import removeSecurityProxy
19from storm.expr import (19from storm.expr import (
20 Desc, In, Join, LeftJoin)20 Desc, In, Join, LeftJoin)
21from storm.references import Reference
22from storm.store import Store21from storm.store import Store
23from sqlobject import (22from sqlobject import (
24 StringCol, ForeignKey, IntervalCol, SQLObjectNotFound)23 StringCol, ForeignKey, IntervalCol, SQLObjectNotFound)
@@ -46,7 +45,9 @@
46 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)45 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
47from canonical.launchpad.webapp.tales import DurationFormatterAPI46from canonical.launchpad.webapp.tales import DurationFormatterAPI
48from lp.archivepublisher.utils import get_ppa_reference47from lp.archivepublisher.utils import get_ppa_reference
48from lp.buildmaster.interfaces.buildfarmjob import BuildFarmJobType
49from lp.registry.interfaces.pocket import PackagePublishingPocket49from lp.registry.interfaces.pocket import PackagePublishingPocket
50from lp.services.job.model.job import Job
50from lp.soyuz.adapters.archivedependencies import get_components_for_building51from lp.soyuz.adapters.archivedependencies import get_components_for_building
51from lp.soyuz.interfaces.archive import ArchivePurpose52from lp.soyuz.interfaces.archive import ArchivePurpose
52from lp.soyuz.interfaces.build import (53from lp.soyuz.interfaces.build import (
@@ -55,6 +56,7 @@
55from lp.soyuz.interfaces.publishing import active_publishing_status56from lp.soyuz.interfaces.publishing import active_publishing_status
56from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease57from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
57from lp.soyuz.model.builder import Builder58from lp.soyuz.model.builder import Builder
59from lp.soyuz.model.buildpackagejob import BuildPackageJob
58from lp.soyuz.model.buildqueue import BuildQueue60from lp.soyuz.model.buildqueue import BuildQueue
59from lp.soyuz.model.files import BinaryPackageFile61from lp.soyuz.model.files import BinaryPackageFile
60from lp.soyuz.model.publishing import SourcePackagePublishingHistory62from lp.soyuz.model.publishing import SourcePackagePublishingHistory
@@ -88,8 +90,6 @@
88 archive = ForeignKey(foreignKey='Archive', dbName='archive', notNull=True)90 archive = ForeignKey(foreignKey='Archive', dbName='archive', notNull=True)
89 estimated_build_duration = IntervalCol(default=None)91 estimated_build_duration = IntervalCol(default=None)
9092
91 buildqueue_record = Reference("<primary key>", BuildQueue.buildID,
92 on_remote=True)
93 date_first_dispatched = UtcDateTimeCol(dbName='date_first_dispatched')93 date_first_dispatched = UtcDateTimeCol(dbName='date_first_dispatched')
9494
95 upload_log = ForeignKey(95 upload_log = ForeignKey(
@@ -105,6 +105,16 @@
105 return proxied_file.http_url105 return proxied_file.http_url
106106
107 @property107 @property
108 def buildqueue_record(self):
109 """See `IBuild`."""
110 store = Store.of(self)
111 results = store.find(
112 BuildQueue,
113 BuildPackageJob.job == BuildQueue.jobID,
114 BuildPackageJob.build == self.id)
115 return results.one()
116
117 @property
108 def upload_log_url(self):118 def upload_log_url(self):
109 """See `IBuild`."""119 """See `IBuild`."""
110 if self.upload_log is None:120 if self.upload_log is None:
@@ -351,8 +361,10 @@
351 Archive361 Archive
352 JOIN Build ON362 JOIN Build ON
353 Build.archive = Archive.id363 Build.archive = Archive.id
364 JOIN BuildPackageJob ON
365 Build.id = BuildPackageJob.build
354 JOIN BuildQueue ON366 JOIN BuildQueue ON
355 Build.id = BuildQueue.build367 BuildPackageJob.job = BuildQueue.job
356 WHERE368 WHERE
357 Build.buildstate = 0 AND369 Build.buildstate = 0 AND
358 Build.processor = %s AND370 Build.processor = %s AND
@@ -412,16 +424,20 @@
412 SELECT424 SELECT
413 CAST (EXTRACT(EPOCH FROM425 CAST (EXTRACT(EPOCH FROM
414 (Build.estimated_build_duration -426 (Build.estimated_build_duration -
415 (NOW() - BuildQueue.buildstart))) AS INTEGER)427 (NOW() - Job.date_started))) AS INTEGER)
416 AS remainder428 AS remainder
417 FROM429 FROM
418 Archive430 Archive
419 JOIN Build ON431 JOIN Build ON
420 Build.archive = Archive.id432 Build.archive = Archive.id
433 JOIN BuildPackageJob ON
434 Build.id = BuildPackageJob.build
421 JOIN BuildQueue ON435 JOIN BuildQueue ON
422 Build.id = BuildQueue.build436 BuildQueue.job = BuildPackageJob.job
423 JOIN Builder ON437 JOIN Builder ON
424 Builder.id = BuildQueue.builder438 Builder.id = BuildQueue.builder
439 JOIN Job ON
440 Job.id = BuildPackageJob.job
425 WHERE441 WHERE
426 Archive.require_virtualized = %s AND442 Archive.require_virtualized = %s AND
427 Archive.enabled = TRUE AND443 Archive.enabled = TRUE AND
@@ -605,7 +621,18 @@
605621
606 def createBuildQueueEntry(self):622 def createBuildQueueEntry(self):
607 """See `IBuild`"""623 """See `IBuild`"""
608 return BuildQueue(build=self)624 store = Store.of(self)
625 job = Job()
626 store.add(job)
627 specific_job = BuildPackageJob()
628 specific_job.build = self.id
629 specific_job.job = job.id
630 store.add(specific_job)
631 queue_entry = BuildQueue()
632 queue_entry.job = job.id
633 queue_entry.job_type = BuildFarmJobType.PACKAGEBUILD
634 store.add(queue_entry)
635 return queue_entry
609636
610 def notify(self, extra_info=None):637 def notify(self, extra_info=None):
611 """See `IBuild`"""638 """See `IBuild`"""
@@ -966,7 +993,9 @@
966 if status in [BuildStatus.NEEDSBUILD, BuildStatus.BUILDING]:993 if status in [BuildStatus.NEEDSBUILD, BuildStatus.BUILDING]:
967 orderBy = ["-BuildQueue.lastscore", "Build.id"]994 orderBy = ["-BuildQueue.lastscore", "Build.id"]
968 clauseTables.append('BuildQueue')995 clauseTables.append('BuildQueue')
969 condition_clauses.append('BuildQueue.build = Build.id')996 clauseTables.append('BuildPackageJob')
997 condition_clauses.append('BuildPackageJob.build = Build.id')
998 condition_clauses.append('BuildPackageJob.job = BuildQueue.job')
970 elif status == BuildStatus.SUPERSEDED or status is None:999 elif status == BuildStatus.SUPERSEDED or status is None:
971 orderBy = ["-Build.datecreated"]1000 orderBy = ["-Build.datecreated"]
972 else:1001 else:
@@ -1144,3 +1173,13 @@
1144 # this (pre_iter_hook()) method that will iterate over the1173 # this (pre_iter_hook()) method that will iterate over the
1145 # result set and force the query execution that way.1174 # result set and force the query execution that way.
1146 return list(result_set)1175 return list(result_set)
1176
1177 def getByQueueEntry(self, queue_entry):
1178 """See `IBuildSet`."""
1179 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
1180 result_set = store.find(
1181 Build,
1182 BuildPackageJob.build == Build.id,
1183 BuildPackageJob.job == queue_entry.job)
1184
1185 return result_set.one()
11471186
=== modified file 'lib/lp/soyuz/model/builder.py'
--- lib/lp/soyuz/model/builder.py 2009-11-11 10:43:07 +0000
+++ lib/lp/soyuz/model/builder.py 2009-11-16 23:27:14 +0000
@@ -52,6 +52,7 @@
52from lp.soyuz.interfaces.buildqueue import IBuildQueueSet52from lp.soyuz.interfaces.buildqueue import IBuildQueueSet
53from lp.soyuz.interfaces.publishing import (53from lp.soyuz.interfaces.publishing import (
54 PackagePublishingStatus)54 PackagePublishingStatus)
55from lp.soyuz.model.buildpackagejob import BuildPackageJob
55from canonical.launchpad.webapp import urlappend56from canonical.launchpad.webapp import urlappend
56from canonical.librarian.utils import copy_and_close57from canonical.librarian.utils import copy_and_close
5758
@@ -151,11 +152,11 @@
151 # Avoid circular imports.152 # Avoid circular imports.
152 from lp.soyuz.model.publishing import makePoolPath153 from lp.soyuz.model.publishing import makePoolPath
153154
154 build = build_queue_item.build155 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
155 archive = build.archive156 archive = build.archive
156 archive_url = archive.archive_url157 archive_url = archive.archive_url
157 component_name = build.current_component.name158 component_name = build.current_component.name
158 for source_file in build_queue_item.files:159 for source_file in build.sourcepackagerelease.files:
159 file_name = source_file.libraryfile.filename160 file_name = source_file.libraryfile.filename
160 sha1 = source_file.libraryfile.content.sha1161 sha1 = source_file.libraryfile.content.sha1
161 source_name = build.sourcepackagerelease.sourcepackagename.name162 source_name = build.sourcepackagerelease.sourcepackagename.name
@@ -264,8 +265,8 @@
264 * Ensure that the build pocket allows builds for the current265 * Ensure that the build pocket allows builds for the current
265 distroseries state.266 distroseries state.
266 """267 """
267 assert not (not self.virtualized and268 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
268 build_queue_item.is_virtualized), (269 assert not (not self.virtualized and build.is_virtualized), (
269 "Attempt to build non-virtual item on a virtual builder.")270 "Attempt to build non-virtual item on a virtual builder.")
270271
271 # Assert that we are not silently building SECURITY jobs.272 # Assert that we are not silently building SECURITY jobs.
@@ -274,27 +275,27 @@
274 # XXX Julian 2007-12-18 spec=security-in-soyuz: This is being275 # XXX Julian 2007-12-18 spec=security-in-soyuz: This is being
275 # addressed in the work on the blueprint:276 # addressed in the work on the blueprint:
276 # https://blueprints.launchpad.net/soyuz/+spec/security-in-soyuz277 # https://blueprints.launchpad.net/soyuz/+spec/security-in-soyuz
277 target_pocket = build_queue_item.build.pocket278 target_pocket = build.pocket
278 assert target_pocket != PackagePublishingPocket.SECURITY, (279 assert target_pocket != PackagePublishingPocket.SECURITY, (
279 "Soyuz is not yet capable of building SECURITY uploads.")280 "Soyuz is not yet capable of building SECURITY uploads.")
280281
281 # Ensure build has the needed chroot282 # Ensure build has the needed chroot
282 chroot = build_queue_item.archseries.getChroot()283 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
284 chroot = build.distroarchseries.getChroot()
283 if chroot is None:285 if chroot is None:
284 raise CannotBuild(286 raise CannotBuild(
285 "Missing CHROOT for %s/%s/%s" % (287 "Missing CHROOT for %s/%s/%s" % (
286 build_queue_item.build.distroseries.distribution.name,288 build.distroseries.distribution.name,
287 build_queue_item.build.distroseries.name,289 build.distroseries.name,
288 build_queue_item.build.distroarchseries.architecturetag)290 build.distroarchseries.architecturetag)
289 )291 )
290292
291 # The main distribution has policies to prevent uploads to some293 # The main distribution has policies to prevent uploads to some
292 # pockets (e.g. security) during different parts of the distribution294 # pockets (e.g. security) during different parts of the distribution
293 # series lifecycle. These do not apply to PPA builds nor any archive295 # series lifecycle. These do not apply to PPA builds nor any archive
294 # that allows release pocket updates.296 # that allows release pocket updates.
295 if (build_queue_item.build.archive.purpose != ArchivePurpose.PPA and297 if (build.archive.purpose != ArchivePurpose.PPA and
296 not build_queue_item.build.archive.allowUpdatesToReleasePocket()):298 not build.archive.allowUpdatesToReleasePocket()):
297 build = build_queue_item.build
298 # XXX Robert Collins 2007-05-26: not an explicit CannotBuild299 # XXX Robert Collins 2007-05-26: not an explicit CannotBuild
299 # exception yet because the callers have not been audited300 # exception yet because the callers have not been audited
300 assert build.distroseries.canUploadToPocket(build.pocket), (301 assert build.distroseries.canUploadToPocket(build.pocket), (
@@ -306,7 +307,8 @@
306 def _dispatchBuildToSlave(self, build_queue_item, args, buildid, logger):307 def _dispatchBuildToSlave(self, build_queue_item, args, buildid, logger):
307 """Start the build on the slave builder."""308 """Start the build on the slave builder."""
308 # Send chroot.309 # Send chroot.
309 chroot = build_queue_item.archseries.getChroot()310 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
311 chroot = build.distroarchseries.getChroot()
310 self.cacheFileOnSlave(logger, chroot)312 self.cacheFileOnSlave(logger, chroot)
311313
312 # Build filemap structure with the files required in this build314 # Build filemap structure with the files required in this build
@@ -314,11 +316,11 @@
314 # If the build is private we tell the slave to get the files from the316 # If the build is private we tell the slave to get the files from the
315 # archive instead of the librarian because the slaves cannot317 # archive instead of the librarian because the slaves cannot
316 # access the restricted librarian.318 # access the restricted librarian.
317 private = build_queue_item.build.archive.private319 private = build.archive.private
318 if private:320 if private:
319 self.cachePrivateSourceOnSlave(logger, build_queue_item)321 self.cachePrivateSourceOnSlave(logger, build_queue_item)
320 filemap = {}322 filemap = {}
321 for source_file in build_queue_item.files:323 for source_file in build.sourcepackagerelease.files:
322 lfa = source_file.libraryfile324 lfa = source_file.libraryfile
323 filemap[lfa.filename] = lfa.content.sha1325 filemap[lfa.filename] = lfa.content.sha1
324 if not private:326 if not private:
@@ -349,9 +351,10 @@
349351
350 def startBuild(self, build_queue_item, logger):352 def startBuild(self, build_queue_item, logger):
351 """See IBuilder."""353 """See IBuilder."""
354 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
355 spr = build.sourcepackagerelease
352 logger.info("startBuild(%s, %s, %s, %s)", self.url,356 logger.info("startBuild(%s, %s, %s, %s)", self.url,
353 build_queue_item.name, build_queue_item.version,357 spr.name, spr.version, build.pocket.title)
354 build_queue_item.build.pocket.title)
355358
356 # Make sure the request is valid; an exception is raised if it's not.359 # Make sure the request is valid; an exception is raised if it's not.
357 self._verifyBuildRequest(build_queue_item, logger)360 self._verifyBuildRequest(build_queue_item, logger)
@@ -365,39 +368,39 @@
365 # turn 'arch_indep' ON only if build is archindep or if368 # turn 'arch_indep' ON only if build is archindep or if
366 # the specific architecture is the nominatedarchindep for369 # the specific architecture is the nominatedarchindep for
367 # this distroseries (in case it requires any archindep source)370 # this distroseries (in case it requires any archindep source)
368 args['arch_indep'] = build_queue_item.archseries.isNominatedArchIndep371 build = getUtility(IBuildSet).getByQueueEntry(build_queue_item)
372 args['arch_indep'] = build.distroarchseries.isNominatedArchIndep
369373
370 suite = build_queue_item.build.distroarchseries.distroseries.name374 suite = build.distroarchseries.distroseries.name
371 if build_queue_item.build.pocket != PackagePublishingPocket.RELEASE:375 if build.pocket != PackagePublishingPocket.RELEASE:
372 suite += "-%s" % (build_queue_item.build.pocket.name.lower())376 suite += "-%s" % (build.pocket.name.lower())
373 args['suite'] = suite377 args['suite'] = suite
374378
375 archive_purpose = build_queue_item.build.archive.purpose379 archive_purpose = build.archive.purpose
376 if (archive_purpose == ArchivePurpose.PPA and380 if (archive_purpose == ArchivePurpose.PPA and
377 not build_queue_item.build.archive.require_virtualized):381 not build.archive.require_virtualized):
378 # If we're building a non-virtual PPA, override the purpose382 # If we're building a non-virtual PPA, override the purpose
379 # to PRIMARY and use the primary component override.383 # to PRIMARY and use the primary component override.
380 # This ensures that the package mangling tools will run over384 # This ensures that the package mangling tools will run over
381 # the built packages.385 # the built packages.
382 args['archive_purpose'] = ArchivePurpose.PRIMARY.name386 args['archive_purpose'] = ArchivePurpose.PRIMARY.name
383 args["ogrecomponent"] = (387 args["ogrecomponent"] = (
384 get_primary_current_component(build_queue_item.build))388 get_primary_current_component(build))
385 else:389 else:
386 args['archive_purpose'] = archive_purpose.name390 args['archive_purpose'] = archive_purpose.name
387 args["ogrecomponent"] = (391 args["ogrecomponent"] = (
388 build_queue_item.build.current_component.name)392 build.current_component.name)
389393
390 args['archives'] = get_sources_list_for_building(394 args['archives'] = get_sources_list_for_building(build)
391 build_queue_item.build)
392395
393 # Let the build slave know whether this is a build in a private396 # Let the build slave know whether this is a build in a private
394 # archive.397 # archive.
395 args['archive_private'] = build_queue_item.build.archive.private398 args['archive_private'] = build.archive.private
396399
397 # Generate a string which can be used to cross-check when obtaining400 # Generate a string which can be used to cross-check when obtaining
398 # results so we know we are referring to the right database object in401 # results so we know we are referring to the right database object in
399 # subsequent runs.402 # subsequent runs.
400 buildid = "%s-%s" % (build_queue_item.build.id, build_queue_item.id)403 buildid = "%s-%s" % (build.id, build_queue_item.id)
401 logger.debug("Initiating build %s on %s" % (buildid, self.url))404 logger.debug("Initiating build %s on %s" % (buildid, self.url))
402405
403 # Do it.406 # Do it.
@@ -421,8 +424,9 @@
421 if currentjob is None:424 if currentjob is None:
422 return 'Idle'425 return 'Idle'
423426
424 msg = 'Building %s' % currentjob.build.title427 build = getUtility(IBuildSet).getByQueueEntry(currentjob)
425 archive = currentjob.build.archive428 msg = 'Building %s' % build.title
429 archive = build.archive
426 if not archive.owner.private and (archive.is_ppa or archive.is_copy):430 if not archive.owner.private and (archive.is_ppa or archive.is_copy):
427 return '%s [%s/%s]' % (msg, archive.owner.name, archive.name)431 return '%s [%s/%s]' % (msg, archive.owner.name, archive.name)
428 else:432 else:
@@ -553,7 +557,8 @@
553 SourcePackagePublishingHistory.status IN %s))557 SourcePackagePublishingHistory.status IN %s))
554 OR558 OR
555 archive.private IS FALSE) AND559 archive.private IS FALSE) AND
556 buildqueue.build = build.id AND560 buildqueue.job = buildpackagejob.job AND
561 buildpackagejob.build = build.id AND
557 build.distroarchseries = distroarchseries.id AND562 build.distroarchseries = distroarchseries.id AND
558 build.archive = archive.id AND563 build.archive = archive.id AND
559 archive.enabled = TRUE AND564 archive.enabled = TRUE AND
@@ -563,7 +568,8 @@
563 """ % sqlvalues(568 """ % sqlvalues(
564 private_statuses, BuildStatus.NEEDSBUILD, self.processor.family)]569 private_statuses, BuildStatus.NEEDSBUILD, self.processor.family)]
565570
566 clauseTables = ['Build', 'DistroArchSeries', 'Archive']571 clauseTables = [
572 'Build', 'BuildPackageJob', 'DistroArchSeries', 'Archive']
567573
568 clauses.append("""574 clauses.append("""
569 archive.require_virtualized = %s575 archive.require_virtualized = %s
@@ -605,7 +611,7 @@
605611
606 query = " AND ".join(clauses)612 query = " AND ".join(clauses)
607 candidate = BuildQueue.selectFirst(613 candidate = BuildQueue.selectFirst(
608 query, clauseTables=clauseTables, prejoins=['build'],614 query, clauseTables=clauseTables,
609 orderBy=['-buildqueue.lastscore', 'build.id'])615 orderBy=['-buildqueue.lastscore', 'build.id'])
610616
611 return candidate617 return candidate
@@ -629,26 +635,28 @@
629 # Builds in those situation should not be built because they will635 # Builds in those situation should not be built because they will
630 # be wasting build-time, the former case already has a newer source636 # be wasting build-time, the former case already has a newer source
631 # and the latter could not be built in DAK.637 # and the latter could not be built in DAK.
638 build_set = getUtility(IBuildSet)
632 while candidate is not None:639 while candidate is not None:
633 if candidate.build.pocket == PackagePublishingPocket.SECURITY:640 build = build_set.getByQueueEntry(candidate)
641 if build.pocket == PackagePublishingPocket.SECURITY:
634 # We never build anything in the security pocket.642 # We never build anything in the security pocket.
635 logger.debug(643 logger.debug(
636 "Build %s FAILEDTOBUILD, queue item %s REMOVED"644 "Build %s FAILEDTOBUILD, queue item %s REMOVED"
637 % (candidate.build.id, candidate.id))645 % (build.id, candidate.id))
638 candidate.build.buildstate = BuildStatus.FAILEDTOBUILD646 build.buildstate = BuildStatus.FAILEDTOBUILD
639 candidate.destroySelf()647 candidate.destroySelf()
640 candidate = self._findBuildCandidate()648 candidate = self._findBuildCandidate()
641 continue649 continue
642650
643 publication = candidate.build.current_source_publication651 publication = build.current_source_publication
644652
645 if publication is None:653 if publication is None:
646 # The build should be superseded if it no longer has a654 # The build should be superseded if it no longer has a
647 # current publishing record.655 # current publishing record.
648 logger.debug(656 logger.debug(
649 "Build %s SUPERSEDED, queue item %s REMOVED"657 "Build %s SUPERSEDED, queue item %s REMOVED"
650 % (candidate.build.id, candidate.id))658 % (build.id, candidate.id))
651 candidate.build.buildstate = BuildStatus.SUPERSEDED659 build.buildstate = BuildStatus.SUPERSEDED
652 candidate.destroySelf()660 candidate.destroySelf()
653 candidate = self._findBuildCandidate()661 candidate = self._findBuildCandidate()
654 continue662 continue
@@ -751,13 +759,15 @@
751 origin = (759 origin = (
752 Archive,760 Archive,
753 Build,761 Build,
762 BuildPackageJob,
754 BuildQueue,763 BuildQueue,
755 DistroArchSeries,764 DistroArchSeries,
756 Processor,765 Processor,
757 )766 )
758 queue = store.using(*origin).find(767 queue = store.using(*origin).find(
759 BuildQueue,768 BuildQueue,
760 BuildQueue.build == Build.id,769 BuildPackageJob.job == BuildQueue.jobID,
770 BuildPackageJob.build == Build.id,
761 Build.distroarchseries == DistroArchSeries.id,771 Build.distroarchseries == DistroArchSeries.id,
762 Build.archive == Archive.id,772 Build.archive == Archive.id,
763 DistroArchSeries.processorfamilyID == Processor.familyID,773 DistroArchSeries.processorfamilyID == Processor.familyID,
764774
=== added file 'lib/lp/soyuz/model/buildpackagejob.py'
--- lib/lp/soyuz/model/buildpackagejob.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/model/buildpackagejob.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,168 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4__metaclass__ = type
5__all__ = ['BuildPackageJob']
6
7
8from datetime import datetime
9import pytz
10
11from storm.locals import Int, Reference, Storm
12
13from zope.interface import implements
14
15from canonical.database.constants import UTC_NOW
16from canonical.launchpad.interfaces import SourcePackageUrgency
17from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
18from lp.registry.interfaces.pocket import PackagePublishingPocket
19from lp.soyuz.interfaces.archive import ArchivePurpose
20from lp.soyuz.interfaces.build import BuildStatus
21from lp.soyuz.interfaces.buildpackagejob import IBuildPackageJob
22
23
24class BuildPackageJob(Storm):
25 """See `IBuildPackageJob`."""
26 implements(IBuildFarmJob, IBuildPackageJob)
27 __storm_table__ = 'buildpackagejob'
28 id = Int(primary=True)
29
30 job_id = Int(name='job', allow_none=False)
31 job = Reference(job_id, 'Job.id')
32
33 build_id = Int(name='build', allow_none=False)
34 build = Reference(build_id, 'Build.id')
35
36 def score(self):
37 """See `IBuildPackageJob`."""
38 score_pocketname = {
39 PackagePublishingPocket.BACKPORTS: 0,
40 PackagePublishingPocket.RELEASE: 1500,
41 PackagePublishingPocket.PROPOSED: 3000,
42 PackagePublishingPocket.UPDATES: 3000,
43 PackagePublishingPocket.SECURITY: 4500,
44 }
45
46 score_componentname = {
47 'multiverse': 0,
48 'universe': 250,
49 'restricted': 750,
50 'main': 1000,
51 'partner' : 1250,
52 }
53
54 score_urgency = {
55 SourcePackageUrgency.LOW: 5,
56 SourcePackageUrgency.MEDIUM: 10,
57 SourcePackageUrgency.HIGH: 15,
58 SourcePackageUrgency.EMERGENCY: 20,
59 }
60
61 # Define a table we'll use to calculate the score based on the time
62 # in the build queue. The table is a sorted list of (upper time
63 # limit in seconds, score) tuples.
64 queue_time_scores = [
65 (14400, 100),
66 (7200, 50),
67 (3600, 20),
68 (1800, 15),
69 (900, 10),
70 (300, 5),
71 ]
72
73 private_archive_increment = 10000
74
75 # For build jobs in rebuild archives a score value of -1
76 # was chosen because their priority is lower than build retries
77 # or language-packs. They should be built only when there is
78 # nothing else to build.
79 rebuild_archive_score = -10
80
81 score = 0
82
83 # Please note: the score for language packs is to be zero because
84 # they unduly delay the building of packages in the main component
85 # otherwise.
86 if self.build.sourcepackagerelease.section.name == 'translations':
87 pass
88 elif self.build.archive.purpose == ArchivePurpose.COPY:
89 score = rebuild_archive_score
90 else:
91 # Calculates the urgency-related part of the score.
92 urgency = score_urgency[self.build.sourcepackagerelease.urgency]
93 score += urgency
94
95 # Calculates the pocket-related part of the score.
96 score_pocket = score_pocketname[self.build.pocket]
97 score += score_pocket
98
99 # Calculates the component-related part of the score.
100 score_component = score_componentname[
101 self.build.current_component.name]
102 score += score_component
103
104 # Calculates the build queue time component of the score.
105 right_now = datetime.now(pytz.timezone('UTC'))
106 eta = right_now - self.job.date_created
107 for limit, dep_score in queue_time_scores:
108 if eta.seconds > limit:
109 score += dep_score
110 break
111
112 # Private builds get uber score.
113 if self.build.archive.private:
114 score += private_archive_increment
115
116 # Lastly, apply the archive score delta. This is to boost
117 # or retard build scores for any build in a particular
118 # archive.
119 score += self.build.archive.relative_build_score
120
121 return score
122
123 def getLogFileName(self):
124 """See `IBuildPackageJob`."""
125 sourcename = self.build.sourcepackagerelease.name
126 version = self.build.sourcepackagerelease.version
127 # we rely on previous storage of current buildstate
128 # in the state handling methods.
129 state = self.build.buildstate.name
130
131 dar = self.build.distroarchseries
132 distroname = dar.distroseries.distribution.name
133 distroseriesname = dar.distroseries.name
134 archname = dar.architecturetag
135
136 # logfilename format:
137 # buildlog_<DISTRIBUTION>_<DISTROSeries>_<ARCHITECTURE>_\
138 # <SOURCENAME>_<SOURCEVERSION>_<BUILDSTATE>.txt
139 # as:
140 # buildlog_ubuntu_dapper_i386_foo_1.0-ubuntu0_FULLYBUILT.txt
141 # it fix request from bug # 30617
142 return ('buildlog_%s-%s-%s.%s_%s_%s.txt' % (
143 distroname, distroseriesname, archname, sourcename, version, state
144 ))
145
146 def getName(self):
147 """See `IBuildPackageJob`."""
148 return self.build.sourcepackagerelease.name
149
150 def jobStarted(self):
151 """See `IBuildPackageJob`."""
152 self.build.buildstate = BuildStatus.BUILDING
153 # The build started, set the start time if not set already.
154 if self.build.date_first_dispatched is None:
155 self.build.date_first_dispatched = UTC_NOW
156
157 def jobReset(self):
158 """See `IBuildPackageJob`."""
159 self.build.buildstate = BuildStatus.NEEDSBUILD
160
161 def jobAborted(self):
162 """See `IBuildPackageJob`."""
163 # XXX, al-maisan, Thu, 12 Nov 2009 16:38:52 +0100
164 # The setting below was "inherited" from the previous code. We
165 # need to investigate whether and why this is really needed and
166 # fix it.
167 self.build.buildstate = BuildStatus.BUILDING
168
0169
=== modified file 'lib/lp/soyuz/model/buildqueue.py'
--- lib/lp/soyuz/model/buildqueue.py 2009-08-28 06:39:38 +0000
+++ lib/lp/soyuz/model/buildqueue.py 2009-11-16 23:27:14 +0000
@@ -10,27 +10,25 @@
10 'BuildQueueSet'10 'BuildQueueSet'
11 ]11 ]
1212
13from datetime import datetime
14import logging13import logging
15import pytz
1614
17from zope.component import getUtility15from zope.component import getUtility
18from zope.interface import implements16from zope.interface import implements
1917
20from sqlobject import (18from sqlobject import (
21 StringCol, ForeignKey, BoolCol, IntCol, SQLObjectNotFound)19 StringCol, ForeignKey, BoolCol, IntCol, SQLObjectNotFound)
22from storm.expr import In, LeftJoin20from storm.expr import In, Join, LeftJoin
2321
24from canonical import encoding22from canonical import encoding
25from canonical.database.constants import UTC_NOW23from canonical.database.enumcol import EnumCol
26from canonical.database.datetimecol import UtcDateTimeCol
27from canonical.database.sqlbase import SQLBase, sqlvalues24from canonical.database.sqlbase import SQLBase, sqlvalues
28from canonical.launchpad.webapp.interfaces import NotFoundError25from canonical.launchpad.webapp.interfaces import NotFoundError
29from lp.registry.interfaces.sourcepackage import SourcePackageUrgency26from lp.buildmaster.interfaces.buildfarmjob import BuildFarmJobType
30from lp.soyuz.interfaces.archive import ArchivePurpose27from lp.services.job.interfaces.job import JobStatus
31from lp.soyuz.interfaces.build import BuildStatus28from lp.services.job.model.job import Job
29from lp.soyuz.interfaces.build import BuildStatus, IBuildSet
32from lp.soyuz.interfaces.buildqueue import IBuildQueue, IBuildQueueSet30from lp.soyuz.interfaces.buildqueue import IBuildQueue, IBuildQueueSet
33from lp.registry.interfaces.pocket import PackagePublishingPocket31from lp.soyuz.model.buildpackagejob import BuildPackageJob
34from canonical.launchpad.webapp.interfaces import (32from canonical.launchpad.webapp.interfaces import (
35 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)33 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
3634
@@ -40,229 +38,85 @@
40 _table = "BuildQueue"38 _table = "BuildQueue"
41 _defaultOrder = "id"39 _defaultOrder = "id"
4240
43 build = ForeignKey(dbName='build', foreignKey='Build', notNull=True)41 job = ForeignKey(dbName='job', foreignKey='Job', notNull=True)
42 job_type = EnumCol(
43 enum=BuildFarmJobType, notNull=True,
44 default=BuildFarmJobType.PACKAGEBUILD, dbName='job_type')
44 builder = ForeignKey(dbName='builder', foreignKey='Builder', default=None)45 builder = ForeignKey(dbName='builder', foreignKey='Builder', default=None)
45 created = UtcDateTimeCol(dbName='created', default=UTC_NOW)
46 buildstart = UtcDateTimeCol(dbName='buildstart', default= None)
47 logtail = StringCol(dbName='logtail', default=None)46 logtail = StringCol(dbName='logtail', default=None)
48 lastscore = IntCol(dbName='lastscore', default=0)47 lastscore = IntCol(dbName='lastscore', default=0)
49 manual = BoolCol(dbName='manual', default=False)48 manual = BoolCol(dbName='manual', default=False)
5049
50 @property
51 def specific_job(self):
52 """See `IBuildQueue`."""
53 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
54 result_set = store.find(
55 BuildPackageJob, BuildPackageJob.job == self.job)
56 return result_set.one()
57
58 @property
59 def date_started(self):
60 """See `IBuildQueue`."""
61 return self.job.date_started
62
51 def manualScore(self, value):63 def manualScore(self, value):
52 """See `IBuildQueue`."""64 """See `IBuildQueue`."""
53 self.lastscore = value65 self.lastscore = value
54 self.manual = True66 self.manual = True
5567
56 @property
57 def archseries(self):
58 """See `IBuildQueue`."""
59 return self.build.distroarchseries
60
61 @property
62 def urgency(self):
63 """See `IBuildQueue`."""
64 return self.build.sourcepackagerelease.urgency
65
66 @property
67 def archhintlist(self):
68 """See `IBuildQueue`."""
69 return self.build.sourcepackagerelease.architecturehintlist
70
71 @property
72 def name(self):
73 """See `IBuildQueue`."""
74 return self.build.sourcepackagerelease.name
75
76 @property
77 def version(self):
78 """See `IBuildQueue`."""
79 return self.build.sourcepackagerelease.version
80
81 @property
82 def files(self):
83 """See `IBuildQueue`."""
84 return self.build.sourcepackagerelease.files
85
86 @property
87 def builddependsindep(self):
88 """See `IBuildQueue`."""
89 return self.build.sourcepackagerelease.builddependsindep
90
91 @property
92 def buildduration(self):
93 """See `IBuildQueue`."""
94 if self.buildstart:
95 UTC = pytz.timezone('UTC')
96 now = datetime.now(UTC)
97 return now - self.buildstart
98 return None
99
100 @property
101 def is_virtualized(self):
102 """See `IBuildQueue`."""
103 return self.build.is_virtualized
104
105 def score(self):68 def score(self):
106 """See `IBuildQueue`."""69 """See `IBuildQueue`."""
107 # Grab any logger instance available.70 # Grab any logger instance available.
108 logger = logging.getLogger()71 logger = logging.getLogger()
72 name = self.specific_job.getName()
10973
110 if self.manual:74 if self.manual:
111 logger.debug(75 logger.debug(
112 "%s (%d) MANUALLY RESCORED" % (self.name, self.lastscore))76 "%s (%d) MANUALLY RESCORED" % (name, self.lastscore))
113 return77 return
11478
115 # XXX Al-maisan, 2008-05-14 (bug #230330):79 # Allow the `IBuildFarmJob` instance with the data/logic specific to
116 # We keep touching the code here whenever a modification to the80 # the job at hand to calculate the score as appropriate.
117 # scoring parameters/weights is needed. Maybe the latter can be81 self.lastscore = self.specific_job.score()
118 # externalized?
119
120 score_pocketname = {
121 PackagePublishingPocket.BACKPORTS: 0,
122 PackagePublishingPocket.RELEASE: 1500,
123 PackagePublishingPocket.PROPOSED: 3000,
124 PackagePublishingPocket.UPDATES: 3000,
125 PackagePublishingPocket.SECURITY: 4500,
126 }
127
128 score_componentname = {
129 'multiverse': 0,
130 'universe': 250,
131 'restricted': 750,
132 'main': 1000,
133 'partner' : 1250,
134 }
135
136 score_urgency = {
137 SourcePackageUrgency.LOW: 5,
138 SourcePackageUrgency.MEDIUM: 10,
139 SourcePackageUrgency.HIGH: 15,
140 SourcePackageUrgency.EMERGENCY: 20,
141 }
142
143 # Define a table we'll use to calculate the score based on the time
144 # in the build queue. The table is a sorted list of (upper time
145 # limit in seconds, score) tuples.
146 queue_time_scores = [
147 (14400, 100),
148 (7200, 50),
149 (3600, 20),
150 (1800, 15),
151 (900, 10),
152 (300, 5),
153 ]
154
155 private_archive_increment = 10000
156
157 # For build jobs in rebuild archives a score value of -1
158 # was chosen because their priority is lower than build retries
159 # or language-packs. They should be built only when there is
160 # nothing else to build.
161 rebuild_archive_score = -10
162
163 score = 0
164 msg = "%s (%d) -> " % (self.build.title, self.lastscore)
165
166 # Please note: the score for language packs is to be zero because
167 # they unduly delay the building of packages in the main component
168 # otherwise.
169 if self.build.sourcepackagerelease.section.name == 'translations':
170 msg += "LPack => score zero"
171 elif self.build.archive.purpose == ArchivePurpose.COPY:
172 score = rebuild_archive_score
173 msg += "Rebuild archive => -10"
174 else:
175 # Calculates the urgency-related part of the score.
176 urgency = score_urgency[self.urgency]
177 score += urgency
178 msg += "U+%d " % urgency
179
180 # Calculates the pocket-related part of the score.
181 score_pocket = score_pocketname[self.build.pocket]
182 score += score_pocket
183 msg += "P+%d " % score_pocket
184
185 # Calculates the component-related part of the score.
186 score_component = score_componentname[
187 self.build.current_component.name]
188 score += score_component
189 msg += "C+%d " % score_component
190
191 # Calculates the build queue time component of the score.
192 right_now = datetime.now(pytz.timezone('UTC'))
193 eta = right_now - self.created
194 for limit, dep_score in queue_time_scores:
195 if eta.seconds > limit:
196 score += dep_score
197 msg += "T+%d " % dep_score
198 break
199 else:
200 msg += "T+0 "
201
202 # Private builds get uber score.
203 if self.build.archive.private:
204 score += private_archive_increment
205
206 # Lastly, apply the archive score delta. This is to boost
207 # or retard build scores for any build in a particular
208 # archive.
209 score += self.build.archive.relative_build_score
210
211 # Store current score value.
212 self.lastscore = score
213
214 logger.debug("%s= %d" % (msg, self.lastscore))
21582
216 def getLogFileName(self):83 def getLogFileName(self):
217 """See `IBuildQueue`."""84 """See `IBuildQueue`."""
218 sourcename = self.build.sourcepackagerelease.name85 # Allow the `IBuildFarmJob` instance with the data/logic specific to
219 version = self.build.sourcepackagerelease.version86 # the job at hand to calculate the log file name as appropriate.
220 # we rely on previous storage of current buildstate87 return self.specific_job.getLogFileName()
221 # in the state handling methods.
222 state = self.build.buildstate.name
223
224 dar = self.build.distroarchseries
225 distroname = dar.distroseries.distribution.name
226 distroseriesname = dar.distroseries.name
227 archname = dar.architecturetag
228
229 # logfilename format:
230 # buildlog_<DISTRIBUTION>_<DISTROSeries>_<ARCHITECTURE>_\
231 # <SOURCENAME>_<SOURCEVERSION>_<BUILDSTATE>.txt
232 # as:
233 # buildlog_ubuntu_dapper_i386_foo_1.0-ubuntu0_FULLYBUILT.txt
234 # it fix request from bug # 30617
235 return ('buildlog_%s-%s-%s.%s_%s_%s.txt' % (
236 distroname, distroseriesname, archname, sourcename, version, state
237 ))
23888
239 def markAsBuilding(self, builder):89 def markAsBuilding(self, builder):
240 """See `IBuildQueue`."""90 """See `IBuildQueue`."""
241 self.builder = builder91 self.builder = builder
242 self.buildstart = UTC_NOW92 if self.job.status != JobStatus.RUNNING:
243 self.build.buildstate = BuildStatus.BUILDING93 self.job.start()
244 # The build started, set the start time if not set already.94 self.specific_job.jobStarted()
245 if self.build.date_first_dispatched is None:
246 self.build.date_first_dispatched = UTC_NOW
24795
248 def reset(self):96 def reset(self):
249 """See `IBuildQueue`."""97 """See `IBuildQueue`."""
250 self.builder = None98 self.builder = None
251 self.buildstart = None99 if self.job.status != JobStatus.WAITING:
100 self.job.queue()
101 self.job.date_started = None
102 self.job.date_finished = None
252 self.logtail = None103 self.logtail = None
253 self.build.buildstate = BuildStatus.NEEDSBUILD104 self.specific_job.jobReset()
254105
255 def updateBuild_IDLE(self, build_id, build_status, logtail,106 def updateBuild_IDLE(self, build_id, build_status, logtail,
256 filemap, dependencies, logger):107 filemap, dependencies, logger):
257 """See `IBuildQueue`."""108 """See `IBuildQueue`."""
109 build = getUtility(IBuildSet).getByQueueEntry(self)
258 logger.warn(110 logger.warn(
259 "Builder %s forgot about build %s -- resetting buildqueue record"111 "Builder %s forgot about build %s -- resetting buildqueue record"
260 % (self.builder.url, self.build.title))112 % (self.builder.url, build.title))
261 self.reset()113 self.reset()
262114
263 def updateBuild_BUILDING(self, build_id, build_status,115 def updateBuild_BUILDING(self, build_id, build_status,
264 logtail, filemap, dependencies, logger):116 logtail, filemap, dependencies, logger):
265 """See `IBuildQueue`."""117 """See `IBuildQueue`."""
118 if self.job.status != JobStatus.RUNNING:
119 self.job.start()
266 self.logtail = encoding.guess(str(logtail))120 self.logtail = encoding.guess(str(logtail))
267121
268 def updateBuild_ABORTING(self, buildid, build_status,122 def updateBuild_ABORTING(self, buildid, build_status,
@@ -275,8 +129,15 @@
275 """See `IBuildQueue`."""129 """See `IBuildQueue`."""
276 self.builder.cleanSlave()130 self.builder.cleanSlave()
277 self.builder = None131 self.builder = None
278 self.buildstart = None132 if self.job.status != JobStatus.FAILED:
279 self.build.buildstate = BuildStatus.BUILDING133 self.job.fail()
134 self.job.date_started = None
135 self.job.date_finished = None
136 self.specific_job.jobAborted()
137
138 def setDateStarted(self, timestamp):
139 """See `IBuildQueue`."""
140 self.job.date_started = timestamp
280141
281142
282class BuildQueueSet(object):143class BuildQueueSet(object):
@@ -311,7 +172,12 @@
311172
312 def getActiveBuildJobs(self):173 def getActiveBuildJobs(self):
313 """See `IBuildQueueSet`."""174 """See `IBuildQueueSet`."""
314 return BuildQueue.select('buildstart is not null')175 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
176 result_set = store.find(
177 BuildQueue,
178 BuildQueue.job == Job.id,
179 Job.date_started != None)
180 return result_set
315181
316 def calculateCandidates(self, archseries):182 def calculateCandidates(self, archseries):
317 """See `IBuildQueueSet`."""183 """See `IBuildQueueSet`."""
@@ -323,30 +189,37 @@
323 query = """189 query = """
324 Build.distroarchseries IN %s AND190 Build.distroarchseries IN %s AND
325 Build.buildstate = %s AND191 Build.buildstate = %s AND
326 BuildQueue.build = build.id AND192 BuildQueue.job_type = %s AND
193 BuildQueue.job = BuildPackageJob.job AND
194 BuildPackageJob.build = build.id AND
327 BuildQueue.builder IS NULL195 BuildQueue.builder IS NULL
328 """ % sqlvalues(arch_ids, BuildStatus.NEEDSBUILD)196 """ % sqlvalues(
197 arch_ids, BuildStatus.NEEDSBUILD, BuildFarmJobType.PACKAGEBUILD)
329198
330 candidates = BuildQueue.select(199 candidates = BuildQueue.select(
331 query, clauseTables=['Build'], orderBy=['-BuildQueue.lastscore'])200 query, clauseTables=['Build', 'BuildPackageJob'],
201 orderBy=['-BuildQueue.lastscore'])
332202
333 return candidates203 return candidates
334204
335 def getForBuilds(self, build_ids):205 def getForBuilds(self, build_ids):
336 """See `IBuildQueueSet`."""206 """See `IBuildQueueSet`."""
337 # Avoid circular import problem.207 # Avoid circular import problem.
208 from lp.soyuz.model.build import Build
338 from lp.soyuz.model.builder import Builder209 from lp.soyuz.model.builder import Builder
339210
340 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)211 store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
341212
342 origin = (213 origin = (
343 BuildQueue,214 BuildPackageJob,
215 Join(BuildQueue, BuildPackageJob.job == BuildQueue.jobID),
216 Join(Build, BuildPackageJob.build == Build.id),
344 LeftJoin(217 LeftJoin(
345 Builder,218 Builder,
346 BuildQueue.builderID == Builder.id),219 BuildQueue.builderID == Builder.id),
347 )220 )
348 result_set = store.using(*origin).find(221 result_set = store.using(*origin).find(
349 (BuildQueue, Builder),222 (BuildQueue, Builder, BuildPackageJob),
350 In(BuildQueue.buildID, build_ids))223 In(Build.id, build_ids))
351224
352 return result_set225 return result_set
353226
=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py 2009-10-26 11:51:40 +0000
+++ lib/lp/soyuz/model/queue.py 2009-11-16 23:27:14 +0000
@@ -1468,7 +1468,8 @@
1468 published_sha1 = published_file.content.sha11468 published_sha1 = published_file.content.sha1
14691469
1470 # Multiple orig(s) with the same content are fine.1470 # Multiple orig(s) with the same content are fine.
1471 if source_file.filetype == SourcePackageFileType.ORIG:1471 if source_file.filetype == (
1472 SourcePackageFileType.ORIG_TARBALL):
1472 if proposed_sha1 == published_sha1:1473 if proposed_sha1 == published_sha1:
1473 continue1474 continue
1474 raise QueueInconsistentStateError(1475 raise QueueInconsistentStateError(
14751476
=== added file 'lib/lp/soyuz/model/sourcepackageformat.py'
--- lib/lp/soyuz/model/sourcepackageformat.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/model/sourcepackageformat.py 2009-11-16 23:27:14 +0000
@@ -0,0 +1,56 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4__metaclass__ = type
5
6__all__ = [
7 'SourcePackageFormatSelection',
8 'SourcePackageFormatSelectionSet',
9 ]
10
11from storm.locals import Storm, Int, Reference
12from zope.component import getUtility
13from zope.interface import implements
14
15from canonical.launchpad.webapp.interfaces import (
16 IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR, MASTER_FLAVOR)
17from canonical.database.enumcol import DBEnum
18from lp.soyuz.interfaces.sourcepackageformat import (
19 ISourcePackageFormatSelection, ISourcePackageFormatSelectionSet,
20 SourcePackageFormat)
21
22
23class SourcePackageFormatSelection(Storm):
24 """See ISourcePackageFormatSelection."""
25
26 implements(ISourcePackageFormatSelection)
27
28 __storm_table__ = 'sourcepackageformatselection'
29
30 id = Int(primary=True)
31
32 distroseries_id = Int(name="distroseries")
33 distroseries = Reference(distroseries_id, 'DistroSeries.id')
34
35 format = DBEnum(enum=SourcePackageFormat)
36
37
38class SourcePackageFormatSelectionSet:
39 """See ISourcePackageFormatSelectionSet."""
40
41 implements(ISourcePackageFormatSelectionSet)
42
43 def getBySeriesAndFormat(self, distroseries, format):
44 """See `ISourcePackageFormatSelection`."""
45 return getUtility(IStoreSelector).get(
46 MAIN_STORE, DEFAULT_FLAVOR).find(
47 SourcePackageFormatSelection, distroseries=distroseries,
48 format=format).one()
49
50 def add(self, distroseries, format):
51 """See `ISourcePackageFormatSelection`."""
52 spfs = SourcePackageFormatSelection()
53 spfs.distroseries = distroseries
54 spfs.format = format
55 return getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR).add(
56 spfs)
057
=== modified file 'lib/lp/soyuz/model/sourcepackagerelease.py'
--- lib/lp/soyuz/model/sourcepackagerelease.py 2009-11-07 09:50:37 +0000
+++ lib/lp/soyuz/model/sourcepackagerelease.py 2009-11-16 23:27:14 +0000
@@ -36,6 +36,7 @@
36from lp.translations.interfaces.translationimportqueue import (36from lp.translations.interfaces.translationimportqueue import (
37 ITranslationImportQueue)37 ITranslationImportQueue)
38from canonical.launchpad.webapp.interfaces import NotFoundError38from canonical.launchpad.webapp.interfaces import NotFoundError
39from lp.archiveuploader.utils import determine_source_file_type
39from lp.soyuz.interfaces.archive import (40from lp.soyuz.interfaces.archive import (
40 ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES)41 ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES)
41from lp.soyuz.interfaces.build import BuildStatus42from lp.soyuz.interfaces.build import BuildStatus
@@ -52,7 +53,7 @@
52from lp.soyuz.scripts.queue import QueueActionError53from lp.soyuz.scripts.queue import QueueActionError
53from lp.registry.interfaces.person import validate_public_person54from lp.registry.interfaces.person import validate_public_person
54from lp.registry.interfaces.sourcepackage import (55from lp.registry.interfaces.sourcepackage import (
55 SourcePackageFileType, SourcePackageType, SourcePackageUrgency)56 SourcePackageType, SourcePackageUrgency)
5657
5758
58def _filter_ubuntu_translation_file(filename):59def _filter_ubuntu_translation_file(filename):
@@ -271,19 +272,10 @@
271272
272 def addFile(self, file):273 def addFile(self, file):
273 """See ISourcePackageRelease."""274 """See ISourcePackageRelease."""
274 determined_filetype = None275 return SourcePackageReleaseFile(
275 if file.filename.endswith(".dsc"):276 sourcepackagerelease=self,
276 determined_filetype = SourcePackageFileType.DSC277 filetype=determine_source_file_type(file.filename),
277 elif file.filename.endswith(".orig.tar.gz"):278 libraryfile=file)
278 determined_filetype = SourcePackageFileType.ORIG
279 elif file.filename.endswith(".diff.gz"):
280 determined_filetype = SourcePackageFileType.DIFF
281 elif file.filename.endswith(".tar.gz"):
282 determined_filetype = SourcePackageFileType.TARBALL
283
284 return SourcePackageReleaseFile(sourcepackagerelease=self,
285 filetype=determined_filetype,
286 libraryfile=file)
287279
288 def _getPackageSize(self):280 def _getPackageSize(self):
289 """Get the size total (in KB) of files comprising this package.281 """Get the size total (in KB) of files comprising this package.
290282
=== modified file 'lib/lp/soyuz/scripts/packagecopier.py'
--- lib/lp/soyuz/scripts/packagecopier.py 2009-10-29 12:18:05 +0000
+++ lib/lp/soyuz/scripts/packagecopier.py 2009-11-16 23:27:14 +0000
@@ -36,6 +36,7 @@
36 ISourcePackagePublishingHistory, active_publishing_status)36 ISourcePackagePublishingHistory, active_publishing_status)
37from lp.soyuz.interfaces.queue import (37from lp.soyuz.interfaces.queue import (
38 IPackageUpload, IPackageUploadSet)38 IPackageUpload, IPackageUploadSet)
39from lp.soyuz.interfaces.sourcepackageformat import SourcePackageFormat
39from lp.soyuz.scripts.ftpmasterbase import (40from lp.soyuz.scripts.ftpmasterbase import (
40 SoyuzScript, SoyuzScriptError)41 SoyuzScript, SoyuzScriptError)
41from lp.soyuz.scripts.processaccepted import (42from lp.soyuz.scripts.processaccepted import (
@@ -356,6 +357,14 @@
356 "Cannot copy to an unsupported distribution: %s." %357 "Cannot copy to an unsupported distribution: %s." %
357 source.distroseries.distribution.name)358 source.distroseries.distribution.name)
358359
360 format = SourcePackageFormat.getTermByToken(
361 source.sourcepackagerelease.dsc_format).value
362
363 if not series.isSourcePackageFormatPermitted(format):
364 raise CannotCopy(
365 "Source format '%s' not supported by target series %s." %
366 (source.sourcepackagerelease.dsc_format, series.name))
367
359 if self.include_binaries:368 if self.include_binaries:
360 built_binaries = source.getBuiltBinaries()369 built_binaries = source.getBuiltBinaries()
361 if len(built_binaries) == 0:370 if len(built_binaries) == 0:
362371
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-10-05 18:29:12 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-11-16 23:27:14 +0000
@@ -37,6 +37,8 @@
37 PackagePublishingStatus, active_publishing_status)37 PackagePublishingStatus, active_publishing_status)
38from lp.soyuz.interfaces.queue import (38from lp.soyuz.interfaces.queue import (
39 PackageUploadCustomFormat, PackageUploadStatus)39 PackageUploadCustomFormat, PackageUploadStatus)
40from lp.soyuz.interfaces.sourcepackageformat import (
41 ISourcePackageFormatSelectionSet, SourcePackageFormat)
40from lp.soyuz.model.publishing import (42from lp.soyuz.model.publishing import (
41 SecureSourcePackagePublishingHistory,43 SecureSourcePackagePublishingHistory,
42 SecureBinaryPackagePublishingHistory)44 SecureBinaryPackagePublishingHistory)
@@ -720,6 +722,32 @@
720 'Cannot copy to an unsupported distribution: ubuntu.',722 'Cannot copy to an unsupported distribution: ubuntu.',
721 copy_checker.checkCopy, source, series, pocket)723 copy_checker.checkCopy, source, series, pocket)
722724
725 def test_checkCopy_respects_sourceformatselection(self):
726 # A source copy should be denied if the source's dsc_format is
727 # not permitted in the target series.
728
729 # Get hoary, and configure it to accept 3.0 (quilt) uploads.
730 ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
731 hoary = ubuntu.getSeries('hoary')
732 getUtility(ISourcePackageFormatSelectionSet).add(
733 hoary, SourcePackageFormat.FORMAT_3_0_QUILT)
734
735 # Create a 3.0 (quilt) source.
736 source = self.test_publisher.getPubSource(
737 distroseries=hoary, dsc_format='3.0 (quilt)')
738
739 archive = source.archive
740 series = ubuntu.getSeries('warty')
741 pocket = source.pocket
742
743 # An attempt to copy the source to warty, which only supports
744 # 1.0 sources, is rejected.
745 copy_checker = CopyChecker(archive, include_binaries=True)
746 self.assertRaisesWithContent(
747 CannotCopy,
748 "Source format '3.0 (quilt)' not supported by target series "
749 "warty.", copy_checker.checkCopy, source, series, pocket)
750
723 def test_checkCopy_identifies_conflicting_copy_candidates(self):751 def test_checkCopy_identifies_conflicting_copy_candidates(self):
724 # checkCopy() is able to identify conflicting candidates within752 # checkCopy() is able to identify conflicting candidates within
725 # the copy batch.753 # the copy batch.
726754
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2009-09-23 16:38:10 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2009-11-16 23:27:14 +0000
@@ -23,8 +23,9 @@
23 >>> bob_builder.builderok = True23 >>> bob_builder.builderok = True
2424
25 # Set a known duration for the current job.25 # Set a known duration for the current job.
26 >>> in_progress_build = removeSecurityProxy(26 >>> from lp.soyuz.interfaces.build import IBuildSet
27 ... bob_builder.currentjob.build)27 >>> build2 = getUtility(IBuildSet).getByQueueEntry(bob_builder.currentjob)
28 >>> in_progress_build = removeSecurityProxy(build2)
28 >>> one_minute = datetime.timedelta(seconds=60)29 >>> one_minute = datetime.timedelta(seconds=60)
29 >>> in_progress_build.estimated_build_duration = one_minute30 >>> in_progress_build.estimated_build_duration = one_minute
3031
@@ -122,12 +123,8 @@
122 >>> login('foo.bar@canonical.com')123 >>> login('foo.bar@canonical.com')
123 >>> from canonical.database.constants import UTC_NOW124 >>> from canonical.database.constants import UTC_NOW
124 >>> from lp.soyuz.interfaces.build import BuildStatus125 >>> from lp.soyuz.interfaces.build import BuildStatus
125 >>> in_progress_build.buildstate = BuildStatus.NEEDSBUILD126 >>> in_progress_build.buildqueue_record.reset()
126 >>> in_progress_build.buildqueue_record.buildstart = None127 >>> build.buildqueue_record.markAsBuilding(bob_builder)
127 >>> in_progress_build.buildqueue_record.builder = None
128 >>> build.buildstate = BuildStatus.BUILDING
129 >>> build.buildqueue_record.buildstart = UTC_NOW
130 >>> build.buildqueue_record.builder = bob_builder
131 >>> build.buildqueue_record.logtail = 'one line\nanother line'128 >>> build.buildqueue_record.logtail = 'one line\nanother line'
132 >>> logout()129 >>> logout()
133130
134131
=== modified file 'lib/lp/soyuz/templates/build-index.pt'
--- lib/lp/soyuz/templates/build-index.pt 2009-09-17 12:08:45 +0000
+++ lib/lp/soyuz/templates/build-index.pt 2009-11-16 23:27:14 +0000
@@ -161,8 +161,8 @@
161 <tal:building condition="context/buildstate/enumvalue:BUILDING">161 <tal:building condition="context/buildstate/enumvalue:BUILDING">
162 <li>162 <li>
163 Started163 Started
164 <span tal:attributes="title view/buildqueue/buildstart/fmt:datetime"164 <span tal:attributes="title view/buildqueue/job/date_started/fmt:datetime"
165 tal:content="view/buildqueue/buildstart/fmt:approximatedate"165 tal:content="view/buildqueue/job/date_started/fmt:approximatedate"
166 >5 minutes ago</span>166 >5 minutes ago</span>
167 </li>167 </li>
168 </tal:building>168 </tal:building>
169169
=== modified file 'lib/lp/soyuz/templates/builder-index.pt'
--- lib/lp/soyuz/templates/builder-index.pt 2009-09-16 19:06:48 +0000
+++ lib/lp/soyuz/templates/builder-index.pt 2009-11-16 23:27:14 +0000
@@ -104,9 +104,14 @@
104 </tal:buildernok>104 </tal:buildernok>
105 </tal:no_job>105 </tal:no_job>
106106
107 <tal:comment replace="nothing">
108 In the very near future, 'job' will not just be a Build job.
109 The template needs to cope with that as and when new job types are
110 added.
111 </tal:comment>
107 <tal:job condition="job">112 <tal:job condition="job">
108 <span class="sortkey" tal:content="job/id" />113 <span class="sortkey" tal:content="job/id" />
109 <tal:build define="build job/build">114 <tal:build define="build job/specific_job/build">
110 <tal:visible condition="build/required:launchpad.View">115 <tal:visible condition="build/required:launchpad.View">
111 <tal:icon replace="structure build/image:icon" />116 <tal:icon replace="structure build/image:icon" />
112 Building117 Building
@@ -153,10 +158,12 @@
153158
154 <tal:job condition="job">159 <tal:job condition="job">
155 <p class="sprite">Started160 <p class="sprite">Started
156 <span tal:attributes="title job/buildstart/fmt:datetime"161 <span tal:attributes="title job/job/date_started/fmt:datetime"
157 tal:content="view/current_build_duration/fmt:exactduration"162 tal:content="view/current_build_duration/fmt:exactduration"
158 /> ago.</p>163 /> ago.</p>
159 <tal:visible condition="job/build/required:launchpad.View">164 <tal:visible
165 define="build job/specific_job/build"
166 condition="build/required:launchpad.View">
160 <tal:logtail condition="job/logtail">167 <tal:logtail condition="job/logtail">
161 <h3>Buildlog</h3>168 <h3>Buildlog</h3>
162 <div tal:content="structure job/logtail/fmt:text-to-html"169 <div tal:content="structure job/logtail/fmt:text-to-html"
163170
=== modified file 'lib/lp/soyuz/templates/builds-list.pt'
--- lib/lp/soyuz/templates/builds-list.pt 2009-08-18 12:33:37 +0000
+++ lib/lp/soyuz/templates/builds-list.pt 2009-11-16 23:27:14 +0000
@@ -101,8 +101,8 @@
101 <tal:building condition="bq/builder">101 <tal:building condition="bq/builder">
102 Build started102 Build started
103 <span103 <span
104 tal:attributes="title bq/buildstart/fmt:datetime"104 tal:attributes="title bq/job/date_started/fmt:datetime"
105 tal:content="bq/buildstart/fmt:displaydate" />105 tal:content="bq/job/date_started/fmt:displaydate" />
106 on106 on
107 <a tal:content="bq/builder/title"107 <a tal:content="bq/builder/title"
108 tal:attributes="href bq/builder/fmt:url"/>108 tal:attributes="href bq/builder/fmt:url"/>
109109
=== modified file 'lib/lp/soyuz/tests/test_builder.py'
--- lib/lp/soyuz/tests/test_builder.py 2009-11-11 10:43:07 +0000
+++ lib/lp/soyuz/tests/test_builder.py 2009-11-16 23:27:14 +0000
@@ -9,8 +9,8 @@
99
10from canonical.testing import LaunchpadZopelessLayer10from canonical.testing import LaunchpadZopelessLayer
11from lp.soyuz.interfaces.archive import ArchivePurpose11from lp.soyuz.interfaces.archive import ArchivePurpose
12from lp.soyuz.interfaces.build import BuildStatus, IBuildSet
12from lp.soyuz.interfaces.builder import IBuilderSet13from lp.soyuz.interfaces.builder import IBuilderSet
13from lp.soyuz.interfaces.build import BuildStatus
14from lp.soyuz.interfaces.publishing import PackagePublishingStatus14from lp.soyuz.interfaces.publishing import PackagePublishingStatus
15from lp.soyuz.tests.test_publishing import SoyuzTestPublisher15from lp.soyuz.tests.test_publishing import SoyuzTestPublisher
16from lp.testing import TestCaseWithFactory16from lp.testing import TestCaseWithFactory
@@ -77,14 +77,16 @@
7777
78 # Asking frog to find a candidate should give us the joesppa build.78 # Asking frog to find a candidate should give us the joesppa build.
79 next_job = self.frog_builder.findBuildCandidate()79 next_job = self.frog_builder.findBuildCandidate()
80 self.assertEqual('joesppa', next_job.build.archive.name)80 build = getUtility(IBuildSet).getByQueueEntry(next_job)
81 self.assertEqual('joesppa', build.archive.name)
8182
82 # If bob is in a failed state the joesppa build is still83 # If bob is in a failed state the joesppa build is still
83 # returned.84 # returned.
84 self.bob_builder.builderok = False85 self.bob_builder.builderok = False
85 self.bob_builder.manual = False86 self.bob_builder.manual = False
86 next_job = self.frog_builder.findBuildCandidate()87 next_job = self.frog_builder.findBuildCandidate()
87 self.assertEqual('joesppa', next_job.build.archive.name)88 build = getUtility(IBuildSet).getByQueueEntry(next_job)
89 self.assertEqual('joesppa', build.archive.name)
8890
8991
90class TestFindBuildCandidatePPA(TestFindBuildCandidateBase):92class TestFindBuildCandidatePPA(TestFindBuildCandidateBase):
@@ -156,14 +158,16 @@
156 # A PPA cannot start a build if it would use 80% or more of the158 # A PPA cannot start a build if it would use 80% or more of the
157 # builders.159 # builders.
158 next_job = self.builder4.findBuildCandidate()160 next_job = self.builder4.findBuildCandidate()
159 self.failIfEqual('joesppa', next_job.build.archive.name)161 build = getUtility(IBuildSet).getByQueueEntry(next_job)
162 self.failIfEqual('joesppa', build.archive.name)
160163
161 def test_findBuildCandidate_first_build_finished(self):164 def test_findBuildCandidate_first_build_finished(self):
162 # When joe's first ppa build finishes, his fourth i386 build165 # When joe's first ppa build finishes, his fourth i386 build
163 # will be the next build candidate.166 # will be the next build candidate.
164 self.joe_builds[0].buildstate = BuildStatus.FAILEDTOBUILD167 self.joe_builds[0].buildstate = BuildStatus.FAILEDTOBUILD
165 next_job = self.builder4.findBuildCandidate()168 next_job = self.builder4.findBuildCandidate()
166 self.failUnlessEqual('joesppa', next_job.build.archive.name)169 build = getUtility(IBuildSet).getByQueueEntry(next_job)
170 self.failUnlessEqual('joesppa', build.archive.name)
167171
168 def test_findBuildCandidate_for_private_ppa(self):172 def test_findBuildCandidate_for_private_ppa(self):
169 # If a ppa is private it will be able to have parallel builds173 # If a ppa is private it will be able to have parallel builds
@@ -171,7 +175,8 @@
171 self.ppa_joe.private = True175 self.ppa_joe.private = True
172 self.ppa_joe.buildd_secret = 'sekrit'176 self.ppa_joe.buildd_secret = 'sekrit'
173 next_job = self.builder4.findBuildCandidate()177 next_job = self.builder4.findBuildCandidate()
174 self.failUnlessEqual('joesppa', next_job.build.archive.name)178 build = getUtility(IBuildSet).getByQueueEntry(next_job)
179 self.failUnlessEqual('joesppa', build.archive.name)
175180
176181
177class TestFindBuildCandidateDistroArchive(TestFindBuildCandidateBase):182class TestFindBuildCandidateDistroArchive(TestFindBuildCandidateBase):
@@ -196,18 +201,18 @@
196 # arch.201 # arch.
197202
198 next_job = self.builder2.findBuildCandidate()203 next_job = self.builder2.findBuildCandidate()
199 self.failUnlessEqual('primary', next_job.build.archive.name)204 build = getUtility(IBuildSet).getByQueueEntry(next_job)
200 self.failUnlessEqual(205 self.failUnlessEqual('primary', build.archive.name)
201 'gedit', next_job.build.sourcepackagerelease.name)206 self.failUnlessEqual('gedit', build.sourcepackagerelease.name)
202207
203 # Now even if we set the build building, we'll still get the208 # Now even if we set the build building, we'll still get the
204 # second non-ppa build for the same archive as the next candidate.209 # second non-ppa build for the same archive as the next candidate.
205 next_job.build.buildstate = BuildStatus.BUILDING210 build.buildstate = BuildStatus.BUILDING
206 next_job.build.builder = self.builder2211 build.builder = self.builder2
207 next_job = self.builder2.findBuildCandidate()212 next_job = self.builder2.findBuildCandidate()
208 self.failUnlessEqual('primary', next_job.build.archive.name)213 build = getUtility(IBuildSet).getByQueueEntry(next_job)
209 self.failUnlessEqual(214 self.failUnlessEqual('primary', build.archive.name)
210 'firefox', next_job.build.sourcepackagerelease.name)215 self.failUnlessEqual('firefox', build.sourcepackagerelease.name)
211216
212def test_suite():217def test_suite():
213 return unittest.TestLoader().loadTestsFromName(__name__)218 return unittest.TestLoader().loadTestsFromName(__name__)
214219
=== modified file 'lib/lp/translations/tests/test_translations_to_review.py'
--- lib/lp/translations/tests/test_translations_to_review.py 2009-08-19 16:48:17 +0000
+++ lib/lp/translations/tests/test_translations_to_review.py 2009-11-16 23:27:14 +0000
@@ -78,7 +78,7 @@
78 translator=self.person, translations=['bi'],78 translator=self.person, translations=['bi'],
79 date_updated=self.base_time)79 date_updated=self.base_time)
8080
81 later_time = self.base_time + timedelta(0, 0, 1)81 later_time = self.base_time + timedelta(0, 3600)
82 self.suggestion = removeSecurityProxy(82 self.suggestion = removeSecurityProxy(
83 self.factory.makeTranslationMessage(83 self.factory.makeTranslationMessage(
84 potmsgset=self.potmsgset, pofile=self.pofile,84 potmsgset=self.potmsgset, pofile=self.pofile,