From cbc80ae04231c071c588c4e7a9dfae51463f724a Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Thu, 30 Jul 2026 13:02:55 -0400 Subject: [PATCH] Cancel stale PR builds on new pushes OldBuildCanceller was already instantiated but with an empty filter list, making it a no-op. Populate it to track all builders on any refs/pull/* branch so that a new push to a PR cancels older pending or running builds for that same PR, instead of letting them run to completion alongside the new build. Co-Authored-By: Claude Sonnet 5 --- master/master.cfg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/master/master.cfg b/master/master.cfg index b0f5541..daa6b9b 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -29,6 +29,7 @@ from buildbot.steps.shell import SetPropertyFromCommand, ShellCommand from buildbot.steps.source.github import GitHub from buildbot.steps.worker import MakeDirectory, RemoveDirectory, SetPropertiesFromEnv from buildbot.util import httpclientservice +from buildbot.util.ssfilter import SourceStampFilter from buildbot.worker import Worker from buildbot.www.auth import UserPasswordAuth from buildbot.www.authz import Authz @@ -1290,7 +1291,10 @@ c["services"] = [ ], verbose=True, ), - OldBuildCanceller("build_canceller", []), + OldBuildCanceller( + "build_canceller", + [([b.name for b in c["builders"]], SourceStampFilter(branch_re=r"^refs/pull/"))], + ), ] # Disable sending usage data