Repository navigation
merge: reconcile upstream through 7ba8eee4 - #479
Conversation
… deleted or added (colbymchenry#2512) Deleting a module that re-exports what it imports (a package's `__init__.py`, an `index.ts` barrel) left every file importing through it linked to the symbols it re-exported: those edges point into files that stay, so the removal cascaded none of them. When such a module was added or came back, its importers kept the edges a name lookup had made in its absence, or stayed failed; and in a large Python project the failed import of the module itself stayed failed, because the failed-import retry skips a stem with more than 500 imports waiting (Django's `test`, `models`). Sync now re-opens, as pending references for its sweep, what the files importing a removed or added module bind through those imports: before the removed files are deleted, and after the retries for the added ones (with their failed references and the module's own failed import). Importers are found by the import edge into the file, by Python import nodes naming the module or its package, and through what the module passes on (an import inside a function has no node); in Python, a package or star import re-exporting a changed module leads on to its own importers, as deep as the resolver chases a name. All changed files are handled in one pass, with importer edges and failed references filtered by the bound names in SQL. Python and the ES-module family only; no schema or extraction change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges upstream main through 7ba8eee (colbymchenry#2512): sync and the file watcher update the files that import through a re-exporting module (a package's __init__.py or an index.ts barrel) when it is deleted or added. - src/index.ts stays the fork's re-export; upstream's three hunks in CodeGraph.sync are applied in src/codegraph.ts. - The import reader takes the file's `import` binding rows through importMappingsFromBindings instead of extractImportMappings, which is a stub in the fork (every language's imports come from `bindings`). With the stub the re-open found no importers and did nothing. - CHANGELOG: only the colbymchenry#2512 entry is added; four other flagged upstream entries are already in the fork's changelog in its own wording. - README: upstream merge point a3fdb92 -> 7ba8eee.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk | ⚪ Minimal · up to
|
| Check name | Status | Explanation |
|---|---|---|
| Description Check | Check skipped - CodeRabbit’s high-level summary is enabled. | |
| Title check | The title accurately identifies the primary purpose: reconciling the fork with upstream through commit 7ba8eee. It is concise and specific. | |
| Linked Issues check | Check skipped because no linked issues were found for this pull request. | |
| Out of Scope Changes check | Check skipped because no linked issues were found for this pull request. | |
| Suppressions Explained | PASS. The reviewed diff adds no lint, type-check, or compiler suppression directive. Searches of all added lines found no eslint-disable, @ts-expect-error, @ts-ignore, Rust #[allow], ignore co… |
|
| User-Visible Changes Documented | The reviewed diff changes sync resolution for re-exporting modules and adds tests and changelog text. It does not add, remove, or rename a CLI command or flag, MCP tool or argument, supported language… |
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Review: #479 (review) |
Merges upstream
mainthrough7ba8eee4(colbymchenry#2512), one commit past the previous merge pointa3fdb920. The fix:codegraph syncand the file watcher now update the files that import through a re-exporting module (a package's__init__.pyor anindex.tsbarrel) when that module is deleted or added. Without this merge the hourly fork-sync keeps declining to promote, because upstream has a commit the fork has not taken.Resolution. One conflict, in
src/index.ts, which the fork reduced to a re-export ofsrc/codegraph.ts. It stays as the fork has it, and upstream's three hunks inCodeGraph.syncare applied insrc/codegraph.tsinstead: themodule-importersimport,edgesBeforeResolutionread before resolution starts, and the re-open of references through added modules after the failed-reference retry.src/resolution/module-importers.ts, its test and the changes tosrc/db/queries.ts,src/extraction/index.tsandsrc/resolution/import-resolver.tsmerged cleanly.One adaptation beyond the port. Upstream's
createImportReaderread each importer's imports withextractImportMappings, a source-text reader. In the fork that function is a stub that returns nothing, because every language's imports come from thebindingstable, so the re-open found no importers and did nothing: the six newsync-module-importerstests failed four of six on the merge as it first stood. The reader now takesqueriesand reads the file'simportbinding rows throughimportMappingsFromBindings, as the resolver does. A Python star import still comes from the file's text, since it has no binding to bind.CHANGELOG.
scripts/changelog-reconcile.mjsflagged five upstream entries. One (colbymchenry#2512) is added. The other four (VB.NET type-name lookup, the CRLF store fix, C++ calls with no receiver, Go calls through a variable named like a standard-library package) are already in the fork's changelog from earlier merges, in the fork's own wording, so they are not added a second time.Checks.
tsc --noEmitexit 0. Full suite on Node.js 24.21.0: 697 test files, 8,913 tests passed and 37 skipped. Rust is unchanged, so the golden dumps do not move.README rows checked. The upstream merge point on line 55 moves from
a3fdb920to7ba8eee4. No comparison row names a measured upstream commit that this merge changes.Summary by cubic
Merges upstream
mainthrough7ba8eee4(colbymchenry#2512):codegraph syncand the file watcher now re-resolve the files that import through a re-exporting module (a package's__init__.pyor anindex.tsbarrel) when that module is deleted or added. Without this merge the hourly fork-sync keeps declining to promote, because upstream has a commit the fork has not taken.Reconciliation
src/index.ts, which stays the fork's re-export ofsrc/codegraph.ts; upstream's three hunks inCodeGraph.syncare applied insrc/codegraph.tsinstead.createImportReaderread imports withextractImportMappings, a stub in the fork, so the new tests failed four of six; the reader now reads the file'simportbinding rows throughimportMappingsFromBindings, as the resolver does.CHANGELOG.mdgets only the fix(sync): imports through a re-exporting module follow it when it is deleted or added colbymchenry/codegraph#2512 entry; the four other flagged upstream entries are already in the fork's changelog in its own wording.tsc --noEmitpasses; the full suite runs 8,913 tests with 37 skipped, and Rust is unchanged so the golden dumps do not move.Written for commit e43d932. Summary will update on new commits.
Summary by CodeRabbit
codegraph syncnow updates dependent import links when re-exporting modules are added or removed, including Python imports that pass through package re-exports.