summaryrefslogtreecommitdiffstats
path: root/third_party/python/taskcluster_taskgraph/taskgraph/transforms/code_review.py
blob: 2c859c36f64076120128dce3d40296fb949b59dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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/.
"""
Add soft dependencies and configuration to code-review tasks.
"""


from taskgraph.transforms.base import TransformSequence

transforms = TransformSequence()


@transforms.add
def add_dependencies(config, tasks):
    for task in tasks:
        task.setdefault("soft-dependencies", [])
        task["soft-dependencies"] += [
            dep_task.label
            for dep_task in config.kind_dependencies_tasks.values()
            if dep_task.attributes.get("code-review") is True
        ]
        yield task