UAT: MultiProjectService uses standard logging module instead of required structlog — secrets masking processor bypassed #3705

Open
opened 2026-04-05 22:15:14 +00:00 by freemo · 0 comments
Owner

Bug Report

What Was Tested

src/cleveragents/application/services/multi_project_service.py was analyzed for compliance with the project's logging standards.

Expected Behavior (from spec/CONTRIBUTING)

All application service files must use structlog for logging (not the standard logging module). This is required because structlog provides:

  • Structured log output with key-value pairs
  • Secrets masking processor integration
  • Consistent log format across the codebase

This is the same issue already reported for other files (see existing UAT issue: "UAT: Widespread use of standard logging module instead of required structlog").

Actual Behavior (from code analysis)

multi_project_service.py uses the standard logging module:

# multi_project_service.py line 8
import logging
...
logger = logging.getLogger(__name__)  # line 40

# Usage:
logger.warning(
    "multi_project_mixed_access",
    extra={                          # 'extra' kwarg is standard logging, not structlog
        "plan_id": plan.identity.plan_id,
        "warnings": errors,
    },
)
logger.info(
    "multi_project_scopes_initialized",
    extra={
        "plan_id": plan.identity.plan_id,
        "project_count": len(scopes),
    },
)

Additionally, the extra={} kwarg pattern is standard Python logging — structlog uses keyword arguments directly (e.g., logger.info("event", plan_id=..., project_count=...)). The extra dict is silently ignored by structlog if it were used.

Impact

  • Secrets masking processor is bypassed for multi-project service logs
  • Log output is not structured (no key-value pairs in JSON format)
  • extra={} pattern is wrong for structlog — log context is silently dropped
  • Inconsistent with the rest of the codebase that uses structlog

Code Locations

  • src/cleveragents/application/services/multi_project_service.py lines 8, 40, 105-111, 121-127, 222-228

Steps to Reproduce

  1. Review multi_project_service.py line 8 — import logging instead of import structlog
  2. Review logger usage — extra={} kwarg pattern is standard logging, not structlog

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### What Was Tested `src/cleveragents/application/services/multi_project_service.py` was analyzed for compliance with the project's logging standards. ### Expected Behavior (from spec/CONTRIBUTING) All application service files must use `structlog` for logging (not the standard `logging` module). This is required because structlog provides: - Structured log output with key-value pairs - Secrets masking processor integration - Consistent log format across the codebase This is the same issue already reported for other files (see existing UAT issue: "UAT: Widespread use of standard `logging` module instead of required `structlog`"). ### Actual Behavior (from code analysis) `multi_project_service.py` uses the standard `logging` module: ```python # multi_project_service.py line 8 import logging ... logger = logging.getLogger(__name__) # line 40 # Usage: logger.warning( "multi_project_mixed_access", extra={ # 'extra' kwarg is standard logging, not structlog "plan_id": plan.identity.plan_id, "warnings": errors, }, ) logger.info( "multi_project_scopes_initialized", extra={ "plan_id": plan.identity.plan_id, "project_count": len(scopes), }, ) ``` Additionally, the `extra={}` kwarg pattern is standard Python logging — structlog uses keyword arguments directly (e.g., `logger.info("event", plan_id=..., project_count=...)`). The `extra` dict is silently ignored by structlog if it were used. ### Impact - Secrets masking processor is bypassed for multi-project service logs - Log output is not structured (no key-value pairs in JSON format) - `extra={}` pattern is wrong for structlog — log context is silently dropped - Inconsistent with the rest of the codebase that uses structlog ### Code Locations - `src/cleveragents/application/services/multi_project_service.py` lines 8, 40, 105-111, 121-127, 222-228 ### Steps to Reproduce 1. Review `multi_project_service.py` line 8 — `import logging` instead of `import structlog` 2. Review logger usage — `extra={}` kwarg pattern is standard logging, not structlog --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#3705
No description provided.