2016-05-17 01:53:22 +03:00
|
|
|
# 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/.
|
|
|
|
|
2021-09-08 23:31:45 +03:00
|
|
|
import logging
|
|
|
|
import os
|
2017-09-29 18:35:30 +03:00
|
|
|
|
2022-01-31 20:03:19 +03:00
|
|
|
from taskgraph.parameters import extend_parameters_schema
|
2022-12-16 14:14:02 +03:00
|
|
|
from voluptuous import Any, Required
|
2017-09-29 18:35:30 +03:00
|
|
|
|
2022-01-31 20:03:19 +03:00
|
|
|
from gecko_taskgraph import GECKO
|
2016-05-17 01:53:22 +03:00
|
|
|
|
2020-05-19 23:00:32 +03:00
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2017-09-28 22:25:34 +03:00
|
|
|
|
2022-01-31 20:03:19 +03:00
|
|
|
gecko_parameters_schema = {
|
|
|
|
Required("app_version"): str,
|
|
|
|
Required("backstop"): bool,
|
|
|
|
Required("build_number"): int,
|
2022-10-31 16:14:23 +03:00
|
|
|
Required("enable_always_target"): bool,
|
2022-01-31 20:03:19 +03:00
|
|
|
Required("hg_branch"): str,
|
|
|
|
Required("message"): str,
|
|
|
|
Required("next_version"): Any(None, str),
|
|
|
|
Required("optimize_strategies"): Any(None, str),
|
|
|
|
Required("phabricator_diff"): Any(None, str),
|
|
|
|
Required("release_enable_emefree"): bool,
|
|
|
|
Required("release_enable_partner_repack"): bool,
|
|
|
|
Required("release_enable_partner_attribution"): bool,
|
|
|
|
Required("release_eta"): Any(None, str),
|
|
|
|
Required("release_history"): {str: dict},
|
|
|
|
Required("release_partners"): Any(None, [str]),
|
|
|
|
Required("release_partner_config"): Any(None, dict),
|
|
|
|
Required("release_partner_build_number"): int,
|
|
|
|
Required("release_type"): str,
|
|
|
|
Required("release_product"): Any(None, str),
|
|
|
|
Required("required_signoffs"): [str],
|
|
|
|
Required("signoff_urls"): dict,
|
|
|
|
Required("test_manifest_loader"): str,
|
|
|
|
Required("try_mode"): Any(None, str),
|
|
|
|
Required("try_options"): Any(None, dict),
|
|
|
|
Required("try_task_config"): dict,
|
|
|
|
Required("version"): str,
|
|
|
|
}
|
2017-09-29 18:35:30 +03:00
|
|
|
|
|
|
|
|
2018-01-27 00:09:35 +03:00
|
|
|
def get_contents(path):
|
2021-08-24 22:35:46 +03:00
|
|
|
with open(path, "r") as fh:
|
2018-01-27 00:09:35 +03:00
|
|
|
contents = fh.readline().rstrip()
|
|
|
|
return contents
|
|
|
|
|
|
|
|
|
2018-09-29 23:53:10 +03:00
|
|
|
def get_version(product_dir="browser"):
|
|
|
|
version_path = os.path.join(GECKO, product_dir, "config", "version_display.txt")
|
|
|
|
return get_contents(version_path)
|
|
|
|
|
|
|
|
|
|
|
|
def get_app_version(product_dir="browser"):
|
|
|
|
app_version_path = os.path.join(GECKO, product_dir, "config", "version.txt")
|
|
|
|
return get_contents(app_version_path)
|
2018-01-27 00:09:35 +03:00
|
|
|
|
|
|
|
|
2022-01-31 20:03:19 +03:00
|
|
|
def get_defaults(repo_root=None):
|
|
|
|
return {
|
|
|
|
"app_version": get_app_version(),
|
|
|
|
"backstop": False,
|
2022-02-02 17:59:00 +03:00
|
|
|
"base_repository": "https://hg.mozilla.org/mozilla-unified",
|
2022-01-31 20:03:19 +03:00
|
|
|
"build_number": 1,
|
2022-10-31 16:14:23 +03:00
|
|
|
"enable_always_target": False,
|
2022-02-02 17:59:00 +03:00
|
|
|
"head_repository": "https://hg.mozilla.org/mozilla-central",
|
2022-01-31 20:03:19 +03:00
|
|
|
"hg_branch": "default",
|
|
|
|
"message": "",
|
|
|
|
"next_version": None,
|
|
|
|
"optimize_strategies": None,
|
|
|
|
"phabricator_diff": None,
|
|
|
|
"project": "mozilla-central",
|
|
|
|
"release_enable_emefree": False,
|
|
|
|
"release_enable_partner_repack": False,
|
|
|
|
"release_enable_partner_attribution": False,
|
|
|
|
"release_eta": "",
|
|
|
|
"release_history": {},
|
|
|
|
"release_partners": [],
|
|
|
|
"release_partner_config": None,
|
|
|
|
"release_partner_build_number": 1,
|
|
|
|
"release_product": None,
|
|
|
|
"release_type": "nightly",
|
|
|
|
# This refers to the upstream repo rather than the local checkout, so
|
|
|
|
# should be hardcoded to 'hg' even with git-cinnabar.
|
|
|
|
"repository_type": "hg",
|
|
|
|
"required_signoffs": [],
|
|
|
|
"signoff_urls": {},
|
|
|
|
"test_manifest_loader": "default",
|
|
|
|
"try_mode": None,
|
|
|
|
"try_options": None,
|
|
|
|
"try_task_config": {},
|
|
|
|
"version": get_version(),
|
2020-02-05 01:32:12 +03:00
|
|
|
}
|
2019-02-15 00:34:49 +03:00
|
|
|
|
2020-10-26 21:34:53 +03:00
|
|
|
|
2022-01-31 20:03:19 +03:00
|
|
|
def register_parameters():
|
|
|
|
extend_parameters_schema(gecko_parameters_schema, defaults_fn=get_defaults)
|