Skip to content

tests: Add protobuf 3.x compatibility tests with a third party library tensorflow.#4015

Merged
blakeli0 merged 7 commits intoprotobuf-4.x-rcfrom
add-tensorflow-tests
Dec 11, 2025
Merged

tests: Add protobuf 3.x compatibility tests with a third party library tensorflow.#4015
blakeli0 merged 7 commits intoprotobuf-4.x-rcfrom
add-tensorflow-tests

Conversation

@blakeli0
Copy link
Contributor

@blakeli0 blakeli0 commented Dec 10, 2025

Add protobuf 3.x compatibility tests with a third party library tensorflow in showcase module.

Tensorflow depends on protobuf-java v3.21.9 gen code and runtime. This proves that client libraries with 4.33 runtime and gen code are compatible with a third party library that contains 3.x gen code and runtime.

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Dec 10, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @blakeli0, 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 addresses potential compatibility issues by adding dedicated integration tests. It ensures that the gapic-showcase module, operating with a newer Protobuf version, can seamlessly interact with external libraries such as TensorFlow that are built upon an older Protobuf 3.x runtime and generated code. The primary goal is to prevent regressions and confirm interoperability in a mixed Protobuf environment.

Highlights

  • Protobuf 3.x Compatibility Testing: Introduced new integration tests to verify compatibility between the gapic-showcase module (which uses Protobuf 4.x) and third-party libraries like TensorFlow that depend on Protobuf 3.x generated code and runtime.
  • TensorFlow Test Dependency: Added org.tensorflow:tensorflow-core-platform as a test dependency in pom.xml to facilitate the new compatibility tests.
  • New Integration Test File: Created ITProtobuf3Compatibility.java which includes a basic TensorFlow 'hello world' example to validate that Protobuf 3.x based TensorFlow operations can coexist and function correctly with the module's Protobuf 4.x environment.
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
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 adds a new integration test to ensure compatibility with libraries that depend on Protobuf 3.x, using TensorFlow as an example. The changes include adding the TensorFlow dependency to pom.xml and a new test class ITProtobuf3Compatibility.

My review focuses on the new test class. I've found a few issues related to correctness and maintainability. Specifically, the test is missing a key assertion for the calculated result, uses brittle node access, and has incorrect assertions that compare incompatible types. I've provided suggestions to fix these issues to make the test more robust and correct.

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
1 New issue
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

@blakeli0 blakeli0 marked this pull request as ready for review December 11, 2025 03:17
@blakeli0 blakeli0 merged commit 40945d9 into protobuf-4.x-rc Dec 11, 2025
49 of 53 checks passed
@blakeli0 blakeli0 deleted the add-tensorflow-tests branch December 11, 2025 15:59
blakeli0 added a commit that referenced this pull request Jan 22, 2026
…y tensorflow. (#4015)

Add protobuf 3.x compatibility tests with a third party library
tensorflow in showcase module.

Tensorflow depends on [protobuf-java
v3.21.9](https://github.com/tensorflow/java/blob/cbf942051d55291ba9bdb019b2f207f013889bba/tensorflow-core/pom.xml#L45)
gen code and runtime. This proves that client libraries with 4.33
runtime and gen code are compatible with a third party library that
contains 3.x gen code and runtime.

---------

Co-authored-by: cloud-java-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants