-
Notifications
You must be signed in to change notification settings - Fork 0
Remove gRPC-related classes and proto-generated files no longer in us… #2
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?
Conversation
…e to streamline the codebase.
…, controllers, and request/response handling. Integrate `GrpcServiceProvider` and update configuration and bootstrap files.
…eamline request handling, and introduce `CartController`. Update Docker environment variables and image version for compatibility. Remove unused gRPC config.
…ust method visibility, and refine service definitions.
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 removes obsolete proto-generated gRPC files and classes, streamlines service routing, and introduces a dynamic gateway for handling flexible gRPC requests.
- Deleted unused HealthService and GPBMetadata proto artifacts.
- Added
GrpcRouteRegistryandGrpcServiceRouterfor dynamic service/method routing. - Introduced
UserGrpcServiceand updated Cart/HTTP proxy services to use a gateway pattern.
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| app/Grpc/Services/UserGrpcService.php | Added gateway service to forward flexible gRPC calls |
| app/Grpc/Services/GrpcService.php | New HTTP-to-gRPC proxy (proxyRequest/dispatchGrpcRequest) |
| app/Grpc/GrpcRouteRegistry.php | New static registry for service-method mappings |
| app/Grpc/GrpcRoute.php | Fluent interface for registering gRPC routes |
| app/Console/Commands/GrpcServeCommand.php | Updated server command to handle UserGrpcService |
| app/Grpc/GPBMetadata/User/UserService.php | Removed generated proto metadata for UserService |
| $responseData = new Any(); | ||
| $resource = new UserResource($user); | ||
| $responseData->setValue(json_encode([ | ||
| 'data' => $resource |
Copilot
AI
Jun 14, 2025
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.
[nitpick] Passing a UserResource object directly into json_encode may not yield the expected structure; consider converting it to an array (e.g., $resource->toArray()) before encoding.
| 'data' => $resource | |
| 'data' => $resource->toArray() |
|
|
||
| namespace App\Grpc\Services; | ||
|
|
||
| use App\Grpc\Controllers\BaseGrpcService; |
Copilot
AI
Jun 14, 2025
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.
The BaseGrpcService import is not referenced in this file; remove the unused import to clean up the code.
| use App\Grpc\Controllers\BaseGrpcService; |
| if ($bearerToken = request()->bearerToken()) | ||
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; |
Copilot
AI
Jun 14, 2025
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.
[nitpick] Use braces for the if statement to avoid ambiguity and make future expansions safer (e.g., if (...) { ... }).
| if ($bearerToken = request()->bearerToken()) | |
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; | |
| if ($bearerToken = request()->bearerToken()) { | |
| $metadata['authorization'] = ['Bearer ' . $bearerToken]; | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…methods, simplify request handling, and adjust service definitions for improved consistency and maintainability.
…pdate ProductHandler for dependency injection
…cAuthMiddleware`, and migrate `logout` method from UserServer.
…e to streamline the codebase.