Test: Add tests to ensure every DB table has a default entry in schem…#8341
Test: Add tests to ensure every DB table has a default entry in schem…#8341CarolineDenis wants to merge 2 commits into
Conversation
…a_localization_en.json
|
Warning One or more dependencies are approaching or past End-of-Life. |
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a Django test that parses model table declarations, compares them with ChangesSchema localization coverage
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specifyweb/specify/tests/test_schema_localization_contract.py`:
- Around line 37-38: Update the AST extraction logic in the schema localization
contract test to retain each associated model name alongside the lowercased
table slug instead of storing only stmt.value.value. Propagate that model name
into the missing-entry failure reported by the test so failures identify the
model and table involved, while preserving the existing table-name matching
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c06851d-778a-4988-93e0-6cf5860402e3
📒 Files selected for processing (1)
specifyweb/specify/tests/test_schema_localization_contract.py
grantfitzsimmons
left a comment
There was a problem hiding this comment.
Pretty cool idea! Nice!
- When there are no unexpected extras, printing "Unexpected schema localization-only tables:" with nothing after it is not needed.
- The allowlist is also part of the body, but should we maintain this list elsewhere? Are these tables excluded from any other part of the app (e.g. schema config) or should be?
- We could add feedback for future developers here like "Add entries to the
schema_localization_en.jsonfile or update the allowlist" - A count summary of the number of tables at the top would be nice, but totally optional
…a_localization_en.json
Fixes #8078
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
Summary by CodeRabbit