зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1630809 - only generate release-partner-repack tasks for enabled platforms r=aki
Prior to this patch the task graph would always include a release-partner-repack-<platform> task for all 6 platforms, regardless of what was specified in release_partner_config. This was particularly obvious in the off-cycle respin scenario when a single partner is repacked. By moving and reusing get_repack_ids_by_platform() it's easy to skip unneeded platforms. Differential Revision: https://phabricator.services.mozilla.com/D87724
This commit is contained in:
Родитель
aaa9dbde9d
Коммит
68740debe6
|
@ -12,8 +12,7 @@ import copy
|
|||
from mozbuild.chunkify import chunkify
|
||||
from taskgraph.transforms.base import TransformSequence
|
||||
from taskgraph.util.partners import (
|
||||
get_partner_config_by_kind,
|
||||
locales_per_build_platform,
|
||||
get_repack_ids_by_platform,
|
||||
apply_partner_priority,
|
||||
)
|
||||
|
||||
|
@ -21,22 +20,8 @@ transforms = TransformSequence()
|
|||
transforms.add(apply_partner_priority)
|
||||
|
||||
|
||||
def _get_repack_ids_by_platform(partner_configs, build_platform):
|
||||
combinations = []
|
||||
for partner, partner_config in partner_configs.items():
|
||||
for sub_partner, cfg in partner_config.items():
|
||||
if build_platform not in cfg.get("platforms", []):
|
||||
continue
|
||||
locales = locales_per_build_platform(build_platform, cfg.get('locales', []))
|
||||
for locale in locales:
|
||||
combinations.append("{}/{}/{}".format(partner, sub_partner, locale))
|
||||
return sorted(combinations)
|
||||
|
||||
|
||||
@transforms.add
|
||||
def chunk_partners(config, jobs):
|
||||
partner_configs = get_partner_config_by_kind(config, config.kind)
|
||||
|
||||
for job in jobs:
|
||||
dep_job = job['primary-dependency']
|
||||
build_platform = dep_job.attributes["build_platform"]
|
||||
|
@ -52,7 +37,7 @@ def chunk_partners(config, jobs):
|
|||
yield job
|
||||
# first downstream of the repack task, no chunking or fanout has been done yet
|
||||
elif not any([repack_id, repack_ids]):
|
||||
platform_repack_ids = _get_repack_ids_by_platform(partner_configs, build_platform)
|
||||
platform_repack_ids = get_repack_ids_by_platform(config, build_platform)
|
||||
# we chunk mac signing
|
||||
if config.kind in ("release-partner-repack-signing",
|
||||
"release-eme-free-repack-signing",
|
||||
|
|
|
@ -13,6 +13,7 @@ from taskgraph.util.scriptworker import get_release_config
|
|||
from taskgraph.util.partners import (
|
||||
check_if_partners_enabled,
|
||||
get_partner_url_config,
|
||||
get_repack_ids_by_platform,
|
||||
apply_partner_priority,
|
||||
)
|
||||
|
||||
|
@ -21,6 +22,17 @@ transforms = TransformSequence()
|
|||
transforms.add(apply_partner_priority)
|
||||
|
||||
|
||||
@transforms.add
|
||||
def skip_unnecessary_platforms(config, tasks):
|
||||
for task in tasks:
|
||||
if config.kind == "release-partner-repack":
|
||||
platform = task['attributes']['build_platform']
|
||||
repack_ids = get_repack_ids_by_platform(config, platform)
|
||||
if not repack_ids:
|
||||
continue
|
||||
yield task
|
||||
|
||||
|
||||
@transforms.add
|
||||
def populate_repack_manifests_url(config, tasks):
|
||||
for task in tasks:
|
||||
|
|
|
@ -410,6 +410,19 @@ def get_partner_url_config(parameters, graph_config):
|
|||
return partner_url_config
|
||||
|
||||
|
||||
def get_repack_ids_by_platform(config, build_platform):
|
||||
partner_config = get_partner_config_by_kind(config, config.kind)
|
||||
combinations = []
|
||||
for partner, subconfigs in partner_config.items():
|
||||
for sub_config_name, sub_config in subconfigs.items():
|
||||
if build_platform not in sub_config.get("platforms", []):
|
||||
continue
|
||||
locales = locales_per_build_platform(build_platform, sub_config.get('locales', []))
|
||||
for locale in locales:
|
||||
combinations.append("{}/{}/{}".format(partner, sub_config_name, locale))
|
||||
return sorted(combinations)
|
||||
|
||||
|
||||
def get_partners_to_be_published(config):
|
||||
# hardcoded kind because release-bouncer-aliases doesn't match otherwise
|
||||
partner_config = get_partner_config_by_kind(config, 'release-partner-repack')
|
||||
|
|
Загрузка…
Ссылка в новой задаче