Bug 1399679 - Add a version string to cache names; r?glandium
So we can change a string in this file to force the use of new caches,
thus ensuring a clean break from one changeset to the next.
MozReview-Commit-ID: EZsR23a1PZE
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -860,25 +860,32 @@ def build_docker_worker_payload(config,
# name into consideration. This means that different Docker images will
# never share the same cache. This is a bit unfortunate. But it is the
# safest thing to do. Fortunately, most images are defined in-tree.
#
# For out-of-tree Docker images, we don't strictly need to incorporate
# the run-task content into the cache name. However, doing so preserves
# the mechanism whereby changing run-task results in new caches
# everywhere.
+
+ # As an additional mechanism to force the use of different caches, the
+ # string literal in the variable below can be changed. This is
+ # preferred to changing run-task because it doesn't require images
+ # to be rebuilt.
+ cache_version = 'v1'
+
if run_task:
- suffix = '-%s' % _run_task_suffix()
+ suffix = '-%s-%s' % (cache_version, _run_task_suffix())
if out_of_tree_image:
name_hash = hashlib.sha256(out_of_tree_image).hexdigest()
suffix += name_hash[0:12]
else:
- suffix = ''
+ suffix = '-%s' % cache_version
skip_untrusted = config.params.is_try() or level == 1
for cache in worker['caches']:
# Some caches aren't enabled in environments where we can't
# guarantee certain behavior. Filter those out.
if cache.get('skip-untrusted') and skip_untrusted:
continue