Bug 1442545: [partner-repack] Sign partner builds; r=Callek
authorTom Prince <mozilla@hocat.ca>
Wed, 18 Apr 2018 12:02:24 -0600
changeset 468102 3773a90e8607e6978eeb565dde8966991b6e69fb
parent 468101 00b9d353a6b721a87db3e23bb5f5a904f9e8d424
child 468103 e5b26977884151b96a552a039cd6c7dc73b249d5
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs1442545
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442545: [partner-repack] Sign partner builds; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D981
taskcluster/ci/release-eme-free-repack-signing/kind.yml
taskcluster/ci/release-partner-repack-signing/kind.yml
taskcluster/docs/kinds.rst
taskcluster/taskgraph/transforms/partner_signing.py
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/release-eme-free-repack-signing/kind.yml
@@ -0,0 +1,29 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+loader: taskgraph.loader.build_signing:loader
+
+transforms:
+   - taskgraph.transforms.name_sanity:transforms
+   - taskgraph.transforms.partner_signing:transforms
+   - taskgraph.transforms.signing:transforms
+   - taskgraph.transforms.release_notifications:transforms
+   - taskgraph.transforms.task:transforms
+
+kind-dependencies:
+   - release-eme-free-repack
+
+only-for-build-platforms:
+   - macosx64-nightly/opt
+
+job-template:
+   shipping-product: firefox
+   shipping-phase: promote
+   depname: release-eme-free-repack
+   max-run-time: 7200
+   treeherder:
+      symbol: EME-Sign
+      platform: macosx64/opt
+      kind: test
+      tier: 1
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/release-partner-repack-signing/kind.yml
@@ -0,0 +1,24 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+loader: taskgraph.loader.build_signing:loader
+
+transforms:
+   - taskgraph.transforms.name_sanity:transforms
+   - taskgraph.transforms.partner_signing:transforms
+   - taskgraph.transforms.signing:transforms
+   - taskgraph.transforms.release_notifications:transforms
+   - taskgraph.transforms.task:transforms
+
+kind-dependencies:
+   - release-partner-repack
+
+only-for-build-platforms:
+   - macosx64-nightly/opt
+
+job-template:
+   shipping-product: firefox
+   shipping-phase: promote
+   depname: release-partner-repack
+   max-run-time: 7200
--- a/taskcluster/docs/kinds.rst
+++ b/taskcluster/docs/kinds.rst
@@ -349,20 +349,28 @@ Generates source for the release
 release-source-signing
 --------------------
 Signs source for the release
 
 release-partner-repack
 ----------------------
 Generates customized versions of releases for partners.
 
+release-partner-repack-signing
+------------------------------
+Internal signing of partner repacks.
+
 release-eme-free-repack
 ----------------------
 Generates customized versions of releases for eme-free repacks.
 
+release-eme-free-repack-signing
+------------------------------
+Internal signing of eme-free repacks
+
 repackage
 ---------
 Repackage tasks take a signed output and package them up into something suitable
 for shipping to our users. For example, on OSX we return a tarball as the signed output
 and this task would package that up as an Apple Disk Image (.dmg)
 
 repackage-l10n
 --------------
new file mode 100644
--- /dev/null
+++ b/taskcluster/taskgraph/transforms/partner_signing.py
@@ -0,0 +1,54 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+"""
+Transform the signing task into an actual task description.
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from taskgraph.transforms.base import TransformSequence
+from taskgraph.util.partners import (get_partner_config_by_kind, check_if_partners_enabled,
+                                     locales_per_build_platform)
+from taskgraph.util.signed_artifacts import generate_specifications_of_artifacts_to_sign
+
+transforms = TransformSequence()
+
+transforms.add(check_if_partners_enabled)
+
+
+@transforms.add
+def define_upstream_artifacts(config, jobs):
+    partner_configs = get_partner_config_by_kind(config, config.kind)
+    if not partner_configs:
+        return
+
+    for job in jobs:
+        dep_job = job['dependent-task']
+        build_platform = dep_job.attributes.get('build_platform')
+
+        repack_ids = []
+        for partner, partner_config in partner_configs.iteritems():
+            for sub_partner, cfg in partner_config.iteritems():
+                if not cfg or build_platform not in cfg["platforms"]:
+                    continue
+                for locale in locales_per_build_platform(build_platform, cfg.get('locales', [])):
+                    repack_ids.append("{}/{}/{}".format(partner, sub_partner, locale))
+
+        artifacts_specifications = generate_specifications_of_artifacts_to_sign(
+            dep_job,
+            keep_locale_template=True,
+            kind=config.kind,
+        )
+        job['upstream-artifacts'] = [{
+            'taskId': {'task-reference': '<{}>'.format(job['depname'])},
+            'taskType': 'build',
+            'paths': [
+                path_template.format(locale=repack_id)
+                for repack_id in repack_ids
+                for path_template in spec['artifacts']
+            ],
+            'formats': spec['formats'],
+        } for spec in artifacts_specifications]
+
+        yield job