1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 from .registry
import register_callback_action
7 from .util
import combine_task_graph_files
, create_tasks
, fetch_graph_and_labels
10 @register_callback_action(
14 description
="Add new jobs using task labels.",
22 "description": "An array of task labels",
23 "items": {"type": "string"},
31 "description": "How many times to run each task.",
36 def add_new_jobs_action(parameters
, graph_config
, input, task_group_id
, task_id
):
37 decision_task_id
, full_task_graph
, label_to_taskid
, _
= fetch_graph_and_labels(
38 parameters
, graph_config
42 for elem
in input["tasks"]:
43 if elem
in full_task_graph
.tasks
:
46 raise Exception(f
"{elem} was not found in the task-graph")
48 times
= input.get("times", 1)
49 for i
in range(times
):
59 combine_task_graph_files(list(range(times
)))