Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand All @@ -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")]
Expand Down