From 72b67579477521d6856b0b297696d0a5038907dc 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 a2edb3a..7ed15d1 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -832,6 +832,8 @@ class GerritNixConfigurator(ConfiguratorBase): if self.prometheus_config is not None: config['services'].append(reporters.Prometheus(port=self.prometheus_config.get('port', 9100), interface=self.prometheus_config.get('address', ''))) + # 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/'): @@ -840,18 +842,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 )