From 6aa4b3f7b74f5a1a232bab82a0f280e3a8ca68d8 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Thu, 11 Jun 2026 05:45:47 +0200 Subject: [PATCH] refactor(worker): trim observability helper docstring; clarify test fake - Collapse _init_worker_observability's docstring to one line; the WHY moves to a concise inline comment (per review). - Note that _fake_settings.ingest_queue is unused by the helper (test realism). Co-Authored-By: Claude Opus 4.8 (1M context) --- nextcloud_mcp_server/cli.py | 13 +++---------- tests/test_cli.py | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/nextcloud_mcp_server/cli.py b/nextcloud_mcp_server/cli.py index f247a1cd..9f1d2283 100644 --- a/nextcloud_mcp_server/cli.py +++ b/nextcloud_mcp_server/cli.py @@ -291,16 +291,9 @@ def run( def _init_worker_observability(settings: Settings) -> None: - """Configure logging, metrics, and tracing for the ingest worker. - - Mirrors the observability bootstrap the API pod performs in its lifespan - (``app.py``), but for the standalone ``worker`` entrypoint which never runs - uvicorn. Without this the worker emits plain-text logs and serves no - ``/metrics`` endpoint, so the astrolabe_* document-pipeline metrics and the - ``document_processor.parse`` spans (recorded in the shared registry/processor - code the worker executes) stay invisible in external split-worker mode - (Deck #310 / #175). - """ + """Configure logging, metrics, and tracing for the standalone ingest worker.""" + # Mirrors app.py's lifespan bootstrap; without it the worker's astrolabe_* + # metrics and document_processor.parse spans are invisible in external mode. # Structured logging first, so every subsequent startup line is JSON like # the API's — the worker entrypoint never went through uvicorn's log_config. setup_logging( diff --git a/tests/test_cli.py b/tests/test_cli.py index 638e62ae..87c006b6 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -339,7 +339,7 @@ def _fake_settings(**overrides): real Settings.__post_init__ validation/derivation. """ base = dict( - ingest_queue="postgres", + ingest_queue="postgres", # for realism / worker() gating; unused by the helper log_format="json", log_level="INFO", log_include_trace_context=True,