-
Notifications
You must be signed in to change notification settings - Fork 38
feat: migrate frontier RPC billing checkout APIs to Connect RPC #1169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: migrate frontier RPC billing checkout APIs to Connect RPC #1169
Conversation
Migrates the CreateCheckout API from gRPC to Connect RPC format, including: - Implementation of CreateCheckout handler with setup, subscription, and product checkout support - Comprehensive test suite with 11 test cases covering all scenarios - Mock service for testing - Error handling for per-seat limits and internal server errors
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull Request Test Coverage Report for Build 18153697235Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the Frontier billing checkout APIs from gRPC to Connect RPC as part of a broader API modernization effort. The migration covers four core checkout APIs: CreateCheckout, DelegatedCheckout, ListCheckouts, and GetCheckout.
Key changes implemented:
- Complete Connect RPC implementation for all checkout APIs with proper error handling
- Comprehensive test coverage with 24 test cases covering success and error scenarios
- Mock service generation for testing isolation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
internal/api/v1beta1connect/billing_checkout.go |
Implements all four Connect RPC checkout handlers with business logic preservation |
internal/api/v1beta1connect/billing_checkout_test.go |
Comprehensive test suite with 24 test cases covering all API scenarios |
internal/api/v1beta1connect/mocks/checkout_service.go |
Auto-generated mock service for testing |
internal/api/v1beta1connect/errors.go |
Adds KYC completion error constant |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
Migrate billing checkout APIs from gRPC to Connect RPC format as part of the broader migration effort to modernize the API layer.
APIs to Migrate
Progress Summary
Implementation Details
✅ CreateCheckout API
CreateCheckout(ctx, *connect.Request[CreateCheckoutRequest]) (*connect.Response[CreateCheckoutResponse], error)
CreateSessionForPaymentMethod
CreateSessionForCustomerPortal
✅ DelegatedCheckout API (Pre-existing)
DelegatedCheckout(ctx, *connect.Request[DelegatedCheckoutRequest]) (*connect.Response[DelegatedCheckoutResponse], error)
✅ ListCheckouts API
ListCheckouts(ctx, *connect.Request[ListCheckoutsRequest]) (*connect.Response[ListCheckoutsResponse], error)
CodeInvalidArgument
errorCodeInternal
for service errorstransformCheckoutToPB
functionCodeInvalidArgument
,CodeInternal
)✅ GetCheckout API
GetCheckout(ctx, *connect.Request[GetCheckoutRequest]) (*connect.Response[GetCheckoutResponse], error)
CodeInvalidArgument
errorcheckoutService.GetByID
CodeInternal
for service errorstransformCheckoutToPB
functionCodeInvalidArgument
,CodeInternal
)Testing Coverage
Technical Notes
Files Modified/Created
internal/api/v1beta1connect/billing_checkout.go
- All checkout API implementationsinternal/api/v1beta1connect/billing_checkout_test.go
- Comprehensive test suiteinternal/api/v1beta1connect/mocks/checkout_service.go
- Mock serviceMigration Verification
Related Issue: Linear CLD-2278
Migration Pattern: gRPC → Connect RPC
Status: ✅ COMPLETED (4/4 APIs migrated)