Skip to content

Conversation

@scotthart
Copy link
Member

In order to maintain feature parity from the deprecated handwritten class and avoid re-introducing threading issues previously resolved (#7740), the generator has been updated to emit code for a method not defined in the proto file. This support is intended as a one-off and is very specific to the bigtable WaitForConsistency method.

The ConnectionImpl::WaitForConsistency implementation must be handwritten in a separate .cc file.

@scotthart scotthart requested a review from a team as a code owner January 29, 2026 16:04
@gemini-code-assist
Copy link

Summary of Changes

Hello @scotthart, 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 mechanism to support "bespoke methods" within the code generation framework, primarily to address the WaitForConsistency method in the Bigtable client library. By allowing the generator to declare these methods in client and connection interfaces, it facilitates the migration from handwritten classes to generated ones while preserving critical, non-proto-defined functionality and avoiding re-introduction of past threading issues. The implementation of these bespoke methods in the ConnectionImpl class is intentionally left for manual coding.

Highlights

  • New Bespoke Method Configuration: Introduced a new BespokeMethod message and a repeated bespoke_methods field in generator/generator_config.proto to define methods not present in proto files but required for generated clients.
  • WaitForConsistency Support: Specifically implemented support for the WaitForConsistency method, which was previously handwritten for Bigtable, to be declared in generated client and connection interfaces.
  • Code Generation Logic Update: Modified the code generator to parse and emit declarations for these bespoke methods in client, connection, and connection implementation files.
  • Hardcoded Documentation: Added specific Doxygen comments for the WaitForConsistency method directly within the generator (client_generator.cc) to ensure proper documentation for the generated code.
  • Integration Test Updates: Updated golden integration test files to include the generated WaitForConsistency method, ensuring the new generation logic works as expected.
  • Handwritten Implementation Requirement: Explicitly noted that the implementation for bespoke methods in ConnectionImpl is not generated and must be handwritten, maintaining flexibility for complex logic.
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 adds generator support for a bespoke WaitForConsistency method, primarily for feature parity with Bigtable's handwritten client. The changes introduce a BespokeMethod configuration in the generator, update various generator components to handle this new configuration, and add corresponding tests. The implementation is a good starting point, but there are a few areas for improvement regarding code formatting, consistency in test documentation, and the robustness of string manipulations, which could enhance maintainability.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 21.31148% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.86%. Comparing base (9429a07) to head (4407adf).
⚠️ Report is 2 commits behind head on prepare-for-v3.0.0.

Files with missing lines Patch % Lines
generator/internal/client_generator.cc 12.50% 14 Missing ⚠️
generator/internal/connection_generator.cc 12.50% 14 Missing ⚠️
generator/internal/service_code_generator.cc 16.66% 10 Missing ⚠️
...gration_tests/golden/v1/golden_rest_only_client.cc 0.00% 4 Missing ⚠️
generator/internal/connection_impl_generator.cc 20.00% 4 Missing ⚠️
...ion_tests/golden/v1/golden_rest_only_connection.cc 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           prepare-for-v3.0.0   #15914      +/-   ##
======================================================
- Coverage               92.87%   92.86%   -0.02%     
======================================================
  Files                    2343     2343              
  Lines                  216117   216178      +61     
======================================================
+ Hits                   200719   200743      +24     
- Misses                  15398    15435      +37     

☔ 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.

@scotthart scotthart merged commit 74e98fc into googleapis:prepare-for-v3.0.0 Jan 29, 2026
51 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants