[hermes] bstein_home: python:S2208 #381

Open
opened 2026-09-26 11:22:09 +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. S2208 flags this because a star import hides which names are actually brought in, can silently shadow other imports, and defeats static tooling - which is also why the line needs its # noqa: F403 escape hatch.

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 — The facade deliberately re-exports access_request_state's names so sys.modules[__name__] keeps the same attribute/patch surface (tests patch these names on this module). Replace the star import with an explicit module import and rebind the module's public names onto the facade. This follows the rule's guidance ('import the module and then use its members'), removes the need for the noqa comment, and reproduces star-import semantics exactly: it honours __all__ when defined and otherwise takes all non-underscore names, so every previously patchable attribute remains available under the same
... (truncated)

from __future__ import annotations

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

import sys

from . import access_request_state as _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

# Re-export the state module's public names so the facade keeps the same
# attribute/patch surface it had with the former star import.
for _name in getattr(
    _access_request_state,
    "__all__",
    [name for name in vars(_access_request_state) if not name.startswith("_")],
):
    globals()[_name] = 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_aa72c4da51e049e69f111d88420a5059). 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. S2208 flags this because a star import hides which names are actually brought in, can silently shadow other imports, and defeats static tooling - which is also why the line needs its `# noqa: F403` escape hatch. 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`** — The facade deliberately re-exports access_request_state's names so `sys.modules[__name__]` keeps the same attribute/patch surface (tests patch these names on this module). Replace the star import with an explicit module import and rebind the module's public names onto the facade. This follows the rule's guidance ('import the module and then use its members'), removes the need for the noqa comment, and reproduces star-import semantics exactly: it honours `__all__` when defined and otherwise takes all non-underscore names, so every previously patchable attribute remains available under the same ... (truncated) ``` from __future__ import annotations """Access request route registration facade.""" import sys from . import access_request_state as _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 # Re-export the state module's public names so the facade keeps the same # attribute/patch surface it had with the former star import. for _name in getattr( _access_request_state, "__all__", [name for name in vars(_access_request_state) if not name.startswith("_")], ): globals()[_name] = 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_aa72c4da51e049e69f111d88420a5059](https://triage.bstein.dev/chat?resume=run_aa72c4da51e049e69f111d88420a5059)). 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#381
No description provided.