fix(graph): populate bundle metadata languages (#1516) - #1613
Merged
Merged
Conversation
Two defects meant every exported bundle advertised no languages. 1. Bundle export reads f.language on File nodes, but no writer ever set it and the Kuzu File table had no such column. The `if record["language"]` guard then filtered every row out. The per-file language is already known at write time as file_data['lang'], so persist it -- plus the schema column, a migration for existing databases, and the SCHEMA_MAP allow-list entry, without which Kuzu drops the property silently. 2. The language block sat inside `if repo_path and repo_path.exists()`, so a whole-graph export never set the key at all, even with the property present. Moved out and given an unscoped query branch. Fixes #1516. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ |
Contributor
🔍 PR Code Graph Analysisfix(graph): populate bundle metadata languages (#1516) (#1613) 📊 Interactive VisualizationView the blast radius graph: PR Reviewer Dashboard 📦 ArtifactsThe graph JSON has been uploaded as a build artifact: Generated by CodeGraphContext using FalkorDB Lite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1516. Every exported bundle — including the published registry bundles (#1180) — advertised no languages. There turned out to be two independent defects; the issue describes the first.
1. Nothing ever set
f.languagecgc_bundle.pyderives the list from alanguageproperty onFilenodes, but no writer set it and the KùzuFiletable had no such column. Theif record["language"]guard then filtered every row out.The per-file language is already known at write time as
file_data['lang'], so this persists it. Three places were needed, not one:writer.py— setf.languageon theFileMERGEdatabase_embedded_kuzu.py:173— add thelanguage STRINGcolumndatabase_embedded_kuzu.py:327— a migration entry, so existing local databases gain the column rather than silently lacking itdatabase_embedded_kuzu.py:821— addlanguagetoSCHEMA_MAP['File']That last one matters: Kùzu filters node properties against that allow-list and drops unknown ones silently, so the schema column alone would not have been enough and the failure would have been invisible. One of the tests targets exactly that step.
2. Unscoped exports skipped the block entirely
Even with the property populated,
bundle export foo.cgc(no--repo) still produced no languages — the whole block sat insideif repo_path and repo_path.exists():, so the key was never set at all. That's why the metadata showedNonerather than[].Moved it out of that branch with an unscoped query variant.
Verification
Real bundles, KuzuDB backend:
Tests
Three regression tests through the real
GraphWriterpath, including one specifically covering the allow-list drop. Verified all three fail onmainand pass with the fix.