buildbot: further Gerritification

- `BuildTrigger` still depends on `github` properties.

Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
raito 2024-03-02 17:34:52 +01:00
parent 5f7b3e0cdb
commit 7ace78107c

View file

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