launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01072
[Merge] lp:~julian-edwards/launchpad/copy-archive-dispatch-bug-575165 into lp:launchpad/devel
Julian Edwards has proposed merging lp:~julian-edwards/launchpad/copy-archive-dispatch-bug-575165 into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#575165 Buildd-manager erroneously checks COPY archives for release pocket upload permissions when dispatching
https://bugs.launchpad.net/bugs/575165
= Summary =
When the buildd-manager dispatches builds it does a last-ditch check to make
sure the build is not getting dispatched for an invalid pocket, such as the
Release pocket in a stable distroseries. (Consider it a belt-and-braces
approach to preventing archive corruption.)
We're currently falling foul of this for COPY archives that are still running
builds when the development distroseries switches to a released state - all of
a sudden perfectly valid builds cause OOPSes in the buildd-manager.
The solution to this is to allow COPY archive uploads to any pocket. We do a
similar thing for the PARTNER archive in fact.
== Implementation details ==
Trivial change and test in the pocket check.
== Tests ==
bin/test -cvvt test_queue
== Demo and Q/A ==
To QA on dogfood:
* Create a few rebuilds on an unreleased distro series and set them off
* Switch the series to released
* Watch the buildd-manager log file and make sure subsequent builds are not
OOPSing when being dispatched.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/soyuz/tests/test_archive.py
lib/lp/soyuz/model/archive.py
--
https://code.launchpad.net/~julian-edwards/launchpad/copy-archive-dispatch-bug-575165/+merge/35684
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/launchpad/copy-archive-dispatch-bug-575165 into lp:launchpad/devel.
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py 2010-08-31 11:31:04 +0000
+++ lib/lp/soyuz/model/archive.py 2010-09-16 16:21:09 +0000
@@ -1109,6 +1109,11 @@
elif self.is_ppa:
if pocket != PackagePublishingPocket.RELEASE:
return InvalidPocketForPPA()
+ elif self.is_copy:
+ # Any pocket is allowed for COPY archives, otherwise it can
+ # make the buildd-manager throw exceptions when dispatching
+ # existing builds after a series is released.
+ return
else:
# Uploads to the partner archive are allowed in any distroseries
# state.
=== modified file 'lib/lp/soyuz/tests/test_archive.py'
--- lib/lp/soyuz/tests/test_archive.py 2010-08-27 11:19:54 +0000
+++ lib/lp/soyuz/tests/test_archive.py 2010-09-16 16:21:09 +0000
@@ -618,6 +618,20 @@
NoRightsForArchive, archive, person, sourcepackagename,
distroseries=distroseries)
+ def test_checkUploadToPocket_for_released_distroseries_copy_archive(self):
+ # Uploading to the release pocket in a released COPY archive
+ # should be allowed. This is mainly so that rebuilds that are
+ # running during the release process don't suddenly cause
+ # exceptions in the buildd-manager.
+ archive = self.factory.makeArchive(purpose=ArchivePurpose.COPY)
+ distroseries = self.factory.makeDistroSeries(
+ distribution=archive.distribution,
+ status=SeriesStatus.CURRENT)
+ self.assertIs(
+ None,
+ archive.checkUploadToPocket(
+ distroseries, PackagePublishingPocket.RELEASE))
+
def test_checkUpload_package_permission(self):
archive, distroseries = self.makeArchiveAndActiveDistroSeries(
purpose=ArchivePurpose.PRIMARY)