Skip to content

Conversation

@meltsufin
Copy link
Member

@meltsufin meltsufin requested a review from suztomo October 15, 2025 03:29
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Oct 15, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 introduces a new capability to parse Bazel BUILD.bazel files, specifically focusing on java_gapic_library rules. This allows the librariangen tool to dynamically read and interpret configuration parameters directly from Bazel build definitions, such as service YAML paths and transport types. The change aims to streamline the generation process for Java GAPIC clients by integrating Bazel's declarative configuration into the generation workflow, ensuring that the generated clients adhere to the specified build settings.

Highlights

  • New Bazel Package: Introduced a new bazel package within internal/librariangen to handle Bazel-specific configurations.
  • Bazel BUILD File Parsing: Added functionality to parse BUILD.bazel files, specifically targeting java_gapic_library rules to extract relevant configuration parameters.
  • Configuration Extraction: The parser extracts key attributes such as grpc_service_config, service_yaml, transport, and rest_numeric_enums from the java_gapic_library rule.
  • Configuration Validation: Implemented validation logic for the extracted configuration, ensuring that necessary fields like serviceYAML are present when a GAPIC client is to be generated.
  • Comprehensive Testing: Included a dedicated test file (parser_test.go) with various test cases covering successful parsing, handling of different attribute formats, configuration validation, and scenarios where no GAPIC library is defined.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (598de06) to head (4b8f854).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3940      +/-   ##
==========================================
- Coverage   94.02%   93.81%   -0.22%     
==========================================
  Files           4        5       +1     
  Lines         134      194      +60     
==========================================
+ Hits          126      182      +56     
- Misses          6        9       +3     
- Partials        2        3       +1     
Flag Coverage Δ
librariangen 93.81% <ø> (-0.22%) ⬇️

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.

Copy link

@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 a new Bazel configuration parser for librariangen, specifically for java_gapic_library rules. The implementation uses regular expressions to extract configuration values, which is a pragmatic approach for this use case. The changes are well-tested. My review includes suggestions to improve performance by pre-compiling and caching regular expressions, to use the slog logging library more idiomatically, and to enhance the structure of tests for clearer reporting.

suztomo
suztomo previously approved these changes Oct 15, 2025
@meltsufin
Copy link
Member Author

/gemini review

Copy link

@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 a new Bazel parser for librariangen to extract configuration from BUILD.bazel files. The implementation is a good start, but my review focuses on improving the robustness and concurrency safety of the parsing logic. I've suggested changes to handle different quoting styles in Bazel files, make boolean parsing more resilient to prevent silent failures, and fix a race condition in the regular expression caching mechanism.

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@meltsufin meltsufin merged commit feabef3 into main Oct 16, 2025
48 of 49 checks passed
@meltsufin meltsufin deleted the librariangen-bazel branch October 16, 2025 14:25
lqiu96 pushed a commit that referenced this pull request Oct 16, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>2.63.0</summary>

##
[2.63.0](v2.62.3...v2.63.0)
(2025-10-16)


### Features

* **librariangen:** add bazel package
([#3940](#3940))
([feabef3](feabef3))
* **librariangen:** add execv package
([#3932](#3932))
([f6b0b47](f6b0b47))
* **librariangen:** add protoc package
([#3935](#3935))
([598de06](598de06))
* **librariangen:** add request package
([#3933](#3933))
([fe44aed](fe44aed))
* **librariangen:** scaffold Java language container for Librarian
([#3926](#3926))
([29d188d](29d188d))


### Dependencies

* Bump errorprone-annotations to v2.42.0
([8d6c1f9](8d6c1f9))
* Bump guava to v33.5.0
([8d6c1f9](8d6c1f9))
* Bump j2objc-annotations to v3.1
([8d6c1f9](8d6c1f9))
* update google auth library dependencies to v1.40.0
([#3945](#3945))
([1d74663](1d74663))
* Upgrade Google Http Java Client to v2.0.2
([#3946](#3946))
([7fb4f15](7fb4f15))
</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>
meltsufin added a commit that referenced this pull request Oct 24, 2025
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.

3 participants