Repository navigation
refactor(ent): remove deprecated billing fields - #4567
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 (57)
📒 Files selected for processing (13)
💤 Files with no reviewable changes (11)
📝 WalkthroughWalkthroughThe PR removes deprecated billing and charge tax/override schema fields, updates the matching Ent migration, deletes stale-override adapter tests, and makes one billing adapter query comment formatting-only change. ChangesBilling schema cleanup
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
0ff1c31 to
1211c66
Compare
1211c66 to
64dd671
Compare
Greptile SummaryThis PR removes deprecated Ent billing fields and regenerates the schema layer. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "refactor(ent): remove deprecated billing..." | Re-trigger Greptile |
| -- modify "charge_flat_fees" table | ||
| ALTER TABLE "charge_flat_fees" DROP COLUMN "override_feature_key", DROP COLUMN "override_payment_term", DROP COLUMN "override_pro_rating", DROP COLUMN "override_amount_before_proration", DROP COLUMN "override_percentage_discounts", DROP COLUMN "override_name", DROP COLUMN "override_description", DROP COLUMN "override_metadata", DROP COLUMN "override_tax_behavior", DROP COLUMN "override_tax_code_id", DROP COLUMN "override_service_period_from", DROP COLUMN "override_service_period_to", DROP COLUMN "override_full_service_period_from", DROP COLUMN "override_full_service_period_to", DROP COLUMN "override_billing_period_from", DROP COLUMN "override_billing_period_to", DROP COLUMN "override_present", DROP COLUMN "override_intent_deleted_at"; | ||
| -- modify "charge_usage_based" table |
There was a problem hiding this comment.
When existing charge_flat_fees or charge_usage_based rows still hold inline override_* values, this migration drops those columns before copying them into the dedicated override tables. The current charge adapters read overrides from the dedicated override rows, so those charges will come back without their saved intent overrides after the migration.
There was a problem hiding this comment.
I mean those fields are never written to.
There was a problem hiding this comment.
Got it — if the inline override_* columns were never written to, there's no data to migrate and the drop is completely safe. My concern was unfounded.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
64dd671 to
ef9724d
Compare
ef9724d to
72118b7
Compare
Summary
Deprecated(...)settings across billing, charges, and recursively applied mixins from PR feat: add db support for flatfee/usagebased charge intent overrides #4556.BillingInvoiceLine.credits_applied.intentoverridepackage entirely.Notes
TaxCodeas well. Without that, Ent recreates implicit foreign-key columns after the owning fields are removed.WithTaxCode()eager load for standard invoice detailed lines plus stale tests that wrote now-removed inline override columns directly.origin/main.make migrate-checkexits successfully.Validation
direnv exec . go generate ./openmeter/ent/...direnv exec . make generatedirenv exec . go vet -tags=dynamic ./...direnv exec . make migrate-checkSummary by CodeRabbit