diff --git a/constants.py b/constants.py index 39af5e9a..71f9cba8 100644 --- a/constants.py +++ b/constants.py @@ -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", @@ -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", @@ -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", @@ -61,13 +61,13 @@ "ppc64le-ubuntu-2204", "amd64-freebsd-14", ] -builders_s3_mtr = [ +BUILDERS_S3_MTR = [ "aarch64-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-*", @@ -75,13 +75,13 @@ ] # 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", @@ -130,17 +130,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", @@ -151,14 +151,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", @@ -175,14 +175,14 @@ "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", @@ -190,11 +190,11 @@ "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 = { @@ -238,30 +238,30 @@ # Edit with care with open("/srv/buildbot/master/os_info.yaml") as f: - os_info = yaml.safe_load(f) + OS_INFO = yaml.safe_load(f) # Generate install builders based on the os_info data -builders_install = [] -builders_upgrade = [] -builders_autobake = [] -all_platforms = set() -for os_i in os_info: - for arch in os_info[os_i]["arch"]: +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" + 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) + 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) # 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) ) diff --git a/define_masters.py b/define_masters.py index d5b8065e..ed90ccec 100755 --- a/define_masters.py +++ b/define_masters.py @@ -10,14 +10,14 @@ exec(open("master-private.cfg").read(), config, {}) with open("os_info.yaml", encoding="utf-8") as file: - os_info = yaml.safe_load(file) + OS_INFO = yaml.safe_load(file) platforms = {} -for os_name in os_info: - if "install_only" in os_info[os_name] and os_info[os_name]["install_only"]: +for os_name in OS_INFO: + if "install_only" in OS_INFO[os_name] and OS_INFO[os_name]["install_only"]: continue - for arch in os_info[os_name]["arch"]: + for arch in OS_INFO[os_name]["arch"]: builder_name = arch + "-" + os_name if arch not in platforms: platforms[arch] = [] diff --git a/locks.py b/locks.py index c80239c8..fb6b57ac 100644 --- a/locks.py +++ b/locks.py @@ -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 = [] diff --git a/master-bintars/master.cfg b/master-bintars/master.cfg index 22dd4327..475625b5 100644 --- a/master-bintars/master.cfg +++ b/master-bintars/master.cfg @@ -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"))] diff --git a/master-docker-nonstandard-2/master.cfg b/master-docker-nonstandard-2/master.cfg index fb8b6305..db7311a4 100644 --- a/master-docker-nonstandard-2/master.cfg +++ b/master-docker-nonstandard-2/master.cfg @@ -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"))] diff --git a/master-docker-nonstandard/master.cfg b/master-docker-nonstandard/master.cfg index 992739a7..3dd33e51 100644 --- a/master-docker-nonstandard/master.cfg +++ b/master-docker-nonstandard/master.cfg @@ -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"))] diff --git a/master-galera/master.cfg b/master-galera/master.cfg index 00a47898..b121b740 100644 --- a/master-galera/master.cfg +++ b/master-galera/master.cfg @@ -65,8 +65,8 @@ 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 @@ -74,7 +74,7 @@ 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-*") @@ -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) @@ -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"] @@ -219,13 +219,13 @@ for platform in all_platforms: for w_name in machines: for i in worker_ids: - for os_str in os_info: + for os_str in OS_INFO: if ( - "install_only" in os_info[os_str] - and os_info[os_str]["install_only"] + "install_only" in OS_INFO[os_str] + and OS_INFO[os_str]["install_only"] ): continue - if platform in os_info[os_str]["arch"]: + if platform in OS_INFO[os_str]["arch"]: quay_name = os.getenv("CONTAINER_REGISTRY_URL", default="quay.io/mariadb-foundation/bb-worker:") + "".join( os_str.split("-") ) @@ -265,7 +265,7 @@ def dpkgDeb(): """ ), ], - doStepIf=lambda step: savePackage(step, savedPackageBranches), + doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA), ) @@ -284,7 +284,7 @@ def rpmSave(): """ ), ], - doStepIf=lambda step: savePackage(step, savedPackageBranches), + doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES_GALERA), ) @@ -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( @@ -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( @@ -449,13 +449,13 @@ c["builders"].append( ) ) -for os_i in os_info: - if "install_only" in os_info[os_i] and os_info[os_i]["install_only"]: +for os_i in OS_INFO: + if "install_only" in OS_INFO[os_i] and OS_INFO[os_i]["install_only"]: continue - for arch in os_info[os_i]["arch"]: + 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": @@ -463,7 +463,7 @@ for os_i in os_info: if arch == "x86": worker_name = "x64-bbw-docker-" + os_i + "-i386" - if os_info[os_i]["type"] == "rpm": + if OS_INFO[os_i]["type"] == "rpm": factory = f_rpm_build else: factory = f_deb_build diff --git a/master-libvirt/get_ssh_cnx_num.py b/master-libvirt/get_ssh_cnx_num.py index c78796da..daa65386 100644 --- a/master-libvirt/get_ssh_cnx_num.py +++ b/master-libvirt/get_ssh_cnx_num.py @@ -4,11 +4,11 @@ import yaml with open("../os_info.yaml") as f: - os_info = yaml.safe_load(f) + OS_INFO = yaml.safe_load(f) SSH_CONNECTIONS = 0 -for os in os_info: - for arch in os_info[os]["arch"]: +for os in OS_INFO: + for arch in OS_INFO[os]["arch"]: if arch not in ["s390x", "x86"] and "sles" not in os: SSH_CONNECTIONS += 1 diff --git a/master-libvirt/master.cfg b/master-libvirt/master.cfg index 2838d542..3067ffa0 100644 --- a/master-libvirt/master.cfg +++ b/master-libvirt/master.cfg @@ -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] @@ -273,13 +273,13 @@ for builder_name in builders_install: elif builder_type == "rpm": factory_install = f_rpm_install factory_upgrade = f_rpm_upgrade - build_arch = os_name + str(os_info[os_info_name]["version_name"]) + "-" + platform + build_arch = os_name + str(OS_INFO[os_info_name]["version_name"]) + "-" + platform # FIXME - all RPM's should follow the same conventions! - if os_name == "centos" and os_info[os_info_name]["version_name"] >= 9: + if os_name == "centos" and OS_INFO[os_info_name]["version_name"] >= 9: if platform == "amd64": platform = "x86_64" - build_arch = f"centos/{os_info[os_info_name]['version_name']}/{platform}" + build_arch = f"centos/{OS_INFO[os_info_name]['version_name']}/{platform}" c["builders"].append( @@ -294,7 +294,7 @@ for builder_name in builders_install: "systemdCapability": "yes", "needsGalera": "yes", "dist_name": os_name, - "version_name": os_info[os_info_name]["version_name"], + "version_name": OS_INFO[os_info_name]["version_name"], "arch": build_arch, "BB_CI": True, "artifactsURL": artifactsURL, @@ -318,7 +318,7 @@ for builder_name in builders_install: "systemdCapability": "yes", "needsGalera": "yes", "dist_name": os_name, - "version_name": os_info[os_info_name]["version_name"], + "version_name": OS_INFO[os_info_name]["version_name"], "arch": build_arch, "test_mode": "server", "test_type": "major", @@ -344,7 +344,7 @@ for builder_name in builders_install: "systemdCapability": "yes", "needsGalera": "yes", "dist_name": os_name, - "version_name": os_info[os_info_name]["version_name"], + "version_name": OS_INFO[os_info_name]["version_name"], "arch": build_arch, "test_mode": "all", "test_type": "minor", @@ -368,7 +368,7 @@ for builder_name in builders_install: "systemdCapability": "yes", "needsGalera": "no", "dist_name": os_name, - "version_name": os_info[os_info_name]["version_name"], + "version_name": OS_INFO[os_info_name]["version_name"], "arch": build_arch, "test_mode": "columnstore", "test_type": "minor", diff --git a/master-nonlatent/master.cfg b/master-nonlatent/master.cfg index beb77370..9fbf1c5b 100644 --- a/master-nonlatent/master.cfg +++ b/master-nonlatent/master.cfg @@ -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"))] diff --git a/master-protected-branches/master.cfg b/master-protected-branches/master.cfg index 91b7aa5b..f11893e8 100644 --- a/master-protected-branches/master.cfg +++ b/master-protected-branches/master.cfg @@ -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"))] diff --git a/master-web/master.cfg b/master-web/master.cfg index 3e5a691a..c2e6685f 100644 --- a/master-web/master.cfg +++ b/master-web/master.cfg @@ -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-*") diff --git a/master.cfg b/master.cfg index 1ec15fcc..2d298739 100644 --- a/master.cfg +++ b/master.cfg @@ -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")] @@ -284,9 +284,9 @@ for builder in master_config["builders"]: os_name = "-".join(splits[1:]) mtr_additional_args = None - if "mtr_additional_args" in os_info[os_name]: - if arch in os_info[os_name]["mtr_additional_args"]: - mtr_additional_args = os_info[os_name]["mtr_additional_args"][arch] + if "mtr_additional_args" in OS_INFO[os_name]: + if arch in OS_INFO[os_name]["mtr_additional_args"]: + mtr_additional_args = OS_INFO[os_name]["mtr_additional_args"][arch] if arch == "amd64": arch = "x64" @@ -295,12 +295,12 @@ for builder in master_config["builders"]: if arch == "x86": worker_name = "x64-bbw-docker-" + os_name + "-i386" - build_type = os_info[os_name]["type"] + 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"] diff --git a/schedulers_definition.py b/schedulers_definition.py index f8edb0ee..4275bc27 100644 --- a/schedulers_definition.py +++ b/schedulers_definition.py @@ -1,14 +1,14 @@ from buildbot.plugins import schedulers, util from constants import ( - builders_autobake, - builders_big, - builders_dockerlibrary, - builders_eco, - builders_install, - builders_upgrade, - builders_wordpress, - github_status_builders, - supportedPlatforms, + BUILDERS_AUTOBAKE, + BUILDERS_BIG, + BUILDERS_DOCKERLIBRARY, + BUILDERS_ECO, + BUILDERS_INSTALL, + BUILDERS_UPGRADE, + BUILDERS_WORDPRESS, + GITHUB_STATUS_BUILDERS, + SUPPORTED_PLATFORMS, ) @@ -18,7 +18,7 @@ def getBranchBuilderNames(props): mBranch = props.getProperty("master_branch") builders = list( - filter(lambda x: x not in github_status_builders, supportedPlatforms[mBranch]) + filter(lambda x: x not in GITHUB_STATUS_BUILDERS, SUPPORTED_PLATFORMS[mBranch]) ) return builders @@ -29,7 +29,7 @@ def getProtectedBuilderNames(props): mBranch = props.getProperty("master_branch") builders = list( - filter(lambda x: x in supportedPlatforms[mBranch], github_status_builders) + filter(lambda x: x in SUPPORTED_PLATFORMS[mBranch], GITHUB_STATUS_BUILDERS) ) return builders @@ -38,7 +38,7 @@ def getProtectedBuilderNames(props): @util.renderer def getAutobakeBuilderNames(props): builderName = props.getProperty("parentbuildername") - for b in builders_autobake: + for b in BUILDERS_AUTOBAKE: if builderName in b: return [b] return [] @@ -48,7 +48,7 @@ def getAutobakeBuilderNames(props): def getBigtestBuilderNames(props): builderName = str(props.getProperty("parentbuildername")) - for b in builders_big: + for b in BUILDERS_BIG: if builderName in b: return [b] return [] @@ -58,7 +58,7 @@ def getBigtestBuilderNames(props): def getInstallBuilderNames(props): builderName = str(props.getProperty("parentbuildername")) - for b in builders_install: + for b in BUILDERS_INSTALL: if builderName in b: builders = [b] if "rhel" in builderName: @@ -73,7 +73,7 @@ def getUpgradeBuilderNames(props): builderName = str(props.getProperty("parentbuildername")) builds = [] - for b in builders_upgrade: + for b in BUILDERS_UPGRADE: if builderName in b: if "rhel" in builderName: builds.append(b.replace("rhel", "almalinux")) @@ -87,7 +87,7 @@ def getEcoBuilderNames(props): builderName = str(props.getProperty("parentbuildername")) builds = [] - for b in builders_eco: + for b in BUILDERS_ECO: if builderName in b: builds.append(b) return builds @@ -95,12 +95,12 @@ def getEcoBuilderNames(props): @util.renderer def getDockerLibraryNames(props): - return builders_dockerlibrary[0] + return BUILDERS_DOCKERLIBRARY[0] @util.renderer def getWordpressNames(props): - return builders_wordpress[0] + return BUILDERS_WORDPRESS[0] def getSchedulers(): diff --git a/utils.py b/utils.py index 1027d8ce..9fd8b9ac 100644 --- a/utils.py +++ b/utils.py @@ -16,18 +16,18 @@ from buildbot.steps.shell import Compile, SetPropertyFromCommand, ShellCommand, Test from buildbot.steps.source.github import GitHub from constants import ( + BUILDERS_AUTOBAKE, + BUILDERS_BIG, + BUILDERS_ECO, + BUILDERS_GALERA_MTR, + BUILDERS_INSTALL, + BUILDERS_S3_MTR, + BUILDERS_UPGRADE, DEVELOPMENT_BRANCH, MTR_ENV, - builders_autobake, - builders_big, - builders_eco, - builders_galera_mtr, - builders_install, - builders_s3_mtr, - builders_upgrade, - os_info, - releaseBranches, - savedPackageBranches, + OS_INFO, + RELEASE_BRANCHES, + SAVED_PACKAGE_BRANCHES, ) private_config = {"private": {}} @@ -280,10 +280,10 @@ def fnmatch_any(s, list_of_patterns): # Priority filter based on saved package branches def nextBuild(bldr, requests): for r in requests: - if fnmatch_any(r.sources[""].branch, releaseBranches): + if fnmatch_any(r.sources[""].branch, RELEASE_BRANCHES): return r for r in requests: - if fnmatch_any(r.sources[""].branch, savedPackageBranches): + if fnmatch_any(r.sources[""].branch, SAVED_PACKAGE_BRANCHES): return r return requests[0] @@ -337,7 +337,7 @@ def ls2list(rc, stdout, stderr): # Save packages for current branch? -def savePackage(step, savedBranches=savedPackageBranches): +def savePackage(step, savedBranches=SAVED_PACKAGE_BRANCHES): return step.getProperty("save_packages") and fnmatch_any( step.getProperty("branch"), savedBranches ) @@ -448,7 +448,7 @@ def hasFiles(step): def hasInstall(props): builderName = str(props.getProperty("buildername")) - for b in builders_install: + for b in BUILDERS_INSTALL: if builderName in b: return True return False @@ -457,7 +457,7 @@ def hasInstall(props): def hasUpgrade(props): builderName = str(props.getProperty("buildername")) - for b in builders_upgrade: + for b in BUILDERS_UPGRADE: if builderName in b: return True return False @@ -466,7 +466,7 @@ def hasUpgrade(props): def hasEco(props): builderName = str(props.getProperty("buildername")) - for b in builders_eco: + for b in BUILDERS_ECO: if builderName in b: return True return False @@ -552,7 +552,7 @@ def waitIfStaging(step): def hasAutobake(props): builderName = props.getProperty("buildername") - for b in builders_autobake: + for b in BUILDERS_AUTOBAKE: if builderName in b: return True return False @@ -561,7 +561,7 @@ def hasAutobake(props): def hasGalera(props): builderName = str(props.getProperty("buildername")) - for b in builders_galera_mtr: + for b in BUILDERS_GALERA_MTR: if builderName in b: return True return False @@ -570,7 +570,7 @@ def hasGalera(props): def hasS3(props): builderName = str(props.getProperty("buildername")) - for b in builders_s3_mtr: + for b in BUILDERS_S3_MTR: if builderName == b: return True return False @@ -579,7 +579,7 @@ def hasS3(props): def hasBigtest(props): builderName = str(props.getProperty("buildername")) - for b in builders_big: + for b in BUILDERS_BIG: if builderName in b: return True return False