# 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/.
---
loader: taskgraph.loader.transform:loader

# we need that to apply grouping only on jobs that have "build_platform", so we
# dont fail for the "fetch" kind that does is a dependency but does not have it
only-for-attributes:
    - build_platform

transforms:
    - taskgraph.transforms.from_deps
    - gecko_taskgraph.transforms.reprocess_symbols
    - gecko_taskgraph.transforms.job
    - gecko_taskgraph.transforms.task

kind-dependencies:
    - system-symbols
    - system-symbols-upload
    - fetch

tasks:
    system-symbols-reprocess:
        from-deps:
            kinds: ["system-symbols", "system-symbols-upload"]
            group-by: platform
        description: Reprocess Symbols on Crash-Stats
        attributes:
            cron: true
        worker-type: b-linux-gcp
        worker:
            docker-image: {in-tree: system-symbols-linux-scraper}
            max-run-time: 7200
            env:
                # {level} gets replaced in the reprocess_symbols transform
                CRASHSTATS_SECRET: "project/releng/gecko/build/level-{level}/gecko-symbol-reprocess"
                DUMP_SYMS: "/bin/false"
        run:
            using: run-task
            command: {task-reference: "${MOZ_FETCHES_DIR}/symbol-scrapers/reprocess.sh <system-symbols>"}
        fetches:
            fetch:
                - symbol-scrapers
        scopes:
            - secrets:get:project/releng/gecko/build/level-{level}/gecko-symbol-reprocess
