2020-03-22 08:11:06 +03:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2021-10-06 07:47:46 +03:00
|
|
|
from gecko_taskgraph.actions.registry import register_callback_action
|
2022-12-20 00:10:08 +03:00
|
|
|
from gecko_taskgraph.actions.util import create_tasks, fetch_graph_and_labels
|
2021-10-06 07:47:46 +03:00
|
|
|
from gecko_taskgraph.util.attributes import RELEASE_PROMOTION_PROJECTS
|
2020-03-22 08:11:06 +03:00
|
|
|
|
|
|
|
|
|
|
|
def is_release_promotion_available(parameters):
|
|
|
|
return parameters["project"] in RELEASE_PROMOTION_PROJECTS
|
|
|
|
|
|
|
|
|
|
|
|
@register_callback_action(
|
|
|
|
name="l10n-bump",
|
|
|
|
title="L10n Bumper Automation",
|
|
|
|
symbol="l10n_bump",
|
|
|
|
description="L10n bumper action.",
|
|
|
|
order=500,
|
|
|
|
context=[],
|
|
|
|
available=is_release_promotion_available,
|
|
|
|
)
|
|
|
|
def l10n_bump_action(parameters, graph_config, _input, task_group_id, task_id):
|
|
|
|
"""
|
|
|
|
Runs the 'l10n_bump' task.
|
|
|
|
"""
|
|
|
|
decision_task_id, full_task_graph, label_to_taskid = fetch_graph_and_labels(
|
2020-10-30 20:41:24 +03:00
|
|
|
parameters, graph_config
|
|
|
|
)
|
2022-12-20 00:10:10 +03:00
|
|
|
to_run = [label for label, entry in full_task_graph.tasks.items() if "l10n-bump" in entry.kind]
|
2020-03-22 08:11:06 +03:00
|
|
|
create_tasks(
|
|
|
|
graph_config,
|
|
|
|
to_run,
|
|
|
|
full_task_graph,
|
|
|
|
label_to_taskid,
|
|
|
|
parameters,
|
|
|
|
decision_task_id,
|
|
|
|
)
|