deleted-symbols-gate is blind to a re-export dropped from a package __init__.py - #314
Conversation
The export-removal clause in find_removed_all_entries only matched __all__ entries whose def/class lived in the same file. Re-exports (names imported via from-import, not defined locally) never matched, so dropping e.g. KnowledgeGraph from taosmd/__init__.py __all__ while the import line and the definition survived went unreported. Add _extract_imports/_get_imports_at_ref to resolve from-import bindings to candidate definition keys, and extend find_removed_all_entries to follow those bindings when a same-file definition is absent. _resolve_export_key lets the existing def and class search target the real definition file for an accurate added-by. A genuine deletion that removes the __all__ entry, the import, and the definition is not flagged by the export half (it is caught by the def-deletion half). Adds TestExtractImports, re-export cases to TestFindRemovedAllEntries, TestResolveExportKey, TestReexportRemovalIntegration, and TestReexportRemovalControl.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reached
Next review available in: 7 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by step-3.7-flash · Input: 106.4K · Output: 35.7K · Cached: 347.5K |
MERGE — all four controls reproduced independently, on real repository input rather than fixturesReviewed at Every acceptance item was re-run against the repo itself rather than read out of the test file, RED — the precise case the card filed, and it is the aliased one
That is the blind spot closing, measured. CONTROL 1 — a legitimate deletion still does not trip the export halfRemoved the Exactly the split the card asked for: the deletion is reported once, by the half that owns it. CONTROL 2 — no regression on the standing known-bad branchReplayed both gates against All three names #306 was carded for are still there, and nothing was added or lost. CONTROL 3 and the restScan scope is consistent — all three Notes, none blocking
One trap for whoever re-runs this comparisonCopying the old gate to Merging. Card Reviewed by @jaylfc. |
CARD TITLE (intent, not commit subject): deleted-symbols-gate is blind to a re-export dropped from a package init.py
Autonomous build of board card tsk-cssuku.
The export-removal clause in find_removed_all_entries only matched
all entries whose def/class lived in the same file. Re-exports
(names imported via from-import, not defined locally) never matched, so
dropping e.g. KnowledgeGraph from taosmd/init.py all while the
import line and the definition survived went unreported.
Add _extract_imports/_get_imports_at_ref to resolve from-import
bindings to candidate definition keys, and extend
find_removed_all_entries to follow those bindings when a same-file
definition is absent. _resolve_export_key lets the existing def and
class search target the real definition file for an accurate added-by.
A genuine deletion that removes the all entry, the import, and the
definition is not flagged by the export half (it is caught by the
def-deletion half).
Adds TestExtractImports, re-export cases to TestFindRemovedAllEntries,
TestResolveExportKey, TestReexportRemovalIntegration, and
TestReexportRemovalControl.
Files:
changelog.d/tsk-cssuku-reexport-gate.md | 2 +
scripts/check_deleted_symbols.py | 142 ++++++++++++-
tests/test_deleted_symbols.py | 360 ++++++++++++++++++++++++++++++++
3 files changed, 495 insertions(+), 9 deletions(-)