Skip to content

refactor: get rid of appstripe entity package#4148

Merged
turip merged 1 commit intomainfrom
refactor/app-stripe-get-rid-of-entity
Apr 16, 2026
Merged

refactor: get rid of appstripe entity package#4148
turip merged 1 commit intomainfrom
refactor/app-stripe-get-rid-of-entity

Conversation

@turip
Copy link
Copy Markdown
Member

@turip turip commented Apr 16, 2026

Overview

The long overdue work to move the appstripe/entity into appstripe so that we are consistent with other parts of the system.

This is just code-move.

Notes for reviewer

Summary by CodeRabbit

  • Refactor
    • Reorganized internal Stripe integration code structure.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 449e2377-af71-495a-ac7b-829e7cb21e23

📥 Commits

Reviewing files that changed from the base of the PR and between 776a9d0 and 7d65c91.

📒 Files selected for processing (41)
  • api/v3/handlers/apps/convert.go
  • api/v3/handlers/customers/billing/convert.gen.go
  • api/v3/handlers/customers/billing/convert.go
  • api/v3/handlers/customers/billing/create_customer_stripe_checkout_session.go
  • api/v3/handlers/customers/billing/create_customer_stripe_portal_session.go
  • api/v3/handlers/customers/billing/get_billing.go
  • api/v3/handlers/customers/billing/update_billing.go
  • api/v3/handlers/customers/billing/update_billing_app_data.go
  • openmeter/app/httpdriver/app.go
  • openmeter/app/httpdriver/customer.go
  • openmeter/app/httpdriver/mapper.go
  • openmeter/app/httpdriver/marketplace.go
  • openmeter/app/stripe/adapter.go
  • openmeter/app/stripe/adapter/customer.go
  • openmeter/app/stripe/adapter/stripe.go
  • openmeter/app/stripe/app.go
  • openmeter/app/stripe/appcustomer.go
  • openmeter/app/stripe/appinvoice.go
  • openmeter/app/stripe/calculator.go
  • openmeter/app/stripe/clientapp.go
  • openmeter/app/stripe/config.go
  • openmeter/app/stripe/customerdata.go
  • openmeter/app/stripe/httpdriver/apikey.go
  • openmeter/app/stripe/httpdriver/checkout_session.go
  • openmeter/app/stripe/httpdriver/customer.go
  • openmeter/app/stripe/httpdriver/mapping.go
  • openmeter/app/stripe/httpdriver/webhook.go
  • openmeter/app/stripe/marketplace.go
  • openmeter/app/stripe/portal.go
  • openmeter/app/stripe/service.go
  • openmeter/app/stripe/service/app.go
  • openmeter/app/stripe/service/billing.go
  • openmeter/app/stripe/service/factory.go
  • openmeter/app/stripe/service/service.go
  • openmeter/app/stripe/types.go
  • openmeter/customer/service/hooks/subjectcustomer.go
  • openmeter/server/server_test.go
  • test/app/marketplace.go
  • test/app/stripe/appstripe.go
  • test/app/stripe/fixture.go
  • test/app/stripe/invoice_test.go

📝 Walkthrough

Walkthrough

This PR consolidates Stripe package types by moving from nested openmeter/app/stripe/entity and .../entity/app subpackages to direct usage of types from the top-level openmeter/app/stripe package. Import statements and type references are updated across 50+ files, affecting API handlers, HTTP drivers, service implementations, and tests.

Changes

Cohort / File(s) Summary
API v3 Billing Handlers
api/v3/handlers/apps/convert.go, api/v3/handlers/customers/billing/...
Updated type assertions and function signatures to use appstripe package types instead of nested entity types for request/response conversion and handler input types.
App HTTP Driver Layer
openmeter/app/httpdriver/app.go, openmeter/app/httpdriver/customer.go, openmeter/app/httpdriver/mapper.go, openmeter/app/httpdriver/marketplace.go
Consolidated imports from entity subpackages to direct appstripe package; updated type switches, type assertions, and function signatures for app/customer data mapping.
Core Stripe Package Refactoring
openmeter/app/stripe/adapter.go, openmeter/app/stripe/adapter/..., openmeter/app/stripe/app.go, openmeter/app/stripe/appcustomer.go, openmeter/app/stripe/appinvoice.go, openmeter/app/stripe/calculator.go, openmeter/app/stripe/clientapp.go, openmeter/app/stripe/config.go, openmeter/app/stripe/customerdata.go, openmeter/app/stripe/marketplace.go, openmeter/app/stripe/portal.go, openmeter/app/stripe/types.go, openmeter/app/stripe/service.go
Reorganized package namespace from appstripeentity(app) to appstripe; updated adapter interface signatures, service interface definitions, and struct embeddings to use consolidated types.
Stripe Service Implementations
openmeter/app/stripe/service/app.go, openmeter/app/stripe/service/billing.go, openmeter/app/stripe/service/factory.go, openmeter/app/stripe/service/service.go
Updated service method signatures and internal type construction to use appstripe package types; refactored secret key constant references.
Stripe HTTP Driver Handlers
openmeter/app/stripe/httpdriver/...
Updated request/response type aliases and webhook handler input types to reference consolidated appstripe package types.
Test & Fixture Files
openmeter/server/server_test.go, test/app/marketplace.go, test/app/stripe/...
Updated test mocks, fixtures, and assertions to use appstripe types; adjusted expected listing types and method signatures in mock implementations.
Customer Service Hooks
openmeter/customer/service/hooks/subjectcustomer.go
Updated customer provisioner to construct appstripe.CustomerData instead of entity-scoped types.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The refactoring is substantial and touches 50+ files systematically, but the changes follow a consistent homogeneous pattern (type replacement) rather than varying logic changes. Review effort centers on verifying import completeness, type signature consistency across service layers, and ensuring all call sites properly reference the consolidated package.

Possibly related PRs

Suggested reviewers

  • tothandras
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main refactoring objective: consolidating the appstripe/entity package into the appstripe package, eliminating a nested package structure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/app-stripe-get-rid-of-entity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@turip turip added release-note/ignore Ignore this change when generating release notes area/billing labels Apr 16, 2026
@turip turip marked this pull request as ready for review April 16, 2026 08:36
@turip turip requested a review from a team as a code owner April 16, 2026 08:36
@turip turip merged commit 6ac2c95 into main Apr 16, 2026
27 of 29 checks passed
@turip turip deleted the refactor/app-stripe-get-rid-of-entity branch April 16, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/billing release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants