def component_grouping()

in taskcluster/glean_taskgraph/loader/__init__.py [0:0]


def component_grouping(config, tasks):
    groups = {}
    for task in tasks:
        if task.kind not in config.get("kind-dependencies", []):
            continue

        buildconfig = task.attributes["buildconfig"]
        component = buildconfig["name"]
        if component == "all":
            continue

        groups.setdefault(component, []).append(task)

    tasks_for_all_components = [
        task for task in tasks
        if task.attributes.get("buildconfig", {}).get("name", "") == "all"
    ]
    for _, tasks in groups.items():
        tasks.extend(copy.deepcopy(tasks_for_all_components))

    return groups