Skip to content

Commit

Permalink
if one project cannot be configured, don't crash buildbot
Browse files Browse the repository at this point in the history
Instead log the error with more context.
  • Loading branch information
Mic92 committed Dec 26, 2024
1 parent 93a00d6 commit 89c1c45
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
39 changes: 21 additions & 18 deletions buildbot_nix/buildbot_nix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1799,24 +1799,27 @@ def configure(self, config: dict[str, Any]) -> None:
atexit.register(lambda: DB.close() if DB is not None else None)

for project in projects:
config_for_project(
config=config,
project=project,
worker_names=worker_names,
nix_supported_systems=self.config.build_systems,
nix_eval_worker_count=self.config.eval_worker_count
or multiprocessing.cpu_count(),
nix_eval_max_memory_size=self.config.eval_max_memory_size,
eval_lock=eval_lock,
post_build_steps=[
x.to_buildstep() for x in self.config.post_build_steps
],
job_report_limit=self.config.job_report_limit,
per_repo_effects_secrets=self.config.effects_per_repo_secrets,
failed_builds_db=DB,
branch_config_dict=self.config.branches,
outputs_path=self.config.outputs_path,
)
try:
config_for_project(
config=config,
project=project,
worker_names=worker_names,
nix_supported_systems=self.config.build_systems,
nix_eval_worker_count=self.config.eval_worker_count
or multiprocessing.cpu_count(),
nix_eval_max_memory_size=self.config.eval_max_memory_size,
eval_lock=eval_lock,
post_build_steps=[
x.to_buildstep() for x in self.config.post_build_steps
],
job_report_limit=self.config.job_report_limit,
per_repo_effects_secrets=self.config.effects_per_repo_secrets,
failed_builds_db=DB,
branch_config_dict=self.config.branches,
outputs_path=self.config.outputs_path,
)
except Exception as e: # noqa: BLE001
log.failure(f"Failed to configure project {project.name}")

config["workers"].extend(worker.LocalWorker(w) for w in SKIPPED_BUILDER_NAMES)

Expand Down
4 changes: 2 additions & 2 deletions buildbot_nix/buildbot_nix/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import json
import re
from collections.abc import Callable, Mapping
from enum import Enum
from pathlib import Path
Expand All @@ -9,8 +9,8 @@
from pydantic import BaseModel, ConfigDict, Field, GetCoreSchemaHandler, TypeAdapter
from pydantic_core import CoreSchema, core_schema

from .secrets import read_secret_file
from .errors import BuildbotNixError
from .secrets import read_secret_file


class InternalError(Exception):
Expand Down

0 comments on commit 89c1c45

Please sign in to comment.