Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rohilsurana
Copy link
Member

@rohilsurana rohilsurana commented Oct 1, 2025

Summary

Migrate billing products and features APIs from gRPC to Connect RPC format as part of the billing system modernization.

Progress: 8/8 APIs Complete (100%) ✅

✅ Completed APIs:

  • ListProducts - Lists all available products
  • GetProduct - Retrieves product details by ID
  • CreateProduct - Creates new products with pricing and features
  • UpdateProduct - Updates existing product configurations
  • ListFeatures - Lists all available product features
  • GetFeature - Retrieves feature details by ID
  • CreateFeature - Creates new product features with metadata support
  • UpdateFeature - Updates existing feature configurations

Migration Complete! 🎉

All billing products and features APIs have been successfully migrated from gRPC to Connect RPC format. The migration maintains 100% backward compatibility while modernizing the API interface.

Key Changes Made:

  • Migrated handler signatures to use Connect RPC request/response wrappers
  • Updated error handling to use Connect error codes and constants
  • Preserved all business logic and validation rules
  • Added comprehensive test coverage for all migrated endpoints
  • Maintained backward compatibility with existing proto definitions

Technical Implementation:

  • Request Access: Changed from request.GetField() to request.Msg.GetField()
  • Response Wrapping: Using connect.NewResponse(&ResponseType{...})
  • Error Handling: Convert to connect.NewError(code, error) format
  • Logger Integration: Maintained existing logging patterns where present
  • Mock Testing: Updated test framework to use Connect RPC patterns

Test Coverage:

Each migrated API includes comprehensive test coverage with:

  • Success scenarios with minimal and complex data
  • Error handling for service failures and validation errors
  • Edge cases including empty requests and missing data
  • Metadata handling for structured data

All APIs maintain identical business logic while adopting Connect RPC interface patterns. The migration provides a solid foundation for modern API development with improved type safety and better tooling support.

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
frontier Ready Ready Preview Comment Oct 1, 2025 11:23am

@rohilsurana rohilsurana changed the title feat: migrate billing products APIs to Connect RPC feat: migrate billing products and features APIs to Connect RPC Oct 1, 2025
@coveralls
Copy link

coveralls commented Oct 1, 2025

Pull Request Test Coverage Report for Build 18160547142

Details

  • 130 of 160 (81.25%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 34.914%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/v1beta1connect/billing_product.go 130 160 81.25%
Totals Coverage Status
Change from base Build 18153836563: 0.2%
Covered Lines: 13053
Relevant Lines: 37386

💛 - Coveralls

@rohilsurana rohilsurana marked this pull request as ready for review October 2, 2025 04:44
@rsbh rsbh merged commit ad2b163 into main Oct 3, 2025
7 checks passed
@rsbh rsbh deleted the feature/cld-2275-migrate-frontier-rpc-billing-products branch October 3, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants