# 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 re from typing import Literal, Union
from taskgraph.util.attributes import _match_run_on
# Mapping of project to list of branches that should be considered "release" # level. A value of `True` means all branches are considered release # (used by hg.mozilla.org based projects).
PROJECT_RELEASE_BRANCHES: dict[str, Union[list[str], Literal[True]]] = { # https://github.com/mozilla-firefox/firefox "firefox": [ "main", "beta", "release", "esr140", "esr153",
], "mozilla-central": True, "mozilla-beta": True, "mozilla-release": True, "mozilla-esr115": True, "mozilla-esr140": True, "mozilla-esr153": True, "comm-central": True, "comm-beta": True, "comm-release": True, "comm-esr140": True, "comm-esr153": True, # bug 1845368: pine is a permanent project branch used for testing # nightly updates "pine": True, # bug 1877483: larch has similar needs for nightlies "larch": True, # maple is also an L3 branch: https://phabricator.services.mozilla.com/D184833 "maple": True, # bug 1988213: cypress project branch "cypress": True,
}
RELEASE_PROJECTS = set(PROJECT_RELEASE_BRANCHES)
RELEASE_PROMOTION_PROJECTS = { "jamun", "maple", "try", "try-comm-central",
} | RELEASE_PROJECTS
TEMPORARY_PROJECTS = set({ # When using a "Disposable Project Branch" you can specify your branch here. e.g.: "oak",
})
def match_run_on_projects(params, run_on_projects): """Determine whether the given project is included in the `run-on-projects`
parameter, applying expansions for things like "integration" mentioned in
the attribute documentation."""
aliases = RUN_ON_PROJECT_ALIASES.keys()
run_aliases = set(aliases) & set(run_on_projects) if run_aliases: if any(RUN_ON_PROJECT_ALIASES[alias](params) for alias in run_aliases): returnTrue
return params["project"] in run_on_projects
def match_run_on_hg_branches(hg_branch, run_on_hg_branches): """Determine whether the given project is included in the `run-on-hg-branches`
parameter. Allows 'all'.""" if"all"in run_on_hg_branches: returnTrue
for expected_hg_branch_pattern in run_on_hg_branches: if re.match(expected_hg_branch_pattern, hg_branch): returnTrue
returnFalse
match_run_on_repo_type = _match_run_on
def copy_attributes_from_dependent_job(dep_job, denylist=()): return {
attr: dep_job.attributes[attr] for attr in _COPYABLE_ATTRIBUTES if attr in dep_job.attributes and attr notin denylist
}
def sorted_unique_list(*args): """Join one or more lists, and return a sorted list of unique members"""
combined = set().union(*args) return sorted(combined)
def release_level(params): """
Whether this is a staging release ornot.
:return str: One of "production"or"staging". """ if params["level"] != "3": return"staging" if branches := PROJECT_RELEASE_BRANCHES.get(params.get("project")): if branches isTrue: return"production"
m = re.match(r"refs/heads/(\S+)$", params["head_ref"]) if m isnotNoneand m.group(1) in branches: return"production"
return"staging"
def task_name(task): if task.label.startswith(task.kind + "-"): return task.label[len(task.kind) + 1 :] raise AttributeError(f"Task {task.label} does not have a name.")
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.