Repository navigation
refactor(storage): describe schema bootstrap extensions (#372) - #372
Conversation
Problem: current-version schema bootstrap extension planning repeated table, column, index, and backfill facts inside imperative conditionals, making drift between detection and application easy. What changed: add typed schema extension descriptors for columns, indexes, scripts, and backfills; expand the bootstrap plan from the ordered descriptor catalog; and derive snapshot table/index inspection from the same catalog. Verification: ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py; mypy polylogue/storage/backends/schema_bootstrap.py; pytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py; devtools render-all --check; devtools verify. Ref #325
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 19 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Replace the current-version schema bootstrap planner's repeated imperative extension checks with a typed descriptor catalog that drives both plan expansion and schema snapshot scope. ## Problem Issue #325 identified that `polylogue/storage/backends/schema_bootstrap.py` repeated column, index, FTS/script, and backfill facts inside `build_current_schema_extension_plan()`. That made it easy for detection state to drift from application state, especially when adding new current-version schema extensions. Closes #325 ## Solution - Added column, index, script, and backfill descriptor types in `polylogue/storage/backends/schema_bootstrap.py`. - Replaced the imperative extension planning block with ordered descriptor expansion, preserving the existing SQL order and the raw source-mtime drift-replacement behavior. - Made sync and async schema snapshot capture derive inspected tables and indexes from the descriptor catalog. - Added backend tests covering descriptor expansion, descriptor-driven snapshot scope, and catalog-to-plan SQL expansion. ## Verification - `ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py` → passed - `pytest -q tests/unit/storage/test_backend.py -k 'schema'` → 9 passed - `mypy polylogue/storage/backends/schema_bootstrap.py` → no issues - `pytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py` → 57 passed - `devtools render-all --check` → generated surfaces in sync - `devtools verify` → all checks passed - `git push -u origin feature/refactor/schema-bootstrap-descriptors` → pre-push quick verification passed
Summary
Replace the current-version schema bootstrap planner's repeated imperative extension checks with a typed descriptor catalog that drives both plan expansion and schema snapshot scope.
Problem
Issue #325 identified that
polylogue/storage/backends/schema_bootstrap.pyrepeated column, index, FTS/script, and backfill facts insidebuild_current_schema_extension_plan(). That made it easy for detection state to drift from application state, especially when adding new current-version schema extensions.Closes #325
Solution
polylogue/storage/backends/schema_bootstrap.py.Verification
ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py→ passedpytest -q tests/unit/storage/test_backend.py -k 'schema'→ 9 passedmypy polylogue/storage/backends/schema_bootstrap.py→ no issuespytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py→ 57 passeddevtools render-all --check→ generated surfaces in syncdevtools verify→ all checks passedgit push -u origin feature/refactor/schema-bootstrap-descriptors→ pre-push quick verification passed