Colin Watson has proposed merging 
lp:~cjwatson/launchpad/snap-dispatch-store-name into lp:launchpad.

Commit message:
Prefer Snap.store_name over Snap.name for the "name" argument dispatched to 
snap builds.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/snap-dispatch-store-name/+merge/343713

This is mostly just used for directory names at the builder end, although soon 
also for source tarball names.  The store name is often more meaningful if it's 
set, particularly for things like build.snapcraft.io-managed snaps.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/snap-dispatch-store-name into lp:launchpad.
=== modified file 'lib/lp/snappy/model/snapbuildbehaviour.py'
--- lib/lp/snappy/model/snapbuildbehaviour.py	2018-04-04 14:14:30 +0000
+++ lib/lp/snappy/model/snapbuildbehaviour.py	2018-04-20 18:03:04 +0000
@@ -97,7 +97,7 @@
                 "{endpoint}/{token}".format(
                     endpoint=config.snappy.builder_proxy_auth_api_endpoint,
                     token=token['username']))
-        args["name"] = build.snap.name
+        args["name"] = build.snap.store_name or build.snap.name
         args["series"] = build.distro_series.name
         args["arch_tag"] = build.distro_arch_series.architecturetag
         # XXX cjwatson 2015-08-03: Allow tools_source to be overridden at

=== modified file 'lib/lp/snappy/tests/test_snapbuildbehaviour.py'
--- lib/lp/snappy/tests/test_snapbuildbehaviour.py	2018-04-04 14:14:30 +0000
+++ lib/lp/snappy/tests/test_snapbuildbehaviour.py	2018-04-20 18:03:04 +0000
@@ -385,6 +385,14 @@
             }, args)
 
     @defer.inlineCallbacks
+    def test_extraBuildArgs_prefers_store_name(self):
+        # For the "name" argument, _extraBuildArgs prefers Snap.store_name
+        # over Snap.name if the former is set.
+        job = self.makeJob(store_name="something-else")
+        args = yield job._extraBuildArgs()
+        self.assertEqual("something-else", args["name"])
+
+    @defer.inlineCallbacks
     def test_extraBuildArgs_archive_trusted_keys(self):
         # If the archive has a signing key, _extraBuildArgs sends it.
         yield self.useFixture(InProcessKeyServerFixture()).start()

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to