-
Notifications
You must be signed in to change notification settings - Fork 68
feat(librariangen): generate grpc stubs and resource helpers #3967
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3967 +/- ##
==========================================
- Coverage 80.27% 78.89% -1.39%
==========================================
Files 8 8
Lines 441 379 -62
==========================================
- Hits 354 299 -55
+ Misses 68 53 -15
- Partials 19 27 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| wget -q "https://repo1.maven.org/maven2/com/google/api/gapic-generator-java/$GAPIC_GENERATOR_VERSION/gapic-generator-java-$GAPIC_GENERATOR_VERSION.jar" -O "$WORKSPACE/gapic-generator-java.jar" | ||
|
|
||
| echo "Downloading protoc-gen-grpc-java..." | ||
| wget -q "https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/$GRPC_PLUGIN_VERSION/protoc-gen-grpc-java-$GRPC_PLUGIN_VERSION-linux-x86_64.exe" -O "$WORKSPACE/protoc-gen-java_grpc" |
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.
I think Dockerfile needs this too. https://github.com/googleapis/sdk-platform-java/blob/main/internal/librariangen/Dockerfile
This topic is part of how we can make abstraction over GAPIC generators, when thinking about the future in which we would say "All you language team needs to do is to provide their protoc plugins". If we have a consistent way to set protoc plugins across language containers, that would be a step towards it.
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.
I'll try to refactor this in a separate PR. I would migrate a lot of the logic in run-generate-library.sh to the Dockerfile.
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.
Sounds good.
|
/gemini review |
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.
Code Review
This pull request introduces the generation of gRPC stubs and resource helpers in the librariangen tool. It modifies the Generate function to create output directories for GAPIC, gRPC, and proto files, and updates the invokeProtoc function to pass an OutputConfig struct. The restructureOutput function is updated to handle gRPC stubs and resource names, and a copyAndMerge function is added to merge resource name files into the proto destination. The cleanupIntermediateFiles function is updated to remove the GAPIC, gRPC, and proto directories. Tests are updated to reflect these changes. I have identified a few areas where improvements can be made, particularly in error handling and code clarity.
🤖 I have created a release *beep* *boop* --- <details><summary>2.64.0</summary> ## [2.64.0](v2.63.0...v2.64.0) (2025-10-31) ### Features * [common-protos] Add `Carousel` widget ([1e4a7e5](1e4a7e5)) * **librariangen:** add generate package ([#3952](#3952)) ([2f6c75d](2f6c75d)) * **librariangen:** generate grpc stubs and resource helpers ([#3967](#3967)) ([452d703](452d703)) ### Dependencies * Bump grpc-java to v1.76.0 ([#3942](#3942)) ([ffb557c](ffb557c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Generatefunction to create output directories for GAPIC, gRPC, and proto files.invokeProtocfunction to pass anOutputConfigstruct.restructureOutputfunction to handle gRPC stubs and resource names.copyAndMergefunction to merge resource name files into the proto destination.cleanupIntermediateFilesfunction to remove the GAPIC, gRPC, and proto directories.