From b417cd4519cb7a4d963b652f42f680c216afb3d3 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 6 May 2024 19:57:12 +0200 Subject: [PATCH] chore(canceller): generalize it to any project Just iterate over all project names. Signed-off-by: Raito Bezarius --- buildbot_nix/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 67e9f9e..3ad58ec 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -797,6 +797,8 @@ class GerritNixConfigurator(ConfiguratorBase): # startCB, summaryCB are too noisy, we won't use them. ) + # Upstream defaults pretend they already do something similar + # but they didn't work, hence the custom function. def gerritBranchKey(b): ref = b['branch'] if not ref.startswith('refs/changes/'): @@ -805,18 +807,19 @@ class GerritNixConfigurator(ConfiguratorBase): config["services"].append( util.OldBuildCanceller( - "lix_build_canceller", + "build_canceller", filters=[ ( [ - f"lix/nix-{kind}" + f"{project}/nix-{kind}" for kind in [ "eval" ] + [ f"build/{arch}" for arch in self.nix_supported_systems + [ "other" ] ] ], - util.SourceStampFilter(project_eq=["lix"]) + util.SourceStampFilter(project_eq=[project]) ) + for project in self.projects ], branch_key=gerritBranchKey )