diff --git a/locks.py b/locks.py index 282466f5..90ce7ec1 100644 --- a/locks.py +++ b/locks.py @@ -5,7 +5,13 @@ from buildbot.plugins import util # Local -from constants import BUILDERS_INSTALL, BUILDERS_UPGRADE, GITHUB_STATUS_BUILDERS +from constants import ( + BUILDERS_INSTALL, + BUILDERS_UPGRADE, + GITHUB_STATUS_BUILDERS, + RELEASE_BRANCHES, +) +from utils import fnmatch_any LOCKS: dict[str, util.MasterLock] = {} # worker_locks.yaml currently is in the same folder as locks.py. @@ -26,6 +32,7 @@ def getLocks(props): worker_name = props.getProperty("workername", default=None) builder_name = props.getProperty("buildername", default=None) + branch = props.getProperty("branch", default=None) assert worker_name is not None assert builder_name is not None @@ -36,6 +43,14 @@ def getLocks(props): ): return [] + # Autobake (packages) builders on release branches disobey locks + if ( + branch + and "autobake" in builder_name.lower() + and fnmatch_any(branch, RELEASE_BRANCHES) + ): + return [] + for worker_base_name in LOCKS: if worker_name.startswith(worker_base_name): return [LOCKS[worker_base_name].access("counting")]