Skip to content

fix: read import aliases from relationships - #1540

Merged
Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
C0deRatoR:fix/import-alias-relationship
Aug 2, 2026
Merged

Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
C0deRatoR:fix/import-alias-relationship

Conversation

@C0deRatoR

Copy link
Copy Markdown
Contributor

Summary

  • read import aliases from the IMPORTS relationship in who_imports_module
  • fix the same relationship-property bug in the C++ Module query
  • add one regression test covering both query paths

Fixes #1515.
Also addresses item 3 of #1533.

Testing

  • PYTHONPATH=src uv run --no-project --with pytest --with pathspec --with pyyaml pytest -q tests/unit/tools/test_kuzu_relationship_queries.py
  • uvx ruff check --ignore F541 on the three changed files
  • git diff --check

@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@C0deRatoR is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Shashankss1205 Shashankss1205 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally: trial-merged onto main with #1539 and #1541 — full suite green (1063 passed, 7 skipped).

Correct fix for #1515, and good catch extending it to cpp_toolkit.py — that was the second call site of the same root cause (I'd noted it as item 3 of #1533, which this also closes). The alias is written to the IMPORTS relationship at writer.py:580/597, never to the Module node, so i.alias is right in both places.

The test asserting "module.alias" not in query is a nice touch — it prevents a regression sneaking back in via either query. Thanks!

@Shashankss1205
Shashankss1205 merged commit 818db20 into CodeGraphContext:main Aug 2, 2026
1 check failed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Aug 2, 2026
Shashankss1205 added a commit that referenced this pull request Aug 2, 2026
Bug-fix release. Since 0.5.4 on PyPI:

- fix(indexer): record non-code files on the SCIP path so `cgc index`
  stops reporting a partial index forever (#1565, #1566)
- fix(parsers): capture PHP imports rather than trait uses (#1522, #1563)
- fix(parsers): recover Python annotated parameters — 40.3% of parameters
  were being dropped — and Go grouped imports (#1520, #1521, #1561)
- fix(graph): always sanitize bundle filenames (#1517, #1541)
- fix(cli/mcp): read import aliases from the IMPORTS relationship (#1515, #1540)
- fix(cli/mcp): fall back to JSON when GCF encoding fails (#1518, #1539)

Co-authored-by: Claude Fable 5 <[email protected]>
@Shashankss1205 Shashankss1205 added gssoc:approved GSSoC validation: counts toward scoring level:intermediate GSSoC difficulty: 35 pts contributor / 20 mentor mentor:Shashankss1205 GSSoC mentor attribution: credits reviewing mentor quality:clean GSSoC quality: x1.2 contributor / +5 mentor type:bug GSSoC type bonus: bug labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC validation: counts toward scoring level:intermediate GSSoC difficulty: 35 pts contributor / 20 mentor mentor:Shashankss1205 GSSoC mentor attribution: credits reviewing mentor quality:clean GSSoC quality: x1.2 contributor / +5 mentor type:bug GSSoC type bonus: bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(cli/mcp): find_importers reads module.alias but the alias is stored on the IMPORTS relationship, so import_alias is always null

2 participants