gecko-dev/taskcluster/gecko_taskgraph/transforms/build_attrs.py
Andrew Halberstadt 7176a9a02c Bug 1886193 - Use 'build' optimization strategy for new Android builds, r=geckoview-reviewers,taskgraph-reviewers,jcristau,tthibaud
By setting these to the "build" optimization, it means that bugbug will apply its
machine learning algorithm on autoland and with `mach try auto`.

But in addition, this also sets up some new SCHEDULES rules. A new mutually
exclusive SCHEDULES group around the "application" is created. Namely it can be
one of:

- firefox
- fenix
- focus-android

Files under `/browser` are tagged with the "firefox" component, while files
under `mobile/android` will be tagged with both "fenix" and "focus-android"
components. Files under the `mobile/android/fenix` or
`mobile/android/focus-android` dirs are further restricted to their respective
component. Note that any files that can impact Gecko should not be tagged with
any of these components.

On the task side, all of the prior Firefox builds and tests are tagged with the
"firefox" component, while all of the new Android builds and tests are tagged
with "fenix", "focus-android" or both (depending on the task).

The upshot of all this, is that patches that *only* modify files under
`/mobile/android` will not run any of the Firefox builds and tests. Conversely
patches that *only* modify files under `/browser` will not run any of the
Android builds and tests.

Differential Revision: https://phabricator.services.mozilla.com/D205127
2024-03-21 16:02:24 +00:00

34 lines
1.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/.
from taskgraph.transforms.base import TransformSequence
transforms = TransformSequence()
@transforms.add
def set_build_attributes(config, jobs):
"""
Set the build_platform and build_type attributes based on the job name.
Although not all jobs using this transform are actual "builds", the try
option syntax treats them as such, and this arranges the attributes
appropriately for that purpose.
"""
for job in jobs:
build_platform, build_type = job["name"].split("/")
# pgo builds are represented as a different platform, type opt
if build_type == "pgo":
build_platform = build_platform + "-pgo"
build_type = "opt"
attributes = job.setdefault("attributes", {})
attributes.update(
{
"build_platform": build_platform,
"build_type": build_type,
}
)
yield job