launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21288
[Merge] lp:~cjwatson/launchpad/snap-build-arch-tag into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/snap-build-arch-tag into lp:launchpad.
Commit message:
Add and export SnapBuild.arch_tag, for convenience.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-build-arch-tag/+merge/313022
This would save build.snapcraft.io from needing to parse distro_arch_series_link.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/snap-build-arch-tag into lp:launchpad.
=== modified file 'lib/lp/snappy/interfaces/snapbuild.py'
--- lib/lp/snappy/interfaces/snapbuild.py 2016-07-27 01:43:45 +0000
+++ lib/lp/snappy/interfaces/snapbuild.py 2016-12-12 14:12:51 +0000
@@ -35,6 +35,7 @@
Choice,
Datetime,
Int,
+ TextLine,
)
from lp import _
@@ -95,6 +96,9 @@
title=_("The series and architecture for which to build."),
required=True, readonly=True))
+ arch_tag = exported(
+ TextLine(title=_("Architecture tag"), required=True, readonly=True))
+
pocket = exported(Choice(
title=_("The pocket for which to build."),
vocabulary=PackagePublishingPocket, required=True, readonly=True))
=== modified file 'lib/lp/snappy/model/snapbuild.py'
--- lib/lp/snappy/model/snapbuild.py 2016-08-16 16:24:51 +0000
+++ lib/lp/snappy/model/snapbuild.py 2016-12-12 14:12:51 +0000
@@ -199,6 +199,11 @@
return self.distro_arch_series.distroseries
@property
+ def arch_tag(self):
+ """See `ISnapBuild`."""
+ return self.distro_arch_series.architecturetag
+
+ @property
def current_component(self):
component = self.archive.default_component
if component is not None:
=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
--- lib/lp/snappy/tests/test_snapbuild.py 2016-08-16 16:24:51 +0000
+++ lib/lp/snappy/tests/test_snapbuild.py 2016-12-12 14:12:51 +0000
@@ -498,6 +498,8 @@
self.assertEqual(
self.getURL(db_build.distro_arch_series),
build["distro_arch_series_link"])
+ self.assertEqual(
+ db_build.distro_arch_series.architecturetag, build["arch_tag"])
self.assertEqual("Updates", build["pocket"])
self.assertIsNone(build["score"])
self.assertFalse(build["can_be_rescored"])
Follow ups