launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #20333
[Merge] lp:~cjwatson/launchpad/snap-build-default-updates into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/snap-build-default-updates into lp:launchpad.
Commit message:
Default to the updates pocket for new snap builds.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-build-default-updates/+merge/294007
Default to the updates pocket for new snap builds. This is probably a better default given how snaps tend to bundle lots of things and how they're focusing on having current versions of everything.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/snap-build-default-updates into lp:launchpad.
=== modified file 'lib/lp/snappy/browser/snap.py'
--- lib/lp/snappy/browser/snap.py 2016-04-19 10:15:38 +0000
+++ lib/lp/snappy/browser/snap.py 2016-05-06 12:59:16 +0000
@@ -233,7 +233,7 @@
return {
'archive': self.context.distro_series.main_archive,
'distro_arch_series': self.context.getAllowedArchitectures(),
- 'pocket': PackagePublishingPocket.RELEASE,
+ 'pocket': PackagePublishingPocket.UPDATES,
}
def validate(self, data):
=== modified file 'lib/lp/snappy/browser/tests/test_snap.py'
--- lib/lp/snappy/browser/tests/test_snap.py 2016-04-19 10:15:38 +0000
+++ lib/lp/snappy/browser/tests/test_snap.py 2016-05-06 12:59:16 +0000
@@ -850,7 +850,7 @@
["amd64", "i386"],
[build.distro_arch_series.architecturetag for build in builds])
self.assertContentEqual(
- [PackagePublishingPocket.RELEASE],
+ [PackagePublishingPocket.UPDATES],
set(build.pocket for build in builds))
self.assertContentEqual(
[2505], set(build.buildqueue_record.lastscore for build in builds))
@@ -886,7 +886,7 @@
# A duplicate build request causes a notification.
self.snap.requestBuild(
self.person, self.ubuntu.main_archive, self.distroseries["amd64"],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
browser = self.getViewBrowser(
self.snap, "+request-builds", user=self.person)
self.assertTrue(browser.getControl("amd64").selected)
=== modified file 'lib/lp/snappy/tests/test_snap.py'
--- lib/lp/snappy/tests/test_snap.py 2016-02-28 17:23:53 +0000
+++ lib/lp/snappy/tests/test_snap.py 2016-05-06 12:59:16 +0000
@@ -152,12 +152,12 @@
processors=[distroarchseries.processor])
build = snap.requestBuild(
snap.owner, snap.distro_series.main_archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
self.assertTrue(ISnapBuild.providedBy(build))
self.assertEqual(snap.owner, build.requester)
self.assertEqual(snap.distro_series.main_archive, build.archive)
self.assertEqual(distroarchseries, build.distro_arch_series)
- self.assertEqual(PackagePublishingPocket.RELEASE, build.pocket)
+ self.assertEqual(PackagePublishingPocket.UPDATES, build.pocket)
self.assertEqual(BuildStatus.NEEDSBUILD, build.status)
store = Store.of(build)
store.flush()
@@ -181,7 +181,7 @@
processors=[distroarchseries.processor])
build = snap.requestBuild(
snap.owner, snap.distro_series.main_archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
queue_record = build.buildqueue_record
queue_record.score()
self.assertEqual(2505, queue_record.lastscore)
@@ -197,7 +197,7 @@
removeSecurityProxy(archive).relative_build_score = 100
build = snap.requestBuild(
snap.owner, archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
queue_record = build.buildqueue_record
queue_record.score()
self.assertEqual(2605, queue_record.lastscore)
@@ -215,25 +215,25 @@
distroseries=distroseries, processors=[procs[0], procs[1]])
old_build = snap.requestBuild(
snap.owner, snap.distro_series.main_archive, arches[0],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
self.assertRaises(
SnapBuildAlreadyPending, snap.requestBuild,
snap.owner, snap.distro_series.main_archive, arches[0],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
# We can build for a different archive.
snap.requestBuild(
snap.owner, self.factory.makeArchive(owner=snap.owner), arches[0],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
# We can build for a different distroarchseries.
snap.requestBuild(
snap.owner, snap.distro_series.main_archive, arches[1],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
# Changing the status of the old build allows a new build.
old_build.updateStatus(BuildStatus.BUILDING)
old_build.updateStatus(BuildStatus.FULLYBUILT)
snap.requestBuild(
snap.owner, snap.distro_series.main_archive, arches[0],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
def test_requestBuild_rejects_unconfigured_arch(self):
# Snap.requestBuild only allows dispatching a build for one of the
@@ -249,11 +249,11 @@
distroseries=distroseries, processors=[procs[0]])
snap.requestBuild(
snap.owner, snap.distro_series.main_archive, arches[0],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
self.assertRaises(
SnapBuildDisallowedArchitecture, snap.requestBuild,
snap.owner, snap.distro_series.main_archive, arches[1],
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
def test_requestBuild_virtualization(self):
# New builds are virtualized if any of the processor, snap or
@@ -285,7 +285,7 @@
owner=snap.owner, virtualized=archive_virt)
build = snap.requestBuild(
snap.owner, archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
self.assertEqual(build_virt, build.virtualized)
def test_requestBuild_nonvirtualized(self):
@@ -300,12 +300,12 @@
self.assertRaises(
SnapBuildDisallowedArchitecture, snap.requestBuild,
snap.owner, snap.distro_series.main_archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
with admin_logged_in():
snap.require_virtualized = False
snap.requestBuild(
snap.owner, snap.distro_series.main_archive, distroarchseries,
- PackagePublishingPocket.RELEASE)
+ PackagePublishingPocket.UPDATES)
def test_getBuilds(self):
# Test the various getBuilds methods.
@@ -1056,7 +1056,7 @@
snap = self.makeSnap(distroseries=distroseries, processors=[processor])
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(201, response.status)
build = self.webservice.get(response.getHeader("Location")).jsonBody()
self.assertEqual(
@@ -1077,11 +1077,11 @@
snap = self.makeSnap(distroseries=distroseries, processors=[processor])
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(201, response.status)
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(400, response.status)
self.assertEqual(
"An identical build of this snap package is already pending.",
@@ -1106,7 +1106,7 @@
processors=[processor], webservice=other_webservice)
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(401, response.status)
self.assertEqual(
"Test Person cannot create snap package builds owned by Other "
@@ -1128,7 +1128,7 @@
snap = self.makeSnap(distroseries=distroseries, processors=[processor])
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(403, response.status)
self.assertEqual("Disabled Archive is disabled.", response.body)
@@ -1149,7 +1149,7 @@
snap = self.makeSnap(distroseries=distroseries, processors=[processor])
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(201, response.status)
def test_requestBuild_archive_private_owners_mismatch(self):
@@ -1168,7 +1168,7 @@
snap = self.makeSnap(distroseries=distroseries, processors=[processor])
response = self.webservice.named_post(
snap["self_link"], "requestBuild", archive=archive_url,
- distro_arch_series=distroarchseries_url, pocket="Release")
+ distro_arch_series=distroarchseries_url, pocket="Updates")
self.assertEqual(403, response.status)
self.assertEqual(
"Snap package builds against private archives are only allowed "
=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
--- lib/lp/snappy/tests/test_snapbuild.py 2016-03-02 21:21:26 +0000
+++ lib/lp/snappy/tests/test_snapbuild.py 2016-05-06 12:59:16 +0000
@@ -81,7 +81,7 @@
* Archive: distro
* Distroseries: distro unstable
* Architecture: i386
- * Pocket: RELEASE
+ * Pocket: UPDATES
* State: Failed to build
* Duration: 10 minutes
* Build Log: %s
@@ -285,7 +285,7 @@
subject = notification["Subject"].replace("\n ", " ")
self.assertEqual(
"[Snap build #%d] i386 build of snap-1 snap package in distro "
- "unstable" % build.id, subject)
+ "unstable-updates" % build.id, subject)
self.assertEqual(
"Requester", notification["X-Launchpad-Message-Rationale"])
self.assertEqual(person.name, notification["X-Launchpad-Message-For"])
@@ -377,7 +377,7 @@
self.assertEqual(
self.getURL(db_build.distro_arch_series),
build["distro_arch_series_link"])
- self.assertEqual("Release", build["pocket"])
+ self.assertEqual("Updates", build["pocket"])
self.assertIsNone(build["score"])
self.assertFalse(build["can_be_rescored"])
self.assertFalse(build["can_be_cancelled"])
=== modified file 'lib/lp/snappy/tests/test_snapbuildbehaviour.py'
--- lib/lp/snappy/tests/test_snapbuildbehaviour.py 2016-02-09 02:26:46 +0000
+++ lib/lp/snappy/tests/test_snapbuildbehaviour.py 2016-05-06 12:59:16 +0000
@@ -1,4 +1,4 @@
-# Copyright 2015 Canonical Ltd. This software is licensed under the
+# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test snap package build behaviour."""
@@ -62,7 +62,7 @@
self.useFixture(FeatureFixture({SNAP_FEATURE_FLAG: u"on"}))
self.pushConfig("snappy", tools_source=None)
- def makeJob(self, pocket=PackagePublishingPocket.RELEASE, **kwargs):
+ def makeJob(self, pocket=PackagePublishingPocket.UPDATES, **kwargs):
"""Create a sample `ISnapBuildBehaviour`."""
distribution = self.factory.makeDistribution(name="distro")
distroseries = self.factory.makeDistroSeries(
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2016-04-28 02:25:46 +0000
+++ lib/lp/testing/factory.py 2016-05-06 12:59:16 +0000
@@ -4654,7 +4654,7 @@
distroarchseries = self.makeDistroArchSeries(
distroseries=snap.distro_series)
if pocket is None:
- pocket = PackagePublishingPocket.RELEASE
+ pocket = PackagePublishingPocket.UPDATES
snapbuild = getUtility(ISnapBuildSet).new(
requester, snap, archive, distroarchseries, pocket,
date_created=date_created)
Follow ups