How to use the taskgraph.util.schema.resolve_keyed_by function in taskgraph

To help you get started, we’ve selected a few taskgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla-mobile / fenix / taskcluster / fenix_taskgraph / transforms / signing.py View on Github external
def resolve_keys(config, tasks):
    for task in tasks:
        for key in ("index", "worker-type", "worker.signing-type", "signing-format"):
            resolve_keyed_by(
                task,
                key,
                item_name=task["name"],
                **{
                    'build-type': task["attributes"]["build-type"],
                    'level': config.params["level"],
                }
            )
        yield task
github mozilla-mobile / fenix / taskcluster / fenix_taskgraph / raptor.py View on Github external
def build_raptor_task(config, tasks):
    for task in tasks:
        signing = task.pop("primary-dependency")
        task["dependencies"]["signing"] = signing.label
        build_type = task["attributes"]["build-type"]
        abi = task["attributes"]["abi"]
        apk = task["attributes"]["apk"]

        test_name = task.pop("test-name")

        task["name"] = "{}-{}-{}".format(task["name"], build_type, abi)
        task["description"] = "{}-{}".format(build_type, abi)

        for key in ("worker-type", "treeherder.platform"):
            resolve_keyed_by(task, key, item_name=task["name"], **{"abi": abi})

        task["treeherder"] = inherit_treeherder_from_dep(task, signing)

        extra_config = {
            "installer_url": "".format(apk),
            "test_packages_url": "",
        }
        env = task["worker"]["env"]
        env["EXTRA_MOZHARNESS_CONFIG"] = {
            "artifact-reference": json.dumps(extra_config, sort_keys=True)
        }
        env["GECKO_HEAD_REV"] = "default"
        env["MOZILLA_BUILD_URL"] = {"artifact-reference": "".format(apk)}
        env["MOZHARNESS_URL"] = {
            "artifact-reference": ""
        }
github mozilla-mobile / fenix / taskcluster / fenix_taskgraph / transforms / multi_dep.py View on Github external
def resolve_keys(config, tasks):
    for task in tasks:
        resolve_keyed_by(
            task,
            "treeherder.job-symbol",
            item_name=task["name"],
            **{
                'build-type': task["attributes"]["build-type"],
                'level': config.params["level"],
            }
        )
        yield task
github mozilla-mobile / fenix / taskcluster / fenix_taskgraph / transforms / push_apk.py View on Github external
def resolve_keys(config, tasks):
    for task in tasks:
        for key in ("worker.channel", "worker.dep"):
            resolve_keyed_by(
                task,
                key,
                item_name=task["name"],
                **{
                    'build-type': task["attributes"]["build-type"],
                    'level': config.params["level"],
                }
            )
        yield task
github mozilla-mobile / firefox-tv / taskcluster / firefox_tv_taskgraph / email.py View on Github external
def email_task(config, tasks):
    tag = config.params.get("head_tag")
    release_type = config.params.get("release_type")

    for task in tasks:
        resolve_keyed_by(task, "worker.content", task["name"], **{
            "release-type": release_type or "production"
        })

        if release_type == 'lat':
            task["dependencies"].pop("push")

        to_address = task["worker"].pop("to-address")
        content = task["worker"].pop("content")
        subject = task["worker"].pop("subject")
        task["scopes"] = ["queue:route:notify.email.{}.on-completed".format(to_address)]
        task["routes"] = ["notify.email.{}.on-completed".format(to_address)]
        task["extra"] = {
            "notify": {
                "email": {
                    "content": {"artifact-reference": content.format(tag=tag)},
                    "subject": subject.format(tag=tag),