Skip to content

fix: resolve CI failures on main — ruff lint + tomllib on Py3.10#220

Merged
tirth8205 merged 1 commit intomainfrom
fix/ci-lint-and-test-collection
Apr 11, 2026
Merged

fix: resolve CI failures on main — ruff lint + tomllib on Py3.10#220
tirth8205 merged 1 commit intomainfrom
fix/ci-lint-and-test-collection

Conversation

@tirth8205
Copy link
Copy Markdown
Owner

Summary

Main CI has been red for 13 consecutive pushes since fix: resolve SQLite transaction nesting errors (#135, #181) (#205) landed. This PR fixes the actual root causes so the main branch is green again.

Root causes

Lint job (ruff check code_review_graph/) — 4 errors + 1 warning:

  • communities.py:564E501 Line too long (104 > 100) on an INSERT INTO SQL literal
  • parser.py:2435W291 Trailing whitespace on the Go field_identifier return
  • skills.py:449 / :456N806 local vars _SCRIPT / _MARKER inside install_git_hook flagged as non-lowercase
  • visualization.py:415 — Ruff was parsing `# noqa: E501` inside a comment explaining the per-file-ignore as a real noqa directive, which is invalid syntax

Test (3.10) job:

  • tests/test_skills.py:8import tomllib fails on Python 3.10 (tomllib is 3.11+). Project still advertises requires-python = ">=3.10" and the CI matrix runs 3.10.

Fixes

File Fix
code_review_graph/skills.py Rename local vars _SCRIPTscript, _MARKERmarker in install_git_hook (they were only used inside the function — no public API change)
code_review_graph/communities.py Wrap the long INSERT INTO communities SQL across two lines
code_review_graph/parser.py Strip trailing whitespace
code_review_graph/visualization.py Rephrase the explanatory comment so ruff doesn't parse the embedded noqa
tests/test_skills.py if sys.version_info >= (3, 11): import tomllib; else: import tomli as tomllib
pyproject.toml Add "tomli>=2.0; python_version < '3.11'" to dev extras
uv.lock Regenerated — picks up tomli, and also fills in pytest-cov + coverage entries that were already listed in dev extras but missing from the lock on main

Test plan

Verified locally on Python 3.11:

  • uv run ruff check code_review_graph/All checks passed!
  • uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionalSuccess: no issues found in 44 source files
  • uv run bandit -r code_review_graph/ -c pyproject.toml → 0 High/Medium/Low issues
  • uv run pytest --tb=short -q --cov=code_review_graph --cov-fail-under=65661 passed, 1 skipped, 2 xpassed, coverage 72.77% (gate is 65%)
  • CI matrix (3.10 / 3.11 / 3.12 / 3.13) — will run on this PR

Not in scope

  • The action_required status on 20+ other open PRs is GitHub's new-contributor CI gate, not a CI failure.
  • PR-specific failures (e.g. fix: bump mcp/fastmcp minimums for CVEs #144 fastmcp CVE bump) live on their own branches and should be addressed per-PR.

🤖 Generated with Claude Code

Main CI has been red for 13 consecutive pushes since #135. Root causes:

Lint job (ruff):
- skills.py: rename local vars _SCRIPT/_MARKER to lowercase (N806)
- communities.py: wrap long INSERT INTO SQL across two lines (E501)
- parser.py: strip trailing whitespace on Go field_identifier return (W291)
- visualization.py: rephrase comment so ruff stops parsing the embedded
  "# noqa: E501" reference as a directive

Test (3.10) job:
- tests/test_skills.py: tomllib is Python 3.11+ only. Use conditional
  import with tomli as the backport on 3.10.
- pyproject.toml: add "tomli>=2.0; python_version < '3.11'" to dev extras
- uv.lock: regenerated (also picks up pytest-cov + coverage entries that
  were already in pyproject.toml dev extras but missing from the lock)

Verified locally on Python 3.11:
- ruff check code_review_graph/ — All checks passed
- mypy code_review_graph/ — Success (44 source files)
- bandit -r code_review_graph/ — 0 issues
- pytest --cov-fail-under=65 — 661 passed, 1 skipped, 2 xpassed, 72.77% cov

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205 tirth8205 merged commit 06570e4 into main Apr 11, 2026
9 checks passed
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205 tirth8205 mentioned this pull request Apr 11, 2026
5 tasks
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant