# 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/.
import os import re
import attr import yaml from mozilla_version.gecko import FirefoxVersion
from ..cli import BaseTryParser from ..push import push_to_try, vcs
def read_file(path): with open(path) as fh: return fh.read()
class ReleaseParser(BaseTryParser):
name = "release"
arguments = [
[
["-v", "--version"],
{ "metavar": "STR", "required": True, "action": "store", "type": FirefoxVersion.parse, "help": "The version number to use for the staging release.",
},
],
[
["--migration"],
{ "metavar": "STR", "action": "append", "dest": "migrations", "choices": [ "main-to-beta", "beta-to-release", "early-to-late-beta", "release-to-esr",
], "help": "Migration to run for the release (can be specified multiple times).",
},
],
[
["--no-limit-locales"],
{ "action": "store_false", "dest": "limit_locales", "help": "Don't build a limited number of locales in the staging release.",
},
],
[
["--tasks"],
{ "choices": TARGET_TASKS.keys(), "default": "staging", "help": ( "Which tasks to run on-push. " "'staging' (default): shippable build-phase tasks only (builds, signing, " "repackaging) — the minimal set before triggering a staging release via " "https://shipit.staging.mozilla-releng.net/. " "'release-sim': simulates a full release branch push including tests — " "used by sheriffs to check for branch-dependent test failures."
),
},
],
]
common_groups = ["push"]
task_configs = ["disable-pgo", "worker-overrides", "existing-tasks"]
with open(
os.path.join(vcs.path, "taskcluster/kinds/merge-automation/kind.yml")
) as f:
migration_configs = yaml.safe_load(f) for migration in migrations: # pull out the behaviour-specific configuration
actions = migration_configs["tasks"]["merge-automation"]["worker"]["actions"]
behaviour_config = actions["by-behavior"][migration][0] # there is always one action in the behaviour config
migration_config = list(behaviour_config.values())[0] for path, from_, to in migration_config["replacements"]: if path in files_to_change:
contents = files_to_change[path] else:
contents = read_file(path)
from_ = from_.format(**format_options)
to = to.format(**format_options)
files_to_change[path] = contents.replace(from_, to)
for path, from_, to in migration_config.get("regex-replacements", []): if path in files_to_change:
contents = files_to_change[path] else:
contents = read_file(path)
from_regex = from_.format(**format_options)
to = to.format(**format_options)
files_to_change[path] = re.sub(from_regex, to, contents)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.