chore(canceller): generalize it to any project

Just iterate over all project names.

Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
raito 2024-05-06 19:57:12 +02:00 committed by Jade Lovelace
parent d284a8bc77
commit 72b6757947

View file

@ -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
)