summaryrefslogtreecommitdiffstats
path: root/taskcluster/gecko_taskgraph/morph.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /taskcluster/gecko_taskgraph/morph.py
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/gecko_taskgraph/morph.py')
-rw-r--r--taskcluster/gecko_taskgraph/morph.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/taskcluster/gecko_taskgraph/morph.py b/taskcluster/gecko_taskgraph/morph.py
index 1d03ddaab6..42fe4597fa 100644
--- a/taskcluster/gecko_taskgraph/morph.py
+++ b/taskcluster/gecko_taskgraph/morph.py
@@ -254,10 +254,31 @@ def add_eager_cache_index_tasks(taskgraph, label_to_taskid, parameters, graph_co
@register_morph
def add_try_task_duplicates(taskgraph, label_to_taskid, parameters, graph_config):
- try_config = parameters["try_task_config"]
+ return _add_try_task_duplicates(
+ taskgraph, label_to_taskid, parameters, graph_config
+ )
+
+
+# this shim function exists so we can call it from the unittests.
+# this works around an issue with
+# third_party/python/taskcluster_taskgraph/taskgraph/morph.py#40
+def _add_try_task_duplicates(taskgraph, label_to_taskid, parameters, graph_config):
+ try_config = parameters.get("try_task_config", {})
+ tasks = try_config.get("tasks", [])
+ glob_tasks = {x.strip("-*") for x in tasks if x.endswith("-*")}
+ tasks = set(tasks) - glob_tasks
+
rebuild = try_config.get("rebuild")
if rebuild:
for task in taskgraph.tasks.values():
- if task.label in try_config.get("tasks", []):
+ chunk_index = -1
+ if task.label.endswith("-cf"):
+ chunk_index = -2
+ label_parts = task.label.split("-")
+ label_no_chunk = "-".join(label_parts[:chunk_index])
+
+ if label_parts[chunk_index].isnumeric() and label_no_chunk in glob_tasks:
+ task.attributes["task_duplicates"] = rebuild
+ elif task.label in tasks:
task.attributes["task_duplicates"] = rebuild
return taskgraph, label_to_taskid