Skip to content

Commit

Permalink
Merge pull request #66 from flichtenheld/gerrit-filter-merged
Browse files Browse the repository at this point in the history
Improvements for gerrit scheduler
  • Loading branch information
flichtenheld authored Sep 27, 2024
2 parents 414d83a + 1fdc5b4 commit 2abf3fa
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions buildbot-host/buildmaster/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -820,19 +820,6 @@ openvpn_file_patterns = [
openvpn_filter_fn = "^(" + "|".join(openvpn_file_patterns) + ")$"


def gerrit_filter(branch_name):
def filter_func(c):
ret = (
c.properties.getProperty("event.patchSet.uploader.name")
in verified_authors_list
and (c.properties.getProperty("target_branch") == branch_name)
and any([re.search(openvpn_filter_fn, f) for f in c.files])
)
return ret

return filter_func


openvpn_branches = {"main": openvpn_main_branch, "release": openvpn_release_branch}
for branch_type, branch_name in openvpn_branches.items():
# Ensure that in OpenVPN 2 we run smoke tests first and only if those pass run
Expand All @@ -857,10 +844,18 @@ for branch_type, branch_name in openvpn_branches.items():
openvpn_gerrit_smoketest_scheduler = schedulers.SingleBranchScheduler(
name=f"openvpn-gerrit-smoketest-{branch_type}",
change_filter=util.ChangeFilter(
filter_fn=gerrit_filter(branch_name),
repository_re=".*gerrit.*",
project="openvpn",
filter_fn=lambda c: any([re.search(openvpn_filter_fn, f) for f in c.files]),
property_eq={
"event.patchSet.uploader.name": verified_authors_list,
"target_branch": branch_name,
},
property_not_eq={
"event.change.status": "MERGED",
},
),
priority=1,
treeStableTimer=openvpn_tree_stable_timer,
builderNames=builder_names["openvpn-smoketest"],
)
Expand Down

0 comments on commit 2abf3fa

Please sign in to comment.