Skip to content

fix(ci): restore compatibility after refactor and unblock tests#42

Merged
lexasub merged 5 commits intolexasub:mainfrom
r0h1tb:chore/fix-ruff-lint-errors
Mar 23, 2026
Merged

fix(ci): restore compatibility after refactor and unblock tests#42
lexasub merged 5 commits intolexasub:mainfrom
r0h1tb:chore/fix-ruff-lint-errors

Conversation

@r0h1tb
Copy link

@r0h1tb r0h1tb commented Mar 23, 2026

Description

This PR started as repo-wide Ruff cleanup, but the cleanup exposed older breakage from the March refactor. I expanded the branch to restore compatibility with the current architecture and get CI back to a green baseline without changing core indexing or query behavior.

What changed

  • fixed all pre-existing Ruff lint errors and applied ruff format
  • wrapped tests/test_phase2.py in a __main__ guard so pytest collection no longer exits the runner
  • restored ast_rag.repositories.queries used by graph_updater_service
  • fixed ast_rag.services.parsing package initialization order to avoid a circular import during import-time setup
  • added compatibility shims for legacy public module paths moved by the refactor:
    • ast_rag.ast_rag_api
    • ast_rag.ast_rag_mcp
    • ast_rag.graph_updater
    • ast_rag.language_queries
    • ast_rag.parse_cache
    • ast_rag.summarizer
    • ast_rag.watcher
  • updated stale tests to import the refactored module locations
  • made the Neo4j-dependent search format test skip locally when Neo4j is unavailable
  • ignored the generated summary cache artifact .ast_rag_summary_cache.json
  • updated GitHub Actions checkout to fetch full history so commit-diff tests can resolve both revisions in pull request runs

Why this fits the current architecture

  • keeps the refactored package layout as the source of truth
  • uses thin shims only to preserve old public import paths still referenced by tests, docs, and examples
  • avoids changing core graph/indexing logic beyond restoring the missing queries.py helper module expected by the current service layer

Verification

  • ruff check ast_rag/
  • ruff format --check ast_rag/ tests/
  • pytest tests/ -v --tb=short
    • local result: 95 passed, 1 skipped
    • the skipped test is the Neo4j integration-style search test when no local Neo4j is running; CI provides Neo4j service, so it should execute there
  • GitHub Actions test check passed on this PR: https://github.com/lexasub/raged/actions/runs/23445517499

Notes

  • no maintainer review comments were present yet when I refreshed this branch
  • this PR is now broader than the original lint-only description, so the title/body were updated to match the actual branch contents

- Auto-fix 64 errors via ruff check --fix (f-string, unused imports, etc.)
- Remove duplicate analyze_stacktrace command in cli.py (F811)
- Fix commit_hash → commit variable reference in cli.py (F821)
- Rename _KIND_TO_LABEL → KIND_TO_LABEL in graph_updater_service (F821)
- Remove stale self._extract_rust_edges call in edge_extractor (F821)
- Remove unused labels_str, lang_map, label_query variables (F841)
- Fix ambiguous variable l → lang_val in parsing_service (E741)
- Remove duplicate dict key in schema_manager.list_indexes (F601)
- Move imports before code in parsing/__init__.py (E402)
- Add noqa annotations for forward-ref string annotations (F821)
- Apply ruff format to all files

Closes pre-existing lint issues to unblock CI for future PRs.
Rohit Behera added 2 commits March 23, 2026 20:17
…rash

test_phase2.py runs tests at module level and calls sys.exit(1) at EOF,
which crashes the entire pytest runner during collection. Wrapping all
execution code in main() with an if __name__ guard fixes CI.
- restore legacy module paths with compatibility shims for moved public modules
- add back ast_rag.repositories.queries used by graph_updater_service
- fix parsing package import order to avoid circular import during initialization
- update stale tests to current module layout and make Neo4j-dependent test skip locally when unavailable
- ignore generated summary cache artifact
@r0h1tb r0h1tb changed the title chore(lint): fix all ruff lint + format errors across codebase fix(ci): restore compatibility after refactor and unblock tests Mar 23, 2026
Rohit Behera added 2 commits March 23, 2026 21:01
update_project_dry_run compares revisions across commits. The default Actions checkout depth of 1 leaves the base commit unavailable in pull request runs, so the diff-based test fails only on GitHub. Fetch full history so diff-based code paths run against real commit objects in CI.
@lexasub lexasub merged commit 1bf05ae into lexasub:main Mar 23, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in raged kanban Mar 23, 2026
@lexasub lexasub mentioned this pull request Mar 23, 2026
10 tasks
@r0h1tb r0h1tb deleted the chore/fix-ruff-lint-errors branch March 27, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants