Bug 1592162 - Split comm_taskgraph functions into loader and transform packages. r=darktrojan
authorRob Lemley <rob@thunderbird.net>
Mon, 28 Oct 2019 20:53:54 -0400
changeset 37427 fee24a698db44e38cf473a849d27398e83717989
parent 37426 e1879be2884c38b18c329b59b2887cd516f0b4cd
child 37428 7cd9756e2aa1aa0322967ea1d6b309631ca73c5f
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersdarktrojan
bugs1592162
Bug 1592162 - Split comm_taskgraph functions into loader and transform packages. r=darktrojan Create loader and transform subpackages under comm_taskgraph and move the existing functions.
taskcluster/ci/addon/kind.yml
taskcluster/ci/beetmover-repackage/kind.yml
taskcluster/ci/build-signing/kind.yml
taskcluster/ci/docker-image/kind.yml
taskcluster/ci/fetch/kind.yml
taskcluster/ci/nightly-l10n-signing/kind.yml
taskcluster/ci/packages/kind.yml
taskcluster/ci/repackage-l10n/kind.yml
taskcluster/ci/repackage-signing-l10n/kind.yml
taskcluster/ci/repackage-signing/kind.yml
taskcluster/ci/repackage/kind.yml
taskcluster/ci/test/kind.yml
taskcluster/ci/toolchain/kind.yml
taskcluster/comm_taskgraph/__init__.py
taskcluster/comm_taskgraph/loader/__init__.py
taskcluster/comm_taskgraph/loader/reference.py
taskcluster/comm_taskgraph/transforms/__init__.py
taskcluster/comm_taskgraph/transforms/addon.py
taskcluster/comm_taskgraph/transforms/signing.py
taskcluster/comm_taskgraph/transforms/tests.py
--- a/taskcluster/ci/addon/kind.yml
+++ b/taskcluster/ci/addon/kind.yml
@@ -5,17 +5,17 @@
 loader: taskgraph.loader.transform:loader
 
 kind-dependencies:
     - build
     - toolchain
     - nightly-l10n
 
 transforms:
-    - comm_taskgraph:add_l10n_dependencies
+    - comm_taskgraph.transforms.addon:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
 
 jobs:
     calendar-l10n:
         treeherder:
             kind: build
             platform: linux64-shippable/opt
--- a/taskcluster/ci/beetmover-repackage/kind.yml
+++ b/taskcluster/ci/beetmover-repackage/kind.yml
@@ -6,17 +6,17 @@ loader: taskgraph.loader.multi_dep:loade
 
 group-by: single-locale
 
 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
+    - comm_taskgraph.transforms.signing:transforms
 
 kind-dependencies:
     - build
     - build-signing
     - repackage
     - repackage-signing
     - nightly-l10n
     - nightly-l10n-signing
--- a/taskcluster/ci/build-signing/kind.yml
+++ b/taskcluster/ci/build-signing/kind.yml
@@ -4,13 +4,12 @@
 ---
 loader: taskgraph.loader.build_signing:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.build_signing:transforms
     - taskgraph.transforms.signing:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
-    - comm_taskgraph:no_sign_langpacks
+    - comm_taskgraph.transforms.signing:transforms
 
 kind-dependencies:
     - build
--- a/taskcluster/ci/docker-image/kind.yml
+++ b/taskcluster/ci/docker-image/kind.yml
@@ -1,13 +1,13 @@
 # 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: comm_taskgraph:reference_loader
+loader: comm_taskgraph.loader.reference:loader
 base-path: taskcluster/ci
 
 kind-dependencies:
     - packages
 
 jobs:
     - debian7-amd64-build
     - debian7-base
--- a/taskcluster/ci/fetch/kind.yml
+++ b/taskcluster/ci/fetch/kind.yml
@@ -1,6 +1,6 @@
 # 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: comm_taskgraph:reference_loader
+loader: comm_taskgraph.loader.reference:loader
 base-path: taskcluster/ci
--- a/taskcluster/ci/nightly-l10n-signing/kind.yml
+++ b/taskcluster/ci/nightly-l10n-signing/kind.yml
@@ -4,17 +4,16 @@
 ---
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.nightly_l10n_signing:transforms
     - taskgraph.transforms.signing:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
-    - comm_taskgraph:no_sign_langpacks
+    - comm_taskgraph.transforms.signing:transforms
 
 kind-dependencies:
     - nightly-l10n
 
 only-for-attributes:
     - nightly
     - shippable
--- a/taskcluster/ci/packages/kind.yml
+++ b/taskcluster/ci/packages/kind.yml
@@ -1,13 +1,13 @@
 # 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: comm_taskgraph:reference_loader
+loader: comm_taskgraph.loader.reference:loader
 base-path: taskcluster/ci
 
 jobs:
     - deb7-32-atk
     - deb7-32-gdk-pixbuf
     - deb7-32-glib
     - deb7-32-gtk3
     - deb7-32-harfbuzz
--- a/taskcluster/ci/repackage-l10n/kind.yml
+++ b/taskcluster/ci/repackage-l10n/kind.yml
@@ -5,17 +5,17 @@
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.repackage_l10n:transforms
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.repackage:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
+    - comm_taskgraph.transforms.signing:transforms
 
 kind-dependencies:
     - nightly-l10n-signing
     - toolchain
 
 only-for-build-platforms:
     - linux-shippable/opt
     - linux64-shippable/opt
--- a/taskcluster/ci/repackage-signing-l10n/kind.yml
+++ b/taskcluster/ci/repackage-signing-l10n/kind.yml
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ---
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.repackage_signing:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
+    - comm_taskgraph.transforms.signing:transforms
 
 
 kind-dependencies:
     - repackage-l10n
 
 only-for-build-platforms:
     - win32-shippable/opt
     - win64-shippable/opt
--- a/taskcluster/ci/repackage-signing/kind.yml
+++ b/taskcluster/ci/repackage-signing/kind.yml
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ---
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.repackage_signing:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
+    - comm_taskgraph.transforms.signing:transforms
 
 
 kind-dependencies:
     - repackage
 
 only-for-build-platforms:
     - win32-shippable/opt
     - win64-shippable/opt
--- a/taskcluster/ci/repackage/kind.yml
+++ b/taskcluster/ci/repackage/kind.yml
@@ -4,17 +4,17 @@
 ---
 loader: taskgraph.loader.single_dep:loader
 
 transforms:
     - taskgraph.transforms.name_sanity:transforms
     - taskgraph.transforms.repackage:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
-    - comm_taskgraph:remove_widevine
+    - comm_taskgraph.transforms.signing:transforms
 
 kind-dependencies:
     - build-signing
     - toolchain
 
 only-for-build-platforms:
     - linux-shippable/opt
     - linux64-shippable/opt
--- a/taskcluster/ci/test/kind.yml
+++ b/taskcluster/ci/test/kind.yml
@@ -7,17 +7,17 @@ loader: taskgraph.loader.test:loader
 kind-dependencies:
     - build
     - build-signing
     - fetch
     - toolchain
 
 transforms:
     - taskgraph.transforms.tests:transforms
-    - comm_taskgraph:tests_drop_1proc
+    - comm_taskgraph.transforms.tests:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
 
 jobs-from:
     - compiled.yml
     - marionette.yml
     - tests.yml
 
--- a/taskcluster/ci/toolchain/kind.yml
+++ b/taskcluster/ci/toolchain/kind.yml
@@ -1,13 +1,13 @@
 # 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: comm_taskgraph:reference_loader
+loader: comm_taskgraph.loader.reference:loader
 base-path: taskcluster/ci
 
 kind-dependencies:
     - fetch
 
 jobs:
     - linux64-binutils
     - linux64-cbindgen
--- a/taskcluster/comm_taskgraph/__init__.py
+++ b/taskcluster/comm_taskgraph/__init__.py
@@ -1,193 +1,3 @@
-from __future__ import absolute_import, print_function, unicode_literals
-
-import os
-from mozbuild.chunkify import chunkify
-from taskgraph.transforms.l10n import parse_locales_file
-from taskgraph.util.treeherder import split_symbol, join_symbol, add_suffix
-from taskgraph.util.yaml import load_yaml
-from taskgraph.util.python_path import find_object
-
-
-def _get_aliases(kind, job):
-    aliases = {job['name']}
-
-    if kind == 'toolchain':
-        if job['run'].get('toolchain-alias'):
-            aliases.add(job['run'].get('toolchain-alias'))
-
-    return aliases
-
-
-def _get_loader(path, config):
-    try:
-        loader = config['loader']
-    except KeyError:
-        raise KeyError("{!r} does not define `loader`".format(path))
-    return find_object(loader)
-
-
-def _remove_suffix(text, suffix):
-    """
-    Removes a suffix from a string.
-    """
-    if text.endswith(suffix):
-        _drop = len(suffix) * -1
-        text = text[:_drop]
-    return text
-
-
-def reference_loader(kind, path, config, params, loaded_tasks):
-    """
-    Loads selected jobs from a different taskgraph hierarchy.
-
-    This loads jobs of the given kind from the taskgraph rooted at `base-path`,
-    and includes all the jobs with names or aliaes matching the names in the
-    `jobs` key.
-    """
-    base_path = config.pop('base-path')
-    sub_path = os.path.join(base_path, kind)
-    sub_config = load_yaml(sub_path, "kind.yml")
-    loader = _get_loader(sub_path, sub_config)
-    inputs = loader(kind, sub_path, sub_config, params, loaded_tasks)
-
-    jobs = config.pop('jobs', None)
-
-    config.update(sub_config)
-
-    if jobs is not None:
-        jobs = set(jobs)
-        return (job for job in inputs if (_get_aliases(kind, job) & jobs))
-    else:
-        return inputs
-
-
-def remove_widevine(config, jobs):
-    """
-    Remove references to widevine signing.
-
-    This is to avoid adding special cases for handling signed artifacts
-    in mozilla-central code. Artifact signature formats are determined in
-    taskgraph.util.signed_artifacts. There's no override mechanism so we
-    remove the autograph_widevine format here.
-    """
-    for job in jobs:
-        task = job['task']
-        payload = task['payload']
-
-        widevine_scope = 'project:comm:thunderbird:releng:signing:format' \
-                         ':autograph_widevine'
-        if widevine_scope in task['scopes']:
-            task['scopes'].remove(widevine_scope)
-        if 'upstreamArtifacts' in payload:
-            for artifact in payload['upstreamArtifacts']:
-                if 'autograph_widevine' in artifact.get('formats', []):
-                    artifact['formats'].remove('autograph_widevine')
-
-        yield job
-
-
-def no_sign_langpacks(config, jobs):
-    """
-    Remove langpacks from signing jobs after they are automatically added.
-    """
-    for job in jobs:
-        task = job['task']
-        payload = task['payload']
-
-        if 'upstreamArtifacts' in payload:
-            for artifact in payload['upstreamArtifacts']:
-                if 'autograph_langpack' in artifact.get('formats', []):
-                    artifact['formats'].remove('autograph_langpack')
-
-                if not artifact['formats']:  # length zero list is False
-                    for remove_path in artifact['paths']:
-                        job['release-artifacts'].remove(remove_path)
-
-                    payload['upstreamArtifacts'].remove(artifact)
-
-        yield job
-
-
-def tests_drop_1proc(config, jobs):
-    """
-    Remove the -1proc suffix from Treeherder group symbols.
-    Restore the -e10s suffix (because some day we will have them!)
-
-    Reverses the effects of bug 1541527. Thunderbird builds are all single
-    process.
-    """
-    for job in jobs:
-        test = job['run']['test']
-        e10s = test['e10s']
-
-        if not e10s:  # test-name & friends end with '-1proc'
-            test['test-name'] = _remove_suffix(test['test-name'], '-1proc')
-            test['try-name'] = _remove_suffix(test['try-name'], '-1proc')
-            group, symbol = split_symbol(test['treeherder-symbol'])
-            if group != '?':
-                group = _remove_suffix(group, '-1proc')
-            test['treeherder-symbol'] = join_symbol(group, symbol)
-
-            job['label'] = job['label'].replace('-1proc', '')
-            job['name'] = _remove_suffix(job['name'], '-1proc')
-            job['treeherder']['symbol'] = test['treeherder-symbol']
-        else:  # e10s in the future
-            test['test-name'] = add_suffix(test['test-name'], '-e10s')
-            test['try-name'] = add_suffix(test['try-name'], '-e10s')
-            group, symbol = split_symbol(test['treeherder-symbol'])
-            if group != '?':
-                group = add_suffix(group, '-e10s')
-            test['treeherder-symbol'] = join_symbol(group, symbol)
-
-            job['label'] += '-e10s'
-            job['name'] = add_suffix(job['name'], '-e10s')
-            job['treeherder']['symbol'] = test['treeherder-symbol']
-
-        yield job
-
-
-def add_l10n_dependencies(config, jobs):
-    """
-    For multilingual Lightning repackaging, fetches a repackaged build
-    artifact for each locale. This is a Linux 64-bit build for all locales
-    except ja-JP-mac, in which case it is a OS X build.
-    """
-    for job in jobs:
-        locales_with_changesets = parse_locales_file(job["locales-file"],
-                                                     platform="linux64")
-        locales_with_changesets = sorted(locales_with_changesets.keys())
-
-        chunks, remainder = divmod(len(locales_with_changesets), job["locales-per-chunk"])
-        if remainder:
-            chunks = int(chunks + 1)
-
-        for this_chunk in range(1, chunks + 1):
-            label = "unsigned-repack-%d" % this_chunk
-            job["dependencies"][label] = "nightly-l10n-linux64-shippable-%d/opt" % this_chunk
-            chunked_locales = chunkify(locales_with_changesets, this_chunk, chunks)
-            job["fetches"][label] = [{
-                "artifact": "%s/target.tar.bz2" % locale,
-                "dest": locale
-            } for locale in chunked_locales]
-
-        mac_locales_with_changesets = parse_locales_file(job["locales-file"],
-                                                         platform="macosx64")
-        mac_locales_with_changesets = sorted(mac_locales_with_changesets.keys())
-
-        chunks, remainder = divmod(len(mac_locales_with_changesets), job["locales-per-chunk"])
-        if remainder:
-            chunks = int(chunks + 1)
-
-        for this_chunk in range(1, chunks + 1):
-            chunked_locales = chunkify(mac_locales_with_changesets, this_chunk, chunks)
-            if "ja-JP-mac" in chunked_locales:
-                label = "unsigned-repack-mac"
-                job["dependencies"][label] = "nightly-l10n-macosx64-shippable-%d/opt" % this_chunk
-                job["fetches"][label] = [{
-                    "artifact": "ja-JP-mac/target.dmg",
-                    "dest": "ja-JP-mac"
-                }]
-
-        del job["locales-file"]
-        del job["locales-per-chunk"]
-        yield job
+# 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/.
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/loader/__init__.py
@@ -0,0 +1,3 @@
+# 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/.
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/loader/reference.py
@@ -0,0 +1,58 @@
+# 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/.
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+import os
+import logging
+
+from taskgraph.util.yaml import load_yaml
+from taskgraph.util.python_path import find_object
+
+logger = logging.getLogger(__name__)
+
+
+def _get_aliases(kind, job):
+    aliases = {job['name']}
+
+    if kind == 'toolchain':
+        if job['run'].get('toolchain-alias'):
+            aliases.add(job['run'].get('toolchain-alias'))
+
+    return aliases
+
+
+def _get_loader(path, config):
+    try:
+        _loader = config['loader']
+    except KeyError:
+        raise KeyError("{!r} does not define `loader`".format(path))
+    return find_object(_loader)
+
+
+def loader(kind, path, config, params, loaded_tasks):
+    """
+    Loads selected jobs from a different taskgraph hierarchy.
+
+    This loads jobs of the given kind from the taskgraph rooted at `base-path`,
+    and includes all the jobs with names or aliaes matching the names in the
+    `jobs` key.
+    """
+    base_path = config.pop('base-path')
+    sub_path = os.path.join(base_path, kind)
+
+    logger.debug("Reference loader: load tasks from {}".format(sub_path))
+    sub_config = load_yaml(sub_path, 'kind.yml')
+    _loader = _get_loader(sub_path, sub_config)
+    inputs = _loader(kind, sub_path, sub_config, params, loaded_tasks)
+
+    jobs = config.pop('jobs', None)
+
+    config.update(sub_config)
+
+    if jobs is not None:
+        jobs = set(jobs)
+        return (job for job in inputs if (_get_aliases(kind, job) & jobs))
+    else:
+        return inputs
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/__init__.py
@@ -0,0 +1,3 @@
+# 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/.
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/addon.py
@@ -0,0 +1,60 @@
+#  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/.
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from mozbuild.chunkify import chunkify
+from taskgraph.transforms.base import TransformSequence
+from taskgraph.transforms.l10n import parse_locales_file
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def add_l10n_dependencies(config, jobs):
+    """
+    For multilingual Lightning repackaging, fetches a repackaged build
+    artifact for each locale. This is a Linux 64-bit build for all locales
+    except ja-JP-mac, in which case it is a OS X build.
+    """
+    for job in jobs:
+        locales_with_changesets = parse_locales_file(job["locales-file"],
+                                                     platform="linux64")
+        locales_with_changesets = sorted(locales_with_changesets.keys())
+
+        chunks, remainder = divmod(len(locales_with_changesets), job["locales-per-chunk"])
+        if remainder:
+            chunks = int(chunks + 1)
+
+        for this_chunk in range(1, chunks + 1):
+            label = "unsigned-repack-%d" % this_chunk
+            job["dependencies"][label] = "nightly-l10n-linux64-shippable-%d/opt" % this_chunk
+            chunked_locales = chunkify(locales_with_changesets, this_chunk, chunks)
+            job["fetches"][label] = [{
+                "artifact": "%s/target.tar.bz2" % locale,
+                "dest": locale
+            } for locale in chunked_locales]
+
+        mac_locales_with_changesets = parse_locales_file(job["locales-file"],
+                                                         platform="macosx64")
+        mac_locales_with_changesets = sorted(mac_locales_with_changesets.keys())
+
+        chunks, remainder = divmod(len(mac_locales_with_changesets), job["locales-per-chunk"])
+        if remainder:
+            chunks = int(chunks + 1)
+
+        for this_chunk in range(1, chunks + 1):
+            chunked_locales = chunkify(mac_locales_with_changesets, this_chunk, chunks)
+            if "ja-JP-mac" in chunked_locales:
+                label = "unsigned-repack-mac"
+                job["dependencies"][label] = "nightly-l10n-macosx64-shippable-%d/opt" % this_chunk
+                job["fetches"][label] = [{
+                    "artifact": "ja-JP-mac/target.dmg",
+                    "dest": "ja-JP-mac"
+                }]
+
+        del job["locales-file"]
+        del job["locales-per-chunk"]
+
+        yield job
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/signing.py
@@ -0,0 +1,59 @@
+#  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/.
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from taskgraph.transforms.base import TransformSequence
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def remove_widevine(config, jobs):
+    """
+    Remove references to widevine signing.
+
+    This is to avoid adding special cases for handling signed artifacts
+    in mozilla-central code. Artifact signature formats are determined in
+    taskgraph.util.signed_artifacts. There's no override mechanism so we
+    remove the autograph_widevine format here.
+    """
+    for job in jobs:
+        task = job['task']
+        payload = task['payload']
+
+        widevine_scope = 'project:comm:thunderbird:releng:signing:format' \
+                         ':autograph_widevine'
+        if widevine_scope in task['scopes']:
+            task['scopes'].remove(widevine_scope)
+        if 'upstreamArtifacts' in payload:
+            for artifact in payload['upstreamArtifacts']:
+                if 'autograph_widevine' in artifact.get('formats', []):
+                    artifact['formats'].remove('autograph_widevine')
+
+        yield job
+
+
+@transforms.add
+def no_sign_langpacks(config, jobs):
+    """
+    Remove langpacks from signing jobs after they are automatically added.
+    """
+    for job in jobs:
+        task = job['task']
+        payload = task['payload']
+
+        if 'upstreamArtifacts' in payload:
+            for artifact in payload['upstreamArtifacts']:
+                if 'autograph_langpack' in artifact.get('formats', []):
+                    artifact['formats'].remove('autograph_langpack')
+
+                if 'formats' in artifact:
+                    if not artifact['formats']:  # length zero list is False
+                        for remove_path in artifact['paths']:
+                            job['release-artifacts'].remove(remove_path)
+
+                        payload['upstreamArtifacts'].remove(artifact)
+
+        yield job
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/tests.py
@@ -0,0 +1,59 @@
+#  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/.
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from taskgraph.util.treeherder import split_symbol, join_symbol, add_suffix
+from taskgraph.transforms.base import TransformSequence
+
+transforms = TransformSequence()
+
+
+def _remove_suffix(text, suffix):
+    """
+    Removes a suffix from a string.
+    """
+    if text.endswith(suffix):
+        _drop = len(suffix) * -1
+        text = text[:_drop]
+    return text
+
+
+@transforms.add
+def tests_drop_1proc(config, jobs):
+    """
+    Remove the -1proc suffix from Treeherder group symbols.
+    Restore the -e10s suffix (because some day we will have them!)
+
+    Reverses the effects of bug 1541527. Thunderbird builds are all single
+    process.
+    """
+    for job in jobs:
+        test = job['run']['test']
+        e10s = test['e10s']
+
+        if not e10s:  # test-name & friends end with '-1proc'
+            test['test-name'] = _remove_suffix(test['test-name'], '-1proc')
+            test['try-name'] = _remove_suffix(test['try-name'], '-1proc')
+            group, symbol = split_symbol(test['treeherder-symbol'])
+            if group != '?':
+                group = _remove_suffix(group, '-1proc')
+            test['treeherder-symbol'] = join_symbol(group, symbol)
+
+            job['label'] = job['label'].replace('-1proc', '')
+            job['name'] = _remove_suffix(job['name'], '-1proc')
+            job['treeherder']['symbol'] = test['treeherder-symbol']
+        else:  # e10s in the future
+            test['test-name'] = add_suffix(test['test-name'], '-e10s')
+            test['try-name'] = add_suffix(test['try-name'], '-e10s')
+            group, symbol = split_symbol(test['treeherder-symbol'])
+            if group != '?':
+                group = add_suffix(group, '-e10s')
+            test['treeherder-symbol'] = join_symbol(group, symbol)
+
+            job['label'] += '-e10s'
+            job['name'] = add_suffix(job['name'], '-e10s')
+            job['treeherder']['symbol'] = test['treeherder-symbol']
+
+        yield job