-
Notifications
You must be signed in to change notification settings - Fork 38
feat: migrate frontier Groups APIs to Connect RPC #1173
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
feat: migrate frontier Groups APIs to Connect RPC #1173
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull Request Test Coverage Report for Build 18273768303Warning: 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 successfully migrates all 11 Groups APIs from gRPC to Connect RPC format as part of the IAM API standardization initiative. The migration maintains identical business logic while adopting modern Connect RPC patterns for improved type safety and developer experience.
- Migrated 10 new Group APIs to Connect RPC format (CreateGroup, GetGroup, UpdateGroup, ListOrganizationGroups, ListGroupUsers, AddGroupUsers, RemoveGroupUser, EnableGroup, DisableGroup, DeleteGroup)
- Added comprehensive error handling with Connect error codes and proper error constants
- Implemented extensive test coverage with 50+ test cases covering all success and error scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
internal/api/v1beta1connect/group.go | Implements all 10 migrated Group API handlers with Connect RPC patterns and comprehensive error handling |
internal/api/v1beta1connect/group_test.go | Adds comprehensive test coverage for all migrated Group APIs with error and success scenarios |
internal/api/v1beta1connect/metaschema.go | Adds group metadata schema constant for validation |
internal/api/v1beta1connect/errors.go | Defines Group-specific error constants for proper error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9768939
to
1ed695f
Compare
- Migrate CreateGroup handler from gRPC to Connect RPC format - Add comprehensive test coverage with 9 test cases including error scenarios - Support auto-generation of group name from title using str.GenerateSlug - Include metadata validation and audit logging functionality - Handle all error cases: invalid body, org validation, conflicts, authentication - Preserve all original business logic and validation patterns
- Migrate GetGroup handler from gRPC to Connect RPC format - Add comprehensive test coverage with 7 test cases covering all scenarios - Include organization validation with proper error handling - Support optional member inclusion via WithMembers parameter - Handle group not found scenarios with appropriate error codes - Add ErrGroupNotFound constant for consistent error messaging - Preserve all original business logic including metadata validation - Fix CreateGroup slug generation issue discovered during testing
- Migrate UpdateGroup handler from gRPC to Connect RPC format - Add comprehensive test coverage with 10 test cases covering all scenarios - Include organization validation with proper error handling - Support complete metadata validation and conflict detection - Handle group not found scenarios with appropriate error codes - Preserve all original business logic including audit logging - Fix CreateGroup slug generation and error constant consistency
- Migrate ListGroupUsers handler from gRPC to Connect RPC format - Add comprehensive test coverage with 7 test cases covering all scenarios - Include organization validation with proper error handling - Support user listing and optional role retrieval with WithRoles parameter - Handle metadata transformation errors with appropriate error codes - Preserve all original business logic including logger integration - Support both basic user listing and enriched user+roles response
- Migrate AddGroupUsers handler from gRPC to Connect RPC format - Add comprehensive test coverage with 4 test cases covering all scenarios - Include organization validation with proper error handling - Support adding multiple users to groups via UserIds parameter - Handle groupService.AddUsers errors with appropriate error codes - Preserve all original business logic from gRPC implementation - Return empty response on successful user addition as per API contract
1ed695f
to
1c77958
Compare
Summary
β COMPLETE: Successfully migrated all Groups APIs from gRPC to Connect RPC format as part of the IAM API standardization initiative.
π Progress: 11/11 APIs Complete (100%) π
β All APIs Migrated Successfully:
π Migration Achievements:
Key Changes Made:
Technical Implementation:
request.GetField()
torequest.Msg.GetField()
connect.NewResponse(&ResponseType{...})
connect.NewError(code, error)
formattransformGroupToPB
andtransformUserToPB
Completed API Details:
ListGroups (Pre-existing)
ListOrganizationGroups
CreateGroup
GetGroup
UpdateGroup
ListGroupUsers
AddGroupUsers
RemoveGroupUser
EnableGroup
DisableGroup
DeleteGroup
Migration Methodology Established:
Each API followed a systematic 5-step migration approach:
Quality Metrics:
Impact and Benefits:
All migrated APIs maintain identical business logic while adopting modern Connect RPC interface patterns for improved type safety, better tooling support, and enhanced developer experience.