-
Notifications
You must be signed in to change notification settings - Fork 68
feat(librariangen): add generate package #3952
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
Based on https://github.com/googleapis/google-cloud-go/tree/main/internal/librariangen/generate with adaptation for Java. Currently it's just the scaffolding and more work is need to generate a usable GAPIC library. The `generate` package contains the core logic for the generation process, including: - Reading and parsing the `generate-request.json` from librarian. - Parsing `BUILD.bazel` files in the googleapis repository to extract GAPIC configuration. - Building and executing `protoc` with the `gapic-generator-java` plugin. - Unzipping and restructuring the generated files into the final library layout. A `run-generate-library.sh` script is included for local development and end-to-end testing of the generation process. Additionally, a `go.work` file has been added to the root of the repository to support the multi-module workspace structure.
Summary of ChangesHello @meltsufin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3952 +/- ##
==========================================
- Coverage 93.81% 88.37% -5.44%
==========================================
Files 5 6 +1
Lines 194 370 +176
==========================================
+ Hits 182 327 +145
- Misses 9 30 +21
- Partials 3 13 +10
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:
|
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 generate package and command to librariangen, a tool for generating Java client libraries. The changes encompass the core generation logic, which includes parsing configurations, executing protoc, and organizing the output. Additionally, a test script and thorough unit tests have been added. The code is well-organized. I have identified a few opportunities for enhancement concerning resource management, the robustness of test code, and the portability of the script.
|
|
This reverts commit 2f6c75d.
🤖 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>



Based on https://github.com/googleapis/google-cloud-go/tree/main/internal/librariangen/generate with adaptation for Java.
Currently it's just the scaffolding and more work is needed to generate a usable GAPIC library.
The
generatepackage contains the core logic for the generation process, including:generate-request.jsonfrom librarian.BUILD.bazelfiles in the googleapis repository to extract GAPIC configuration.protocwith thegapic-generator-javaplugin.A
run-generate-library.shscript is included for local development and end-to-end testing of the generation process.Additionally, a
go.workfile has been added to the root of the repository to support the multi-module workspace structure.