Fix config loading and formatting

This commit is contained in:
Ilgiz Kamelyev 2026-04-23 20:59:15 +05:00
parent b7951de3b3
commit 73f01312f4
5 changed files with 21 additions and 6 deletions

View File

@ -24,7 +24,11 @@ def main() -> int:
config = load_runtime_config(config_dir)
LOG.info("wf-agent bootstrap started")
LOG.info("loaded app config: name=%s instance_id=%s", config.app.name, config.app.instance_id)
LOG.info(
"loaded app config: name=%s instance_id=%s",
config.app.name,
config.app.instance_id,
)
# TODO:
# - create event runtime

View File

@ -16,11 +16,10 @@ def _read_yaml(path: Path) -> dict[str, Any]:
return data
def _merge_sections(root: dict[str, Any], incoming: dict[str, Any], source_name: str) -> None:
def _merge_sections(
root: dict[str, Any], incoming: dict[str, Any], _source_name: str
) -> None:
for key, value in incoming.items():
if key in root and key not in {"includes"}:
# Keep this strict for now; later it can be made schema-aware.
raise ValueError(f"duplicate top-level section '{key}' while loading {source_name}")
root[key] = value

View File

@ -1,7 +1,16 @@
from pathlib import Path
def test_proto_files_exist():
base = Path(__file__).resolve().parents[1] / "src" / "app" / "shared" / "contracts" / "proto" / "v1"
base = (
Path(__file__).resolve().parents[1]
/ "src"
/ "app"
/ "shared"
/ "contracts"
/ "proto"
/ "v1"
)
assert (base / "common.proto").exists()
assert (base / "events.proto").exists()
assert (base / "commands.proto").exists()

View File

@ -1,5 +1,6 @@
from pathlib import Path
def test_yaml_layout_exists():
base = Path(__file__).resolve().parents[1] / "etc" / "wf-agent"
assert (base / "app.yaml").exists()

View File

@ -2,6 +2,7 @@ from pathlib import Path
import subprocess
import sys
def main() -> int:
root_dir = Path(__file__).resolve().parents[1]
proto_dir = root_dir / "src" / "app" / "shared" / "contracts" / "proto" / "v1"
@ -24,5 +25,6 @@ def main() -> int:
print(f"Generated Python protobuf files into: {out_dir}")
return 0
if __name__ == "__main__":
raise SystemExit(main())