summaryrefslogtreecommitdiffstats
path: root/taskcluster/gecko_taskgraph/morph.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /taskcluster/gecko_taskgraph/morph.py
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.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