Bug 1568277 - [taskgraph] Ensure user specified optimization strategies update instead of replace the default ones r=tomprince

Differential Revision: https://phabricator.services.mozilla.com/D40205

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-08-16 14:26:08 +00:00
Родитель 7828bae0b4
Коммит 4a606dff00
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -334,7 +334,7 @@ class TaskGraphGenerator(object):
parameters,
do_not_optimize,
existing_tasks=existing_tasks,
strategies=strategies,
strategy_override=strategies,
)
yield verifications('optimized_task_graph', optimized_task_graph, graph_config)

Просмотреть файл

@ -36,7 +36,7 @@ def register_strategy(name, args=()):
def optimize_task_graph(target_task_graph, params, do_not_optimize,
existing_tasks=None, strategies=None):
existing_tasks=None, strategy_override=None):
"""
Perform task optimization, returning a taskgraph and a map from label to
assigned taskId, including replacement tasks.
@ -46,7 +46,9 @@ def optimize_task_graph(target_task_graph, params, do_not_optimize,
existing_tasks = {}
# instantiate the strategies for this optimization process
strategies = strategies or registry.copy()
strategies = registry.copy()
if strategy_override:
strategies.update(strategy_override)
optimizations = _get_optimizations(target_task_graph, strategies)