Skip to content

Conversation

@meltsufin
Copy link
Member

@meltsufin meltsufin commented Oct 23, 2025

  • Introduces the generation of gRPC stubs and resource helpers.
  • Modifies the Generate function to create output directories for GAPIC, gRPC, and proto files.
  • Updates the invokeProtoc function to pass an OutputConfig struct.
  • Updates the restructureOutput function to handle gRPC stubs and resource names.
  • Adds a copyAndMerge function to merge resource name files into the proto destination.
  • Updates the cleanupIntermediateFiles function to remove the GAPIC, gRPC, and proto directories.
  • Updates tests to reflect these changes.
  • Improvements in error handling.

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Oct 23, 2025
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.89%. Comparing base (a26a6d9) to head (0a06cef).
⚠️ Report is 2 commits behind head on main.

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     
Flag Coverage Δ
librariangen 78.89% <ø> (-1.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@meltsufin meltsufin marked this pull request as ready for review October 23, 2025 03:27
@meltsufin meltsufin requested a review from suztomo October 23, 2025 03:27
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"
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@meltsufin
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

suztomo
suztomo previously approved these changes Oct 23, 2025
@meltsufin meltsufin enabled auto-merge (squash) October 23, 2025 20:54
@meltsufin meltsufin merged commit 452d703 into main Oct 23, 2025
49 of 50 checks passed
@meltsufin meltsufin deleted the librariangen-grpc branch October 23, 2025 21:08
meltsufin added a commit that referenced this pull request Oct 24, 2025
diegomarquezp pushed a commit that referenced this pull request Nov 1, 2025
🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants