Bug 1889091 - Part 6: Remove "scratch" register parameter from emitPushArguments...
[gecko.git] / taskcluster / android_taskgraph / target_tasks.py
blob38b1f7b77277aa20e918ff22ed25449cb0ef58bf
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/.
5 from taskgraph.target_tasks import _target_task
7 from android_taskgraph.release_type import does_task_match_release_type
10 @_target_task("promote_android")
11 def target_tasks_promote(full_task_graph, parameters, graph_config):
12 return _filter_release_promotion(
13 full_task_graph,
14 parameters,
15 filtered_for_candidates=[],
16 shipping_phase="promote",
20 @_target_task("push_android")
21 def target_tasks_push(full_task_graph, parameters, graph_config):
22 filtered_for_candidates = target_tasks_promote(
23 full_task_graph,
24 parameters,
25 graph_config,
27 return _filter_release_promotion(
28 full_task_graph, parameters, filtered_for_candidates, shipping_phase="push"
32 @_target_task("ship_android")
33 def target_tasks_ship(full_task_graph, parameters, graph_config):
34 filtered_for_candidates = target_tasks_push(
35 full_task_graph,
36 parameters,
37 graph_config,
39 return _filter_release_promotion(
40 full_task_graph, parameters, filtered_for_candidates, shipping_phase="ship"
44 def _filter_release_promotion(
45 full_task_graph, parameters, filtered_for_candidates, shipping_phase
47 def filter(task, parameters):
48 # Include promotion tasks; these will be optimized out
49 if task.label in filtered_for_candidates:
50 return True
52 # Ship geckoview in firefox-android ship graph
53 if (
54 shipping_phase == "ship"
55 and task.attributes.get("shipping_product") == "fennec"
56 and task.kind in ("beetmover-geckoview", "upload-symbols")
57 and parameters["release_product"] == "firefox-android"
59 return True
61 # TODO: get rid of this release_type match
62 if (
63 task.attributes.get("shipping_phase") == shipping_phase
64 and task.attributes.get("shipping_product") == parameters["release_product"]
65 and does_task_match_release_type(task, parameters["release_type"])
67 return True
69 return False
71 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
74 @_target_task("screenshots")
75 def target_tasks_screnshots(full_task_graph, parameters, graph_config):
76 """Select the set of tasks required to generate screenshots on a real device."""
78 def filter(task, parameters):
79 return task.attributes.get("screenshots", False)
81 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
84 @_target_task("legacy_api_ui_tests")
85 def target_tasks_legacy_api_ui_tests(full_task_graph, parameters, graph_config):
86 """Select the set of tasks required to run select UI tests on other API."""
88 def filter(task, parameters):
89 return task.attributes.get("legacy", False)
91 return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]