Merge lp:~cprov/launchpad/queue-builder-fixes into lp:launchpad

Proposed by Celso Providelo
Status: Merged
Merged at revision: not available
Proposed branch: lp:~cprov/launchpad/queue-builder-fixes
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~cprov/launchpad/queue-builder-fixes
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+10623@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

= Summary =

This branch contains a fix for https://bugs.edge.launchpad.net/soyuz/+bug/418099.

It simply excludes source publications from COPY archives (test-rebuilds) from the build creation/verification loop.

Most of the test-rebuild are created for a restricted set of architectures and corresponding builds are created while initializing the archive, we should not re-process them otherwise unrequested builds will be created.

Moreover, test-rebuild archives are static, they don't receive new uploads neither respect the mutable architecture blacklist, so there is not need to re-process them.

In order to be eligible for cherrypicking, in this branch I'm only tweaking the source publication lookup query and adjusting the corresponding doctest to prove it works.

Later on, I will find time to rewrite the lookup query in storm-syntax and move it out from IDistroSeries, but that still pending a longer pre-impl call.

== Tests ==

./bin/test -vv -t buildd-queuebuilder-lookup.txt

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/model/distroseries.py
  lib/lp/soyuz/doc/buildd-queuebuilder-lookup.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqS9j8ACgkQ7KBXuXyZSjC+2QCgg6GgDydNyef85CkJiCKm1gs0
qK8AniSGwLxkpxWi0On6gZ7VksEmhWQW
=fI56
-----END PGP SIGNATURE-----

Revision history for this message
Graham Binns (gmb) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/model/distroseries.py'
2--- lib/lp/registry/model/distroseries.py 2009-08-03 13:00:37 +0000
3+++ lib/lp/registry/model/distroseries.py 2009-08-24 20:05:36 +0000
4@@ -88,7 +88,7 @@
5 StructuralSubscriptionTargetMixin)
6 from canonical.launchpad.helpers import shortlist
7 from lp.soyuz.interfaces.archive import (
8- ALLOW_RELEASE_BUILDS, IArchiveSet, MAIN_ARCHIVE_PURPOSES)
9+ ALLOW_RELEASE_BUILDS, ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES)
10 from lp.soyuz.interfaces.build import IBuildSet
11 from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
12 from lp.soyuz.interfaces.binarypackagename import (
13@@ -850,19 +850,12 @@
14
15 def getSourcesPublishedForAllArchives(self):
16 """See `IDistroSeries`."""
17- # Both, PENDING and PUBLISHED sources will be considered for
18- # as PUBLISHED. It's part of the assumptions made in:
19- # https://launchpad.net/soyuz/+spec/build-unpublished-source
20- pend_build_statuses = (
21- PackagePublishingStatus.PENDING,
22- PackagePublishingStatus.PUBLISHED,
23- )
24-
25 query = """
26 SourcePackagePublishingHistory.distroseries = %s AND
27 SourcePackagePublishingHistory.archive = Archive.id AND
28- SourcePackagePublishingHistory.status in %s
29- """ % sqlvalues(self, pend_build_statuses)
30+ SourcePackagePublishingHistory.status in %s AND
31+ Archive.purpose != %s
32+ """ % sqlvalues(self, active_publishing_status, ArchivePurpose.COPY)
33
34 if not self.isUnstable():
35 # Stable distroseries don't allow builds for the release
36
37=== modified file 'lib/lp/soyuz/doc/buildd-queuebuilder-lookup.txt'
38--- lib/lp/soyuz/doc/buildd-queuebuilder-lookup.txt 2009-07-16 03:31:45 +0000
39+++ lib/lp/soyuz/doc/buildd-queuebuilder-lookup.txt 2009-08-24 20:05:36 +0000
40@@ -31,6 +31,11 @@
41 >>> partner_archive = getUtility(IArchiveSet).getByDistroPurpose(
42 ... distribution=ubuntu, purpose=ArchivePurpose.PARTNER)
43
44+ >>> login('foo.bar@canonical.com')
45+ >>> copy_archive = factory.makeArchive(
46+ ... ubuntu, cprov, 'test-rebuild', ArchivePurpose.COPY)
47+ >>> login(ANONYMOUS)
48+
49 >>> dspr = ubuntu.getSourcePackage('mozilla-firefox').getVersion('0.9')
50 >>> the_spr = dspr.sourcepackagerelease
51
52@@ -54,6 +59,7 @@
53 * 1 PUBLISHED and 1 PENDING records in UPDATES pocket, main_archive;
54 * 1 PUBLISHED and 1 PENDING records in RELEASE pocket, PPA archive;
55 * 1 PUBLISHED and 1 PENDING records in RELEASE pocket, PARTNER archive;
56+ * 1 PUBLISHED and 1 PENDING records in RELEASE pocket, COPY archive;
57
58 >>> def create_sample_publications(distroseries):
59 ... create_publication(
60@@ -80,6 +86,12 @@
61 ... create_publication(
62 ... distroseries, PackagePublishingPocket.RELEASE,
63 ... partner_archive, PackagePublishingStatus.PENDING)
64+ ... create_publication(
65+ ... distroseries, PackagePublishingPocket.RELEASE,
66+ ... copy_archive, PackagePublishingStatus.PUBLISHED)
67+ ... create_publication(
68+ ... distroseries, PackagePublishingPocket.RELEASE,
69+ ... copy_archive, PackagePublishingStatus.PENDING)
70
71 This function will store previous publishing records that will be
72 ignored later when inspecting the example results (sampledata already