Debian Codegraph @

third_party/python/taskcluster_taskgraph/taskgraph/transforms/code_review.py

raw
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/.
4 """
5 Add soft dependencies and configuration to code-review tasks.
6 """
7
8 from taskgraph.transforms.base import TransformSequence
9
10 transforms = TransformSequence()
11
12
13 @transforms.add
14 def add_dependencies(config, tasks):
15 for task in tasks:
16 task.setdefault("soft-dependencies", [])
17 task["soft-dependencies"] += [
18 dep_task.label
19 for dep_task in config.kind_dependencies_tasks.values()
20 if dep_task.attributes.get("code-review") is True
21 ]
22 yield task