Bug 1890689 accumulate input in LargerReceiverBlockSizeThanDesiredBuffering GTest...
[gecko.git] / taskcluster / android_taskgraph / transforms / upstream_artifacts.py
blob895719d411fe81cf9bfe9b1e79a5d995c4c2919a
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.transforms.base import TransformSequence
6 from taskgraph.util.dependencies import get_dependencies
8 from android_taskgraph.util.scriptworker import generate_beetmover_upstream_artifacts
10 transforms = TransformSequence()
13 def _get_task_type(dep_kind):
14 if dep_kind.startswith("build-"):
15 return "build"
16 elif dep_kind.startswith("signing-"):
17 return "signing"
18 return dep_kind
21 @transforms.add
22 def build_upstream_artifacts(config, tasks):
23 for task in tasks:
24 worker_definition = {
25 "upstream-artifacts": [],
27 if "artifact_map" in task["attributes"]:
28 # Beetmover-apk tasks use declarative artifacts.
29 locale = task["attributes"].get("locale")
30 build_type = task["attributes"]["build-type"]
31 worker_definition[
32 "upstream-artifacts"
33 ] = generate_beetmover_upstream_artifacts(config, task, build_type, locale)
34 else:
35 for dep in get_dependencies(config, task):
36 paths = list(dep.attributes.get("artifacts", {}).values())
37 paths.extend(
39 apk_metadata["name"]
40 for apk_metadata in dep.attributes.get("apks", {}).values()
43 if dep.attributes.get("aab"):
44 paths.extend([dep.attributes.get("aab")])
45 if paths:
46 worker_definition["upstream-artifacts"].append(
48 "taskId": {"task-reference": f"<{dep.kind}>"},
49 "taskType": _get_task_type(dep.kind),
50 "paths": sorted(paths),
54 task.setdefault("worker", {}).update(worker_definition)
55 yield task