diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 9a5a6f7..335ece7 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -865,6 +865,30 @@ class GerritNixConfigurator(ConfiguratorBase): ) + def gerritBranchKey(b): + ref = b['branch'] + if not ref.startswith('refs/changes/'): + return ref + return ref.rsplit('/', 1)[0] + config["services"].append( + util.OldBuildCanceller( + "lix_build_canceller", + filters=[ + ( + [ + f"lix/nix-{kind}" + for kind in [ "eval" ] + [ + f"build/{arch}" + for arch in self.nix_supported_systems + [ "other" ] + ] + ], + util.SourceStampFilter(project_eq=["lix"]) + ) + ], + branch_key=gerritBranchKey + ) + ) + systemd_secrets = secrets.SecretInAFile( dirname=os.environ["CREDENTIALS_DIRECTORY"], )