Skip to content

Commit cbc80ae

Browse files
alexreinkingclaude
andcommitted
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 <noreply@anthropic.com>
1 parent d547284 commit cbc80ae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

master/master.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ from buildbot.steps.shell import SetPropertyFromCommand, ShellCommand
2929
from buildbot.steps.source.github import GitHub
3030
from buildbot.steps.worker import MakeDirectory, RemoveDirectory, SetPropertiesFromEnv
3131
from buildbot.util import httpclientservice
32+
from buildbot.util.ssfilter import SourceStampFilter
3233
from buildbot.worker import Worker
3334
from buildbot.www.auth import UserPasswordAuth
3435
from buildbot.www.authz import Authz
@@ -1290,7 +1291,10 @@ c["services"] = [
12901291
],
12911292
verbose=True,
12921293
),
1293-
OldBuildCanceller("build_canceller", []),
1294+
OldBuildCanceller(
1295+
"build_canceller",
1296+
[([b.name for b in c["builders"]], SourceStampFilter(branch_re=r"^refs/pull/"))],
1297+
),
12941298
]
12951299

12961300
# Disable sending usage data

0 commit comments

Comments
 (0)