Skip to content

Commit

Permalink
Constants should use upper case letters
Browse files Browse the repository at this point in the history
branches_main -> BRANCHES_MAIN
builders_autobake -> BUILDERS_AUTOBAKE
builders_big -> BUILDERS_BIG
builders_dockerlibrary -> BUILDERS_DOCKERLIBRARY
builders_eco -> BUILDERS_ECO
builders_galera -> BUILDERS_GALERA
builders_install -> BUILDERS_INSTALL
builders_s3 -> BUILDERS_S3
builders_upgrade -> BUILDERS_UPGRADE
builders_wordpress -> BUILDERS_WORDPRESS
github_status_builders -> GITHUB_STATUS_BUILDERS
release_branches -> RELEASE_BRANCHES
savedPackageBranches -> SAVED_PACKAGE_BRANCHES
savedPackageBranches (master-galera) -> SAVED_PACKAGE_BRANCHES_GALERA
supportedPlatforms -> SUPPORTED_PLATFORMS
  • Loading branch information
cvicentiu committed Jan 7, 2025
1 parent 9116005 commit 6088cd7
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 105 deletions.
91 changes: 46 additions & 45 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
DEVELOPMENT_BRANCH = "11.3"

# Used to trigger the appropriate main branch
branches_main = [
BRANCHES_MAIN = [
"10.5",
"10.6",
"10.11",
Expand All @@ -22,7 +22,7 @@
]

# Defines what builders report status to GitHub
github_status_builders = [
GITHUB_STATUS_BUILDERS = [
"aarch64-macos-compile-only",
"amd64-debian-12",
"amd64-debian-12-debug-embedded",
Expand All @@ -38,21 +38,21 @@
]

# Special builders triggering
builders_big = ["amd64-ubuntu-2004-bigtest"]
builders_eco = [
BUILDERS_BIG = ["amd64-ubuntu-2004-bigtest"]
BUILDERS_ECO = [
"amd64-debian-10-eco-mysqljs",
"amd64-debian-10-eco-pymysql",
"amd64-ubuntu-2004-eco-php",
]

if os.getenv("ENVIRON") == "DEV":
builders_wordpress = ["amd64-rhel9-wordpress"]
builders_dockerlibrary = ["amd64-rhel9-dockerlibrary"]
BUILDERS_WORDPRESS = ["amd64-rhel9-wordpress"]
BUILDERS_DOCKERLIBRARY = ["amd64-rhel9-dockerlibrary"]
else:
builders_wordpress = ["amd64-rhel8-wordpress"]
builders_dockerlibrary = ["amd64-rhel8-dockerlibrary"]
BUILDERS_WORDPRESS = ["amd64-rhel8-wordpress"]
BUILDERS_DOCKERLIBRARY = ["amd64-rhel8-dockerlibrary"]

builders_galera_mtr = [
BUILDERS_GALERA_MTR = [
"aarch64-debian-12",
"amd64-fedora-39",
"s390x-ubuntu-2004",
Expand All @@ -61,27 +61,28 @@
"ppc64le-ubuntu-2204",
"amd64-freebsd-14",
]
builders_s3_mtr = [
BUILDERS_S3_MTR = [
"aarch64-ubuntu-2004-debug",
"amd64-ubuntu-2004-debug",
"s390x-sles-1506",
]

# Defines branches for which we save packages
savedPackageBranches = branches_main + [
SAVED_PACKAGE_BRANCHES = BRANCHES_MAIN + [
"bb-*-release",
"bb-10.2-compatibility",
"preview-*",
"*pkgtest*",
]

# The trees for which we save binary packages.
releaseBranches = ["bb-*-release", "preview-*"]
RELEASE_BRANCHES = ["bb-*-release", "preview-*"]

# Note:
# Maximum supported branch is the one where the default distro MariaDB package major version <= branch
# For example, if Debian 10 has MariaDB 10.3 by default, we don't support MariaDB 10.2 on it.
supportedPlatforms = {}
supportedPlatforms["10.5"] = [
SUPPORTED_PLATFORMS = {}
SUPPORTED_PLATFORMS["10.5"] = [
"aarch64-centos-stream9",
"aarch64-debian-10-bintar",
"aarch64-debian-11",
Expand Down Expand Up @@ -130,17 +131,17 @@
"x86-debian-12-fulltest",
]

supportedPlatforms["10.6"] = supportedPlatforms["10.5"].copy()
SUPPORTED_PLATFORMS["10.6"] = SUPPORTED_PLATFORMS["10.5"].copy()

# Add only 10.5 supported platforms
supportedPlatforms["10.5"] += [
SUPPORTED_PLATFORMS["10.5"] += [
"amd64-kvm-centos-6-bintar",
"amd64-kvm-ubuntu-1604-bintar",
"x86-kvm-centos-6-bintar",
"x86-kvm-ubuntu-1604-bintar",
]

supportedPlatforms["10.6"] += [
SUPPORTED_PLATFORMS["10.6"] += [
"aarch64-ubuntu-2204",
"amd64-opensuse-1505",
"amd64-sles-1505",
Expand All @@ -151,14 +152,14 @@
"x86-debian-12",
]

supportedPlatforms["10.9"] = supportedPlatforms["10.6"].copy()
SUPPORTED_PLATFORMS["10.9"] = SUPPORTED_PLATFORMS["10.6"].copy()

supportedPlatforms["10.10"] = [
SUPPORTED_PLATFORMS["10.10"] = [
"amd64-debian-11-aocc",
]
supportedPlatforms["10.10"] += supportedPlatforms["10.9"]
SUPPORTED_PLATFORMS["10.10"] += SUPPORTED_PLATFORMS["10.9"]

supportedPlatforms["10.11"] = [
SUPPORTED_PLATFORMS["10.11"] = [
"aarch64-debian-12",
"aarch64-fedora-40",
"aarch64-fedora-41",
Expand All @@ -175,26 +176,26 @@
"s390x-ubuntu-2404",
"ppc64le-debian-12",
]
supportedPlatforms["10.11"] += supportedPlatforms["10.10"]
SUPPORTED_PLATFORMS["10.11"] += SUPPORTED_PLATFORMS["10.10"]

supportedPlatforms["11.0"] = supportedPlatforms["10.11"].copy()
supportedPlatforms["11.1"] = supportedPlatforms["11.0"].copy()
supportedPlatforms["11.2"] = supportedPlatforms["11.1"].copy()
supportedPlatforms["11.3"] = supportedPlatforms["11.2"].copy()
supportedPlatforms["11.4"] = supportedPlatforms["11.3"].copy()
supportedPlatforms["11.4"] += [
SUPPORTED_PLATFORMS["11.0"] = SUPPORTED_PLATFORMS["10.11"].copy()
SUPPORTED_PLATFORMS["11.1"] = SUPPORTED_PLATFORMS["11.0"].copy()
SUPPORTED_PLATFORMS["11.2"] = SUPPORTED_PLATFORMS["11.1"].copy()
SUPPORTED_PLATFORMS["11.3"] = SUPPORTED_PLATFORMS["11.2"].copy()
SUPPORTED_PLATFORMS["11.4"] = SUPPORTED_PLATFORMS["11.3"].copy()
SUPPORTED_PLATFORMS["11.4"] += [
"aarch64-debian-sid",
"aarch64-ubuntu-2410",
"amd64-debian-sid",
"amd64-ubuntu-2410",
"ppc64le-debian-sid",
"x86-debian-sid",
]
supportedPlatforms["11.5"] = supportedPlatforms["11.4"].copy()
supportedPlatforms["11.6"] = supportedPlatforms["11.5"].copy()
supportedPlatforms["11.7"] = supportedPlatforms["11.6"].copy()
supportedPlatforms["11.8"] = supportedPlatforms["11.7"].copy()
supportedPlatforms["main"] = supportedPlatforms["11.8"].copy()
SUPPORTED_PLATFORMS["11.5"] = SUPPORTED_PLATFORMS["11.4"].copy()
SUPPORTED_PLATFORMS["11.6"] = SUPPORTED_PLATFORMS["11.5"].copy()
SUPPORTED_PLATFORMS["11.7"] = SUPPORTED_PLATFORMS["11.6"].copy()
SUPPORTED_PLATFORMS["11.8"] = SUPPORTED_PLATFORMS["11.7"].copy()
SUPPORTED_PLATFORMS["main"] = SUPPORTED_PLATFORMS["11.8"].copy()

# Define environment variables for MTR step
MTR_ENV = {
Expand Down Expand Up @@ -241,27 +242,27 @@
os_info = yaml.safe_load(f)

# Generate install builders based on the os_info data
builders_install = []
builders_upgrade = []
builders_autobake = []
all_platforms = set()
BUILDERS_INSTALL = []
BUILDERS_UPGRADE = []
BUILDERS_AUTOBAKE = []
ALL_PLATFORMS = set()
for os_i in os_info:
for arch in os_info[os_i]["arch"]:
builder_name_autobake = (
arch + "-" + os_i + "-" + os_info[os_i]["type"] + "-autobake"
)
if not ("install_only" in os_info[os_i] and os_info[os_i]["install_only"]):
all_platforms.add(arch)
builders_autobake.append(builder_name_autobake)
ALL_PLATFORMS.add(arch)
BUILDERS_AUTOBAKE.append(builder_name_autobake)
# Currently there are no VMs for x86 and s390x and OpenSUSE and SLES
if arch not in ["s390x", "x86"] and "sles" not in os_i:
builders_install.append(builder_name_autobake + "-install")
builders_upgrade.append(builder_name_autobake + "-minor-upgrade-all")
builders_upgrade.append(
BUILDERS_INSTALL.append(builder_name_autobake + "-install")
BUILDERS_UPGRADE.append(builder_name_autobake + "-minor-upgrade-all")
BUILDERS_UPGRADE.append(
builder_name_autobake + "-minor-upgrade-columnstore"
)
builders_upgrade.append(builder_name_autobake + "-major-upgrade")
BUILDERS_UPGRADE.append(builder_name_autobake + "-major-upgrade")

builders_galera = list(
map(lambda x: "gal-" + "-".join(x.split("-")[:3]), builders_autobake)
BUILDERS_GALERA = list(
map(lambda x: "gal-" + "-".join(x.split("-")[:3]), BUILDERS_AUTOBAKE)
)
6 changes: 3 additions & 3 deletions locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def getLocks(props):
assert builder_name is not None

if (
builder_name in github_status_builders
or builder_name in builders_install
or builder_name in builders_upgrade
builder_name in GITHUB_STATUS_BUILDERS
or builder_name in BUILDERS_INSTALL
or builder_name in BUILDERS_UPGRADE
):
return []
locks = []
Expand Down
2 changes: 1 addition & 1 deletion master-bintars/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname=os.getenv("MASTER_CREDENTIALS_DIR", default="/srv/buildbot/master/master-credential-provider"))]
Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard-2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname=os.getenv("MASTER_CREDENTIALS_DIR", default="/srv/buildbot/master/master-credential-provider"))]
Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname=os.getenv("MASTER_CREDENTIALS_DIR", default="/srv/buildbot/master/master-credential-provider"))]
Expand Down
20 changes: 10 additions & 10 deletions master-galera/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ c["buildbotNetUsageData"] = None

# Configure the Schedulers, which decide how to react to incoming changes.

branches_main = ["mariadb-3.x", "mariadb-4.x", "bb-*"]
savedPackageBranches = ["mariadb-3.x", "mariadb-4.x", "bb-*"]
BRANCHES_MAIN = ["mariadb-3.x", "mariadb-4.x", "bb-*"]
SAVED_PACKAGE_BRANCHES_GALERA = ["mariadb-3.x", "mariadb-4.x", "bb-*"]

# git branch filter using fnmatch
import fnmatch


def upstream_branch_fn(branch):
return (
branch in branches_main
branch in BRANCHES_MAIN
or fnmatch.fnmatch(branch, "mariadb-3.x")
or fnmatch.fnmatch(branch, "mariadb-4.x")
or fnmatch.fnmatch(branch, "bb-*")
Expand All @@ -94,7 +94,7 @@ schedulerTrigger = schedulers.AnyBranchScheduler(
builderNames=["trigger-galera-builds"],
)
schedulerGaleraBuilders = schedulers.Triggerable(
name="s_galera_builders", builderNames=builders_galera
name="s_galera_builders", builderNames=BUILDERS_GALERA
)

c["schedulers"].append(schedulerTrigger)
Expand Down Expand Up @@ -191,7 +191,7 @@ def addWorker(
c["workers"].append(instance)


for platform in all_platforms:
for platform in ALL_PLATFORMS:
jobs = None
if platform == "amd64":
machines = ["hz-bbw"]
Expand Down Expand Up @@ -265,7 +265,7 @@ def dpkgDeb():
"""
),
],
doStepIf=lambda step: savePackage(step, savedPackageBranches),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA),
)


Expand All @@ -284,7 +284,7 @@ def rpmSave():
"""
),
],
doStepIf=lambda step: savePackage(step, savedPackageBranches),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA),
)


Expand Down Expand Up @@ -366,7 +366,7 @@ EOF
""",
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
),
doStepIf=lambda step: savePackage(step, savedPackageBranches),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA),
)
)
f_deb_build.addStep(
Expand Down Expand Up @@ -423,7 +423,7 @@ EOF
""",
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
),
doStepIf=lambda step: savePackage(step, savedPackageBranches),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA),
)
)
f_rpm_build.addStep(
Expand Down Expand Up @@ -455,7 +455,7 @@ for os_i in os_info:
for arch in os_info[os_i]["arch"]:
builder_name = "gal-" + arch + "-" + os_i

assert builder_name in builders_galera
assert builder_name in BUILDERS_GALERA

worker_name = arch + "-bbw-docker-" + os_i
if arch == "amd64":
Expand Down
2 changes: 1 addition & 1 deletion master-libvirt/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ c["workers"] = []
c["builders"] = []

# Add the workers and builds based on the configured install builders (see constants.py)
for builder_name in builders_install:
for builder_name in BUILDERS_INSTALL:
# Parse builder name
platform, os_name, os_version, builder_type = builder_name.split("-")[:4]

Expand Down
2 changes: 1 addition & 1 deletion master-nonlatent/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname=os.getenv("MASTER_CREDENTIALS_DIR", default="/srv/buildbot/master/master-credential-provider"))]
Expand Down
2 changes: 1 addition & 1 deletion master-protected-branches/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname=os.getenv("MASTER_CREDENTIALS_DIR", default="/srv/buildbot/master/master-credential-provider"))]
Expand Down
2 changes: 1 addition & 1 deletion master-web/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ import fnmatch

def upstream_branch_fn(branch):
return (
branch in branches_main
branch in BRANCHES_MAIN
or fnmatch.fnmatch(branch, "bb-*")
or fnmatch.fnmatch(branch, "st-*")
or fnmatch.fnmatch(branch, "prot-*")
Expand Down
6 changes: 3 additions & 3 deletions master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gs = reporters.GitHubStatusPush(
startDescription="Build started.",
endDescription="Build done.",
verbose=True,
builders=github_status_builders,
builders=GITHUB_STATUS_BUILDERS,
)
c["services"].append(gs)
c['secretsProviders'] = [secrets.SecretInAFile(dirname="/srv/buildbot/master/master-credential-provider")]
Expand Down Expand Up @@ -298,9 +298,9 @@ for builder in master_config["builders"]:
build_type = os_info[os_name]["type"]

# Add builder only if it's not a protected branches one
if builder not in github_status_builders:
if builder not in GITHUB_STATUS_BUILDERS:
tags = [os_name]
if arch == "s390x" and builder in builders_galera_mtr:
if arch == "s390x" and builder in BUILDERS_GALERA_MTR:
tags += ["experimental"]
if "sid" in builder or "stream-9" in builder:
tags += ["bleeding-edge"]
Expand Down
Loading

0 comments on commit 6088cd7

Please sign in to comment.