fune/taskcluster/taskgraph/transforms/run_pgo_profile.py
Andrew Halberstadt d024a31639 Bug 1726573 - Run 'pyupgrade --py36-plus' on taskcluster/taskgraph directory, r=taskgraph-reviewers,bhearsum
This patch was generated via:

  $ pyupgrade --py36-plus $(find taskcluster/taskgraph -name "*.py" -type f)
  $ autoflake --remove-all-unused-imports -i $(find taskcluster/taskgraph -name "*.py" -type f)

The same set of commands are being applied to standalone taskgraph as well so
they remain in sync.

Differential Revision: https://phabricator.services.mozilla.com/D123234
2021-08-24 19:35:46 +00:00

35 lines
1 KiB
Python

# 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/.
"""
Apply some defaults and minor modifications to the pgo jobs.
"""
from taskgraph.transforms.base import TransformSequence
import logging
logger = logging.getLogger(__name__)
transforms = TransformSequence()
@transforms.add
def run_profile_data(config, jobs):
for job in jobs:
build_platform = job["attributes"].get("build_platform")
instr = "instrumented-build-{}".format(job["name"])
if "android" in build_platform:
artifact = "geckoview-androidTest.apk"
elif "macosx64" in build_platform:
artifact = "target.dmg"
elif "win" in build_platform:
artifact = "target.zip"
else:
artifact = "target.tar.bz2"
job.setdefault("fetches", {})[instr] = [
artifact,
"target.crashreporter-symbols.zip",
]
yield job