Repository navigation
feat: default billing invoices to schema level 2 - #4709
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughInvoice schema defaults now use level 2. Migration SQL backfills qualifying detailed invoice records per customer, while Ent mixins mark unsupported metadata and annotations as deprecated. Billing tests and migration verification are updated for the new schema level and data cleanup. ChangesInvoice schema level 2
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant MigrationCaller
participant InvoiceMigrationFunction
participant DetailedLineTables
participant BillingInvoices
MigrationCaller->>InvoiceMigrationFunction: migrate customer invoices to schema level 2
InvoiceMigrationFunction->>DetailedLineTables: insert detailed lines and discounts
InvoiceMigrationFunction->>BillingInvoices: update schema_level from 1 to 2
BillingInvoices-->>MigrationCaller: return updated invoice count
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
Summary
Impact
New invoices use the schema-level-2 representation by default. Existing schema-level-1 invoices remain untouched until the existing customer-lock migration trigger runs.
The migration updates both the
billing_invoices.schema_leveldefault and the singleton write-schema-level record. Its function replacement preserves the current lazy migration behavior and discount copying, while leaving deprecated annotations and metadata behind.Validation
make test-nocachego vetfor billing and billing testsAtlas reports only the existing column-alignment warning for migration
20260709134600; the new migration has no diagnostics.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Greptile Summary
This PR moves billing invoices to schema level 2 by default. The main changes are:
Confidence Score: 5/5
The changed flow looks mergeable after tightening one migration test.
test/billing/schemamigration_test.go
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: default billing invoices to schema..." | Re-trigger Greptile
Context used (3)