Bug 1572316 - Add l10n-bumper action. r=darktrojan a=wsmwk DONTBUILD
authorRob Lemley <rob@thunderbird.net>
Sun, 22 Mar 2020 01:11:06 -0400
changeset 37545 7e75d447441cf62fccbf3d883937b9f3577cdcc2
parent 37544 fc8fa71d32c28611cf42a68a826ca8e29e72a02a
child 37546 32f281ade26dca1452c47b8c5d04e3ea3b32eb6b
push id2570
push userthunderbird@calypsoblue.org
push dateWed, 25 Mar 2020 00:32:35 +0000
treeherdercomm-beta@7e75d447441c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan, wsmwk
bugs1572316
Bug 1572316 - Add l10n-bumper action. r=darktrojan a=wsmwk DONTBUILD A convenience action to run the l10n-bump task.
taskcluster/comm_taskgraph/__init__.py
taskcluster/comm_taskgraph/actions.py
--- a/taskcluster/comm_taskgraph/__init__.py
+++ b/taskcluster/comm_taskgraph/__init__.py
@@ -20,17 +20,17 @@ BALROG_PRODUCT = 'Thunderbird'
 
 
 def register(graph_config):
     """
     Import all modules that are siblings of this one, triggering decorators in
     the process.
     """
     logger.info("{} path registered".format(__name__))
-    _import_modules(['documentation'])
+    _import_modules(['documentation', 'actions'])
 
 
 def _import_modules(modules):
     for module in modules:
         import_module(".{}".format(module), package=__name__)
 
 
 def get_decision_parameters(graph_config, parameters):
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/actions.py
@@ -0,0 +1,44 @@
+#  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/.
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from taskgraph.actions.registry import register_callback_action
+from taskgraph.actions.util import (
+    create_tasks,
+    fetch_graph_and_labels,
+)
+from taskgraph.util.attributes import RELEASE_PROMOTION_PROJECTS
+
+
+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(
+        parameters, graph_config)
+    to_run = [label
+              for label, entry
+              in full_task_graph.tasks.items() if 'l10n-bump' in entry.kind]
+    create_tasks(
+        graph_config,
+        to_run,
+        full_task_graph,
+        label_to_taskid,
+        parameters,
+        decision_task_id,
+    )