fix: remove leftover refactor scaffolding - #892
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (16)
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe PR centralizes constants and metadata helpers in ChangesConstants module migration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR only cleans up unused scaffolding and redirects imports to the correctly named internal constants module without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Deletes three dead artifacts from the hexagonal migration: the openrag/consts.py re-export shim (which also hid its four importers from check_layer_imports.py, since the shim sits outside the layer roots), the unused SingletonMeta metaclass, and the empty services/events/ package. Repoints the four shim consumers directly at core.utils.consts, and renames core/utils/conts.py -> consts.py to fix the module name typo while its importers are already being touched.
e75749b to
2dc287e
Compare
EnjoyBacon7
left a comment
There was a problem hiding this comment.
Reviewed the full diff. Mechanically complete and behavior-preserving.
Verified:
- No surviving references to
conts,SingletonMeta,utils.singleton, orservices.eventsanywhere in the repo, including docs, .github/, infra/ and conf/. - AST-based import resolution across
openrag/andtests/: zero unresolvable internal imports. - No dynamic references that a symbol grep would miss (importlib, sys.modules stubbing, monkeypatch/patch string targets, spec_from_file_location).
tests/unit/test_app_front_secret.pyloads app_front.py by path but only syspath_prependsopenrag/, so the new import resolves identically. - All attributes used via the widened module import exist (
FILE_READ_CHUNK_SIZE,PARTITION_PREFIX,LEGACY_PARTITION_PREFIX). The shim only re-exported 4 names, so this is strictly additive, with no shadowing and no cycle risk. scripts/check_layer_imports.pypasses. The repoint turns an invisible top-level import into a properly classified api -> core edge.ruff checkandruff format --checkboth clean.- Packaging unaffected: pyproject uses
packages.find include = ["openrag*"], so removingservices/eventsneeds no manifest edit.
Fully closes #888.
Minor note, not blocking and pre-existing: consts.py also holds behavior (is_internal_metadata_key, strip_internal_metadata, strip_protected_metadata), which is an odd fit for a constants module.
Summary
openrag/consts.py(a re-export shim outside the layer roots, which hid its four importers fromcheck_layer_imports.py), the unusedSingletonMetametaclass, and the emptyservices/events/packageapi/dependencies/llm.py,api/dependencies/files.py,api/routers/user/chat.py,app_front.py) directly atcore.utils.constscore/utils/conts.py->consts.pyto fix the module name typo while its importers are already being touchedCloses #888
Test plan
uv run ruff check openrag/ tests//ruff format --checkpython scripts/check_layer_imports.pypassesuv run pytest tests/unit/— 2764 passed (1 pre-existing, unrelated failure intest_compose_storage.pyfrom a local docker-compose bind-mount edit, not part of this branch)import constsnow raisesModuleNotFoundErrorand all repointed modules import cleanlySummary by CodeRabbit
New Features
Bug Fixes
Refactor