[hermes] ariadne: python:S2208 #10

Open
opened 2026-09-22 03:22:12 +00:00 by hermes-automation · 0 comments

SonarQube reports python:S2208 in ariadne/services/cluster_state_profiles.py. The build is green; this is a standing finding, not a failure.

What is wrong

The wildcard import obscures which names this module imports and re-exports. Because the final all includes imported underscore-prefixed names and both contract classes, importing only the two constants used by the profile functions would change the module's existing interface.

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) (ariadne/services/cluster_state_profiles.py:5)

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.

ariadne/services/cluster_state_profiles.py — Replace only the wildcard import with this explicit import list, leaving the functions and all unchanged. This names every export currently provided by cluster_state_contract in its existing order, preserving both the profile calculations and this module's re-exported interface without suppressing S2208.

from .cluster_state_contract import (
    _VALUE_PAIR_LEN,
    _RATE_WINDOW,
    _RESTARTS_WINDOW,
    _BASELINE_WINDOW,
    _TREND_WINDOWS,
    _TREND_NODE_LIMIT,
    _TREND_NAMESPACE_LIMIT,
    _TREND_PVC_LIMIT,
    _TREND_JOB_LIMIT,
    _TREND_POD_LIMIT,
    _NODE_DISK_ALERT,
    _NODE_CPU_ALERT,
    _NODE_RAM_ALERT,
    _NET_SPIKE_MULTIPLIER,
    _IO_SPIKE_MULTIPLIER,
    _NODE_UNAME_LABEL,
    _WORKLOAD_LABEL_KEYS,
    _SYSTEM_NAMESPACES,
    _WORKLOAD_ALLOWED_NAMESPACES,
    _BASELINE_DELTA_WARN,
    _BASELINE_DELTA_CRIT,
    _SIGNAL_LIMIT,
    _PROFILE_LIMIT,
    _WORKLOAD_INDEX_LIMIT,
    _NODE_WORKLOAD_LIMIT,
    _NODE_WORKLOAD_TOP,
    _EVENTS_SUMMARY_LIMIT,
    _PVC_CRITICAL_THRESHOLD,
    _CAPACITY_KEYS,
    _PRESSURE_TYPES,
    _EVENTS_MAX,
    _EVENT_WARNING,
    _PHASE_SEVERITY,
    _PENDING_15M_HOURS,
    _LOAD_TOP_COUNT,
    _NAMESPACE_TOP_COUNT,
    _PVC_PRESSURE_THRESHOLD,
    _ALERT_TOP_LIMIT,
    _POD_REASON_LIMIT,
    _POD_REASON_TREND_LIMIT,
    _NAMESPACE_ISSUE_LIMIT,
    _CROSS_NODE_TOP,
    _CROSS_NAMESPACE_TOP,
    _CROSS_PVC_TOP,
    _POD_TERMINATED_REASONS,
    _POD_WAITING_REASONS,
    _DELTA_TOP_LIMIT,
    _REASON_TOP_LIMIT,
    ClusterStateSummary,
    SignalContext,
    _items,
)

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

SonarQube reports **python:S2208** in `ariadne/services/cluster_state_profiles.py`. The build is green; this is a standing finding, not a failure. ## What is wrong The wildcard import obscures which names this module imports and re-exports. Because the final __all__ includes imported underscore-prefixed names and both contract classes, importing only the two constants used by the profile functions would change the module's existing interface. 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) (`ariadne/services/cluster_state_profiles.py:5`) ## 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. **`ariadne/services/cluster_state_profiles.py`** — Replace only the wildcard import with this explicit import list, leaving the functions and __all__ unchanged. This names every export currently provided by cluster_state_contract in its existing order, preserving both the profile calculations and this module's re-exported interface without suppressing S2208. ``` from .cluster_state_contract import ( _VALUE_PAIR_LEN, _RATE_WINDOW, _RESTARTS_WINDOW, _BASELINE_WINDOW, _TREND_WINDOWS, _TREND_NODE_LIMIT, _TREND_NAMESPACE_LIMIT, _TREND_PVC_LIMIT, _TREND_JOB_LIMIT, _TREND_POD_LIMIT, _NODE_DISK_ALERT, _NODE_CPU_ALERT, _NODE_RAM_ALERT, _NET_SPIKE_MULTIPLIER, _IO_SPIKE_MULTIPLIER, _NODE_UNAME_LABEL, _WORKLOAD_LABEL_KEYS, _SYSTEM_NAMESPACES, _WORKLOAD_ALLOWED_NAMESPACES, _BASELINE_DELTA_WARN, _BASELINE_DELTA_CRIT, _SIGNAL_LIMIT, _PROFILE_LIMIT, _WORKLOAD_INDEX_LIMIT, _NODE_WORKLOAD_LIMIT, _NODE_WORKLOAD_TOP, _EVENTS_SUMMARY_LIMIT, _PVC_CRITICAL_THRESHOLD, _CAPACITY_KEYS, _PRESSURE_TYPES, _EVENTS_MAX, _EVENT_WARNING, _PHASE_SEVERITY, _PENDING_15M_HOURS, _LOAD_TOP_COUNT, _NAMESPACE_TOP_COUNT, _PVC_PRESSURE_THRESHOLD, _ALERT_TOP_LIMIT, _POD_REASON_LIMIT, _POD_REASON_TREND_LIMIT, _NAMESPACE_ISSUE_LIMIT, _CROSS_NODE_TOP, _CROSS_NAMESPACE_TOP, _CROSS_PVC_TOP, _POD_TERMINATED_REASONS, _POD_WAITING_REASONS, _DELTA_TOP_LIMIT, _REASON_TOP_LIMIT, ClusterStateSummary, SignalContext, _items, ) ``` ## Links - SonarQube finding: https://quality.bstein.dev/project/issues?resolved=false&id=ariadne&open=AZ2y0FYFKy9i4pkIpNlV - 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_20193457604f49e886ef68a2bc4b5923](https://triage.bstein.dev/chat?resume=run_20193457604f49e886ef68a2bc4b5923)). Hermes has no write access to this repository; no files or infrastructure were changed. <!-- hermes-triage job=ariadne classification=python:S2208 incident=sonar/ariadne/python:S2208/AZ2y0FYFKy9i4pkIpNlV -->
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: titan/ariadne#10
No description provided.