Bug 1410512 - Follow-up: Disable mbsdiff cache when building partial updates. rs=mkmelin
authorRob Lemley <rob@thunderbird.net>
Fri, 07 Feb 2020 14:45:52 -0500
changeset 38136 edd42b546bfe4ac29eac3ddce843f9ab79f20a10
parent 38135 eb963eb6aec6e17056942021338e08cfb756ffe2
child 38137 6ff16e8c98c712ff3954da1707e5698b88f0114b
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersmkmelin
bugs1410512
Bug 1410512 - Follow-up: Disable mbsdiff cache when building partial updates. rs=mkmelin Firefox does some caching on their partial generation. Right now, there is no S3 bucket for Thunderbird, so remove the scope to disable the cache.
taskcluster/ci/partials/kind.yml
taskcluster/comm_taskgraph/transforms/partials.py
--- a/taskcluster/ci/partials/kind.yml
+++ b/taskcluster/ci/partials/kind.yml
@@ -3,16 +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.partials:transforms
     - taskgraph.transforms.task:transforms
+    - comm_taskgraph.transforms.partials:transforms
 
 kind-dependencies:
     - repackage
     - repackage-l10n
 
 only-for-attributes:
     - nightly
     - shippable
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/partials.py
@@ -0,0 +1,35 @@
+# 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/.
+"""
+Thunderbird modifications to partial update building
+"""
+from __future__ import absolute_import, print_function, unicode_literals
+
+from taskgraph.transforms.base import TransformSequence
+
+import logging
+
+logger = logging.getLogger(__name__)
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def update_scopes(config, jobs):
+    """
+    Firefox does some caching when building partial updates, but there's no bucket for Thunderbird
+    at the moment. In the meantime, remove the scope from the task to avoid an error.
+    """
+    # If no balrog release history, then don't run
+    if not config.params.get('release_history'):
+        return
+
+    MBSDIFF_SCOPE = 'auth:aws-s3:read-write:tc-gp-private-1d-us-east-1/releng/mbsdiff-cache/'
+
+    for job in jobs:
+        task = job['task']
+        if MBSDIFF_SCOPE in task['scopes']:
+            task['scopes'].remove(MBSDIFF_SCOPE)
+
+        yield job