[hermes] bstein_home: python:S2208 #288

Open
opened 2026-09-24 11:25:17 +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

The wildcard import makes the facade's dependencies and re-exported names implicit. Because route registration receives this facade module as its dependency object, replacing it with the state module would change the existing monkeypatch surface.

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 only the wildcard-import line, including its noqa comment, with explicit imports of every name it currently exposes. The state module's contents were not supplied, so the helper below generates that replacement block rather than guessing names: run it separately in the configured backend Python environment and paste its output at the original import location; do not add the helper to the application. It respects all when present and otherwise selects non-underscore module names, matching wildcard-import selection. Same-name aliases make the facade's re-exports explicit. Leave sys.m
... (truncated)

from importlib import import_module

state = import_module("atlas_portal.routes.access_request_state")
try:
    names = state.__all__
except AttributeError:
    names = [name for name in vars(state) if not name.startswith("_")]

names = list(names)
if names:
    print("from .access_request_state import (")
    for name in names:
        print(f"    {name} as {name},")
    print(")")
else:
    print("from . import access_request_state as _access_request_state")
    print("del _access_request_state")

Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_bcdfa4b6ab594f50b7ec623796fe833d). 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 The wildcard import makes the facade's dependencies and re-exported names implicit. Because route registration receives this facade module as its dependency object, replacing it with the state module would change the existing monkeypatch surface. 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 only the wildcard-import line, including its noqa comment, with explicit imports of every name it currently exposes. The state module's contents were not supplied, so the helper below generates that replacement block rather than guessing names: run it separately in the configured backend Python environment and paste its output at the original import location; do not add the helper to the application. It respects __all__ when present and otherwise selects non-underscore module names, matching wildcard-import selection. Same-name aliases make the facade's re-exports explicit. Leave sys.m ... (truncated) ``` from importlib import import_module state = import_module("atlas_portal.routes.access_request_state") try: names = state.__all__ except AttributeError: names = [name for name in vars(state) if not name.startswith("_")] names = list(names) if names: print("from .access_request_state import (") for name in names: print(f" {name} as {name},") print(")") else: print("from . import access_request_state as _access_request_state") print("del _access_request_state") ``` ## 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_bcdfa4b6ab594f50b7ec623796fe833d](https://triage.bstein.dev/chat?resume=run_bcdfa4b6ab594f50b7ec623796fe833d)). 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#288
No description provided.