From 7ace78107c8cf13ecba879c75ad2f482610fa788 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 2 Mar 2024 17:34:52 +0100 Subject: [PATCH] buildbot: further Gerritification - `BuildTrigger` still depends on `github` properties. Signed-off-by: Raito Bezarius --- buildbot_nix/__init__.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index fbcca6e..fb8658b 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -49,6 +49,7 @@ class BuildbotNixError(Exception): @dataclass class GerritProject: + # `project` field. name: str class BuildTrigger(Trigger): @@ -322,7 +323,6 @@ def nix_eval_config( # check out the source factory.addStep( steps.Gerrit( - repourl=project.url, mode="full", retry=[60, 60], timeout=3600 @@ -536,28 +536,28 @@ def config_for_project( config["projects"].append(Project(project.name)) config["schedulers"].extend( [ - # build all pull requests + # build everything pertaining to a project + # TODO(raito): will this catch also post-merge? we don't really care about that… do we? schedulers.SingleBranchScheduler( - name=f"{project.project_id}-prs", + name=f"{project.name}-changes", change_filter=util.ChangeFilter( - repository=project.url, - category="pull", + project=project.name, ), builderNames=[f"{project.name}/nix-eval"], ), # this is triggered from `nix-eval` schedulers.Triggerable( - name=f"{project.project_id}-nix-build", + name=f"{project.name}-nix-build", builderNames=[f"{project.name}/nix-build"], ), # this is triggered from `nix-eval` when the build is skipped schedulers.Triggerable( - name=f"{project.project_id}-nix-skipped-build", + name=f"{project.name}-nix-skipped-build", builderNames=[f"{project.name}/nix-skipped-build"], ), # allow to manually trigger a nix-build schedulers.ForceScheduler( - name=f"{project.project_id}-force", + name=f"{project.name}-force", builderNames=[f"{project.name}/nix-eval"], properties=[ util.StringParameter( @@ -710,18 +710,18 @@ class GerritNixConfigurator(ConfiguratorBase): eval_lock = util.MasterLock("nix-eval") - # TODO: initialize Lix - # config_for_project( - # config, - # project, - # worker_names, - # self.nix_supported_systems, - # self.nix_eval_worker_count or multiprocessing.cpu_count(), - # self.nix_eval_max_memory_size, - # eval_lock, - # self.cachix, - # self.outputs_path, - # ) + # Configure the Lix project. + config_for_project( + config, + GerritProject(name="lix"), + worker_names, + self.nix_supported_systems, + self.nix_eval_worker_count or multiprocessing.cpu_count(), + self.nix_eval_max_memory_size, + eval_lock, + self.cachix, + self.outputs_path, + ) config["change_source"] = self.gerrit_change_source config["workers"].append(worker.LocalWorker(SKIPPED_BUILDER_NAME))