Skip to content

Conversation

@diegomarquezp
Copy link
Contributor

No description provided.

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/java-spanner API. labels Dec 8, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @diegomarquezp, 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 significantly upgrades the project's underlying infrastructure and expands its API surface. It ensures compatibility with Protobuf 4.x by updating reflection configurations, introduces robust tooling for publishing modules to the Bazel Central Registry, and integrates new CI/CD workflows for automated API updates and index generation. Additionally, it brings in new API definitions for Google Actions and Ad Manager, reflecting an expansion of supported services.

Highlights

  • Protobuf 4.x Compatibility: Updated reflection configurations across various google-cloud-spanner modules to support new DescriptorProtos features introduced in Protobuf 4.x, ensuring compatibility and leveraging newer capabilities.
  • Bazel Central Registry (BCR) Integration: Introduced a comprehensive set of files and scripts under .bcr/ to facilitate publishing googleapis modules to the Bazel Central Registry, streamlining the distribution process for Bazel users.
  • Enhanced CI/CD Workflows: Added new GitHub Actions and Kokoro CI configurations for automated tasks such as DIREGAPIC updates, API index generation, and general build/test execution, improving the project's continuous integration and delivery pipeline.
  • New API Definitions: Incorporated a significant number of new Google API definitions, including those for Actions SDK (v2), common Actions types, and Ad Manager (v1), expanding the available API surface within the repository.
  • Build System Modernization: Updated core build configurations, including .bazelignore, .bazeliskrc, .bazelrc, and WORKSPACE files, to align with modern Bazel practices, optimize build performance, and manage dependencies more effectively.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/hermetic_library_generation.yaml
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.

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 appears to be part of an effort to generate libraries using Protobuf 4.x. The changes include updating GraalVM reflection configurations for new Protobuf classes and adding a very large number of new files, including API definitions, build configurations, and helper scripts under an output/ directory.

My review focuses on the new scripts and configuration files, as the protobuf and build files seem to be auto-generated. I've identified a few areas for improvement in the shell scripts for robustness and correctness, such as using more stable methods for parsing command output, fixing a typo, removing unused code, and updating a default configuration value for consistency. I also have a suggestion for the GitHub Actions workflow to improve its reproducibility.


readonly DEFAULT_REPO="googleapis"
readonly DEFAULT_ORG="googleapis"
readonly DEFAULT_PROTOBUF_VERSION="21.7"

Choose a reason for hiding this comment

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

medium

The default protobuf version is set to 21.7, which is from the protobuf 3.x series. However, the WORKSPACE file in this repository uses version 25.7, and the PR title suggests a move to protobuf 4.x. For consistency and to align with the repository's dependencies, consider updating the default version here. This would also apply to the README.md file which documents this default.

Suggested change
readonly DEFAULT_PROTOBUF_VERSION="21.7"
readonly DEFAULT_PROTOBUF_VERSION="25.7"

Comment on lines +166 to +167
export pr_creation_output=$(bash -c "${pr_command}")
pr_url=$(grep '/pull/' <<< "${pr_creation_output}")

Choose a reason for hiding this comment

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

medium

Parsing the human-readable output of gh pr create with grep can be fragile and might break if the output format of the gh CLI changes in the future. To make this more robust, you can use the --json flag to get structured output and parse it with the -q flag to extract the URL directly.

Suggested change
export pr_creation_output=$(bash -c "${pr_command}")
pr_url=$(grep '/pull/' <<< "${pr_creation_output}")
pr_url=$(bash -c "${pr_command} --json url -q .url")

gh pr comment --body "${SKIP_FLAG_CHECK_COMMENT}" "${pr_url}"
echo "Done! You can see the created PR in ${pr_url}"
else
echo "The branch is ready. You can create a PR by runing:"

Choose a reason for hiding this comment

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

medium

There is a typo in the log message. runing should be running.

Suggested change
echo "The branch is ready. You can create a PR by runing:"
echo "The branch is ready. You can create a PR by running:"

Comment on lines +243 to +246
-d|--dry_run)
dry_run="$2"
shift
;;

Choose a reason for hiding this comment

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

medium

The --dry_run option is parsed here, but the dry_run variable is never used within the script. This appears to be either dead code or an unimplemented feature. To avoid confusion, it should be removed or the feature should be implemented.

set -e

SHARED=$(mktemp -d)
BRANCH="update-binary-`date +%Y%m%dT%H%M%S`"

Choose a reason for hiding this comment

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

medium

The use of backticks (`) for command substitution is generally discouraged in modern shell scripting. The $(...) syntax is preferred as it is more readable and can be nested safely.

Suggested change
BRANCH="update-binary-`date +%Y%m%dT%H%M%S`"
BRANCH="update-binary-$(date +%Y%m%dT%H%M%S)"

apt-get install -y jq
- name: Download discovery docs
run: |
curl https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/refs/heads/master/discoveries/compute.${{ matrix.version }}.json --output /tmp/compute.${{ matrix.version }}.json

Choose a reason for hiding this comment

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

medium

Fetching the discovery document from the master branch of another repository can make this workflow less reproducible and potentially flaky. If the file is moved or the branch is renamed, this step will fail. Consider using a specific commit SHA or a tag instead of a branch name to ensure you are fetching a known, stable version of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant