[hermes] bstein_home: python:S2208 #68

Open
opened 2026-09-21 19:22:14 +00:00 by hermes-automation · 0 comments

SonarQube reports python:S2208 in backend/atlas_portal/routes/access_requests.py. The build is green; this is a standing finding, not a failure.

What is wrong

Line 8 uses a wildcard import (from .access_request_state import *) to copy every public name from access_request_state into this facade module so tests can patch them here. Sonar S2208 flags star imports because they make the module's namespace implicit and allow silent shadowing; the fix is to import the module and delegate attribute access instead of copying its names wholesale.

Ariadne opened no pull request for it: no automated patch was possible for this finding.

Facts

  • gitea — Import only needed names or import the module and then use its members. (CRITICAL, 5min estimated) (backend/atlas_portal/routes/access_requests.py:8)

Suggested fix (not applied)

Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch.

backend/atlas_portal/routes/access_requests.py — Replace the star import with a plain module import plus a PEP 562 module-level getattr that delegates unresolved attribute lookups to access_request_state. This satisfies S2208 (no wildcard import) while preserving the facade's existing patch surface exactly: getattr on this module (including via deps = sys.modules[name] in register) still resolves every public name from access_request_state, and unittest.mock.patch targeting names on this module continues to work — patch sets the override in this module's dict, and on cleanup the delegation takes over again. If you prefer fully explic
... (truncated)

from __future__ import annotations

"""Access request route registration facade."""

import sys

from . import access_request_state
from .access_request_onboarding import register_access_request_onboarding
from .access_request_status import register_access_request_status
from .access_request_submission import register_access_request_submission


def __getattr__(name: str):
    """Delegate to access_request_state so the facade keeps its patch surface."""
    return getattr(access_request_state, name)


def register(app) -> None:
    """Register public access-request and onboarding routes."""

    deps = sys.modules[__name__]
    register_access_request_submission(app, deps)
    register_access_request_status(app, deps)
    register_access_request_onboarding(app, deps)

Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_9cc788be72bb49359b3edd47b5c9c373). Hermes has no write access to this repository; no files or infrastructure were changed.

SonarQube reports **python:S2208** in `backend/atlas_portal/routes/access_requests.py`. The build is green; this is a standing finding, not a failure. ## What is wrong Line 8 uses a wildcard import (from .access_request_state import *) to copy every public name from access_request_state into this facade module so tests can patch them here. Sonar S2208 flags star imports because they make the module's namespace implicit and allow silent shadowing; the fix is to import the module and delegate attribute access instead of copying its names wholesale. Ariadne opened no pull request for it: no automated patch was possible for this finding. ## Facts - **gitea** — Import only needed names or import the module and then use its members. (CRITICAL, 5min estimated) (`backend/atlas_portal/routes/access_requests.py:8`) ## Suggested fix (not applied) Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch. **`backend/atlas_portal/routes/access_requests.py`** — Replace the star import with a plain module import plus a PEP 562 module-level __getattr__ that delegates unresolved attribute lookups to access_request_state. This satisfies S2208 (no wildcard import) while preserving the facade's existing patch surface exactly: getattr on this module (including via deps = sys.modules[__name__] in register) still resolves every public name from access_request_state, and unittest.mock.patch targeting names on this module continues to work — patch sets the override in this module's dict, and on cleanup the delegation takes over again. If you prefer fully explic ... (truncated) ``` from __future__ import annotations """Access request route registration facade.""" import sys from . import access_request_state from .access_request_onboarding import register_access_request_onboarding from .access_request_status import register_access_request_status from .access_request_submission import register_access_request_submission def __getattr__(name: str): """Delegate to access_request_state so the facade keeps its patch surface.""" return getattr(access_request_state, name) def register(app) -> None: """Register public access-request and onboarding routes.""" deps = sys.modules[__name__] register_access_request_submission(app, deps) register_access_request_status(app, deps) register_access_request_onboarding(app, deps) ``` ## Links - SonarQube finding: https://quality.bstein.dev/project/issues?resolved=false&id=bstein_home&open=AZ2y3BYyKy9i4pkIpR-L - Full evidence bundle and audit trail live in Ariadne at `/api/admin/audit/events`, event types `hermes_autotriage_incident` and `hermes_autotriage_diagnosis`. Filed automatically by Ariadne from a Hermes Agent diagnosis (run [run_9cc788be72bb49359b3edd47b5c9c373](https://triage.bstein.dev/chat?resume=run_9cc788be72bb49359b3edd47b5c9c373)). Hermes has no write access to this repository; no files or infrastructure were changed. <!-- hermes-triage job=bstein_home classification=python:S2208 incident=sonar/bstein_home/python:S2208/AZ2y3BYyKy9i4pkIpR-L -->
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bstein/bstein-dev-home#68
No description provided.