Bug 1458700: [release-promotion] Publish langpacks; r=me BETA_60_CONTINUATION
authorTom Prince <mozilla@hocat.ca>
Tue, 12 Jun 2018 16:17:11 -0700
branchBETA_60_CONTINUATION
changeset 32004 a2e5577b1637
parent 32003 53aabc8387a8
child 32005 c5e32eec32cc
push id384
push userclokep@gmail.com
push dateTue, 26 Jun 2018 01:38:29 +0000
reviewersme
bugs1458700
Bug 1458700: [release-promotion] Publish langpacks; r=me
taskcluster/ci/beetmover-repackage/kind.yml
taskcluster/comm_taskgraph/__init__.py
--- a/taskcluster/ci/beetmover-repackage/kind.yml
+++ b/taskcluster/ci/beetmover-repackage/kind.yml
@@ -5,16 +5,17 @@
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.beetmover_repackage_l10n:transforms
     - taskgraph.transforms.beetmover_repackage:transforms
     - taskgraph.transforms.task:transforms
     - comm_taskgraph:remove_widevine_and_stub_installer
+    - comm_taskgraph:beetmover_add_langpack
 
 kind-dependencies:
     - repackage-signing
 
 only-for-build-platforms:
     - linux-nightly/opt
     - linux64-nightly/opt
     - macosx64-nightly/opt
--- a/taskcluster/comm_taskgraph/__init__.py
+++ b/taskcluster/comm_taskgraph/__init__.py
@@ -44,18 +44,20 @@ def reference_loader(kind, path, config,
     return (job for job in inputs if (_get_aliases(kind, job) & jobs))
 
 
 def remove_widevine_and_stub_installer(config, jobs):
     """
     Remove references to widevine signing and to packaging a stub installer.
 
     This is an expedient hack to avoid adding special cases for handling these in
-    mozilla-central code. The proper fix is to address Bug 1331143 which should allow
-    thunderbird to just have a different list of artifacts to generate.
+    mozilla-central code.  This code should become unnesssary after the
+    declarative artifact[1] work is complete.
+
+    [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1466714
     """
     for job in jobs:
         task = job['task']
         payload = task['payload']
 
         for scope in ['project:comm:thunderbird:releng:signing:format:widevine',
                       'project:comm:thunderbird:releng:signing:format:sha2signcodestub']:
             if scope in task['scopes']:
@@ -72,8 +74,41 @@ def remove_widevine_and_stub_installer(c
         if 'artifacts' in payload and isinstance(payload['artifacts'], list):
             payload['artifacts'] = [artifact for artifact in payload['artifacts']
                                     if not artifact['name'].endswith('/target.stub-installer.exe')]
         if 'env' in payload:
             if 'SIGNED_SETUP_STUB' in payload['env']:
                 del payload['env']['SIGNED_SETUP_STUB']
 
         yield job
+
+
+def beetmover_add_langpack(config, jobs):
+    """
+    Add langpacks to beetmover jobs.
+
+    Firefox signs addons as part of the release process, so has separate tasks
+    for signing and then publishing. Gettin the mozilla-central code to handle
+    uploading unsigned langpacks is complex, so add them afterwards. This code
+    should become unnesssary after the declarative artifact[1] work is complete.
+
+    [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1466714
+    """
+    for job in jobs:
+        task = job['task']
+        payload = task['payload']
+        locale = job['attributes'].get('locale')
+
+        artifact_prefix = "public/build"
+        if locale:
+            artifact_prefix = '{}/{}'.format(artifact_prefix, locale)
+
+        payload['upstreamArtifacts'].append({
+            "locale": locale or 'en-US',
+            "paths": [
+                "{}/target.langpack.xpi".format(artifact_prefix),
+            ],
+            "taskId": {
+                "task-reference": "<build>"
+            },
+            "taskType": "build"
+        })
+        yield job