launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22948
[Merge] lp:~cjwatson/launchpad/snap-build-title-store-name into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/snap-build-title-store-name into lp:launchpad.
Commit message:
Include Snap.store_name in SnapBuild.title if it differs from Snap.name.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-build-title-store-name/+merge/356134
This makes /builders more informative: in particular, build.snapcraft.io-generated snaps have opaque names, but their store_names are useful.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/snap-build-title-store-name into lp:launchpad.
=== modified file 'lib/lp/snappy/model/snapbuild.py'
--- lib/lp/snappy/model/snapbuild.py 2018-08-03 13:53:20 +0000
+++ lib/lp/snappy/model/snapbuild.py 2018-10-04 13:17:41 +0000
@@ -212,9 +212,13 @@
@property
def title(self):
das = self.distro_arch_series
- name = self.snap.name
- return "%s build of %s snap package in %s %s" % (
- das.architecturetag, name, das.distroseries.distribution.name,
+ snap_title = "%s snap package" % self.snap.name
+ if (self.snap.store_name is not None and
+ self.snap.store_name != self.snap.name):
+ snap_title += " (%s)" % self.snap.store_name
+ return "%s build of %s in %s %s" % (
+ das.architecturetag, snap_title,
+ das.distroseries.distribution.name,
das.distroseries.getSuite(self.pocket))
@property
=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
--- lib/lp/snappy/tests/test_snapbuild.py 2018-08-03 13:53:20 +0000
+++ lib/lp/snappy/tests/test_snapbuild.py 2018-10-04 13:17:41 +0000
@@ -100,6 +100,31 @@
self.assertProvides(self.build, IPackageBuild)
self.assertProvides(self.build, ISnapBuild)
+ def test_title(self):
+ # SnapBuild has an informative title.
+ das = self.build.distro_arch_series
+ self.assertIsNone(self.build.snap.store_name)
+ self.assertEqual(
+ "%s build of %s snap package in %s %s" % (
+ das.architecturetag, self.build.snap.name,
+ das.distroseries.distribution.name,
+ das.distroseries.getSuite(self.build.pocket)),
+ self.build.title)
+ self.build.snap.store_name = self.build.snap.name
+ self.assertEqual(
+ "%s build of %s snap package in %s %s" % (
+ das.architecturetag, self.build.snap.name,
+ das.distroseries.distribution.name,
+ das.distroseries.getSuite(self.build.pocket)),
+ self.build.title)
+ self.build.snap.store_name = self.factory.getUniqueUnicode()
+ self.assertEqual(
+ "%s build of %s snap package (%s) in %s %s" % (
+ das.architecturetag, self.build.snap.name,
+ self.build.snap.store_name, das.distroseries.distribution.name,
+ das.distroseries.getSuite(self.build.pocket)),
+ self.build.title)
+
def test_queueBuild(self):
# SnapBuild can create the queue entry for itself.
bq = self.build.queueBuild()
Follow ups