Repository navigation
fix(billing): register the custom invoicing app in the jobs binary - #5004
Conversation
Marketplace listings are registered as a side effect of constructing each app service, and wire only constructs what a binary's Application struct demands. cmd/jobs demands the sandbox and stripe apps but not custom invoicing, so its in-process registry has no custom_invoicing listing and subscription sync fails against a billing profile driven by that app: getting billing profile: cannot resolve tax app: failed to get listing for app <id>: not found error: listing with type not found: custom_invoicing The server and cmd/billing-worker construct the service, which is why the same app resolves fine on every other surface. Demand it from cmd/jobs as well (wire_gen regenerated).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe job application wiring now imports, constructs, and exposes the custom invoicing service. Construction errors trigger the existing cleanup sequence before returning. ChangesCustom invoicing wiring
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change registers the custom invoicing app for the jobs binary so paid subscription reconciliation can resolve the configured billing profile; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
|
Thank you for your contribution! |
The jobs binary (subscription sync cronjob) cannot resolve a billing profile driven by the custom_invoicing app:
Marketplace listings are registered as a side effect of constructing each app service, and wire only constructs what a binary's Application struct demands. cmd/jobs demands the sandbox and stripe apps but not custom invoicing; the server and cmd/billing-worker construct it, which is why the same app resolves fine on every other surface.
Repro: install custom_invoicing, create a default billing profile with it in all three slots, subscribe a customer to a paid plan, run
openmeter-jobs billing subscriptionsync all. Free-plan subscriptions skip on "no billables" before profile resolution, so the failure only shows on paid ones.Fix: demand the service from cmd/jobs as well; wire_gen.go regenerated. Verified against v1.0.0-beta.231 and .232 — the stock binary fails as above, the patched one reconciles the paid subscription into a gathering invoice.
Summary by CodeRabbit
Greptile Summary
The PR adds the custom invoicing service to the jobs binary’s dependency graph so its marketplace listing is registered before subscription synchronization resolves billing profiles.
appcustominvoicing.Serviceto the jobsApplication.Confidence Score: 5/5
The PR appears safe to merge, with the jobs dependency graph now consistently registering the custom invoicing marketplace listing.
The added provider uses dependencies already available in the jobs graph, matches existing server and billing-worker composition, and preserves generated initialization and cleanup behavior.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Start[Jobs application initialization] --> Construct[Construct custom invoicing service] Construct --> Register[Register custom_invoicing marketplace listing] Register --> Sync[Run paid subscription synchronization] Sync --> Resolve[Resolve custom invoicing billing profile] Resolve --> Invoice[Reconcile gathering invoice]Reviews (1): Last reviewed commit: "fix(billing): register the custom invoic..." | Re-trigger Greptile
Context used: