Skip to content

Commit dcee6b5

Browse files
Exclude py/cyclic-import from CodeQL scan (#234)
The rule fires on TYPE_CHECKING-gated typed-module cycles between graph and observability that do not exist at runtime (import of graph.events resolves clean). It is the broader sibling of py/unsafe-cyclic-import, already excluded here for the same reason. Pyright's reportImportCycles remains the backstop for genuine runtime cycles, so the rule adds only noise.
1 parent 8d45e78 commit dcee6b5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/codeql/codeql-config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,23 @@ query-filters:
6868
# the CodeQL rule doesn't lose signal.
6969
- exclude:
7070
id: py/unsafe-cyclic-import
71+
# ``py/cyclic-import`` is the broader sibling of
72+
# ``py/unsafe-cyclic-import`` (above) and fires on the same
73+
# false-positive class: TYPE_CHECKING-gated typed-module cycles
74+
# that do not exist at runtime. The current instances are the
75+
# ``graph`` <-> ``observability`` typing boundary:
76+
#
77+
# - ``observability/correlation.py``, ``observability/tool_call.py``,
78+
# and ``observability/metadata.py`` import graph event/observer
79+
# types only inside ``if TYPE_CHECKING:`` blocks (with
80+
# ``from __future__ import annotations``), while ``graph/events.py``
81+
# imports the ``AttributeValue`` type alias from
82+
# ``observability.metadata`` at runtime. The back-edges never
83+
# execute, so ``import openarmature.graph.events`` resolves with
84+
# no runtime cycle (verified).
85+
#
86+
# As with ``py/unsafe-cyclic-import``, pyright's
87+
# ``reportImportCycles`` covers the genuine runtime-cycle cases at
88+
# type-check time, so dropping the CodeQL rule doesn't lose signal.
89+
- exclude:
90+
id: py/cyclic-import

0 commit comments

Comments
 (0)