Skip to content

Conversation

@scotthart
Copy link
Member

This PR removes the decommissioned handwritten admin APIs in favor of the generated APIs and updates the tests and samples.

The ABI dump and migration guide are also updated.

@scotthart scotthart requested a review from a team as a code owner January 29, 2026 22:58
@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 completes the migration of Bigtable admin functionalities from legacy handwritten C++ classes to the modern, generated client libraries. This refactoring streamlines the codebase, removes technical debt, and ensures consistency with current API generation practices, providing a more maintainable and robust foundation for future development.

Highlights

  • API Migration: Removed deprecated handwritten Bigtable admin classes (AdminClient, TableAdmin, InstanceAdmin, InstanceAdminClient) in favor of the new generated APIs.
  • Codebase Updates: Updated all relevant tests, samples, and build configurations (CMakeLists.txt, bzl files) to utilize the newly generated admin client libraries.
  • Documentation: The v3-migration-guide.md has been updated with new code examples and guidance for migrating to the generated admin APIs, including changes to WaitForConsistency which is now a free function.
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 is a significant and well-executed effort to remove deprecated, handwritten Bigtable admin classes in favor of the modern, generated client APIs. The changes are extensive, touching documentation, build files, examples, and tests, and they correctly adapt the codebase to the new API patterns. My review focused on the correctness of this migration. I've identified a few opportunities to improve the migration guide to enhance clarity for users transitioning to the new APIs. Overall, this is a solid contribution that modernizes the Bigtable client library.

google::bigtable::admin::v2::CheckConsistencyRequest wait_request;
wait_request.set_name(table_name);
wait_request.set_consistency_token(token->consistency_token());
auto wait_response = table_admin.WaitForConsistency(wait_request).get();

Choose a reason for hiding this comment

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

medium

The example for WaitForConsistency is a bit too brief. It retrieves the StatusOr from the future but doesn't demonstrate how to handle potential errors or use the result. Providing a more complete example would be beneficial for users migrating their code.

Suggested change
auto wait_response = table_admin.WaitForConsistency(wait_request).get();
auto wait_future = table_admin.WaitForConsistency(wait_request);
auto wait_response = wait_future.get();
if (!wait_response) throw std::runtime_error(wait_response.status().message());
// The table is now consistent.

**After:**

```cpp
#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h"

Choose a reason for hiding this comment

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

medium

The example uses InstanceName, which is defined in google/cloud/bigtable/resource_names.h. This header should be included to ensure the code snippet is complete and compiles for users who copy it.

Suggested change
#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h"
#include "google/cloud/bigtable/admin/bigtable_instance_admin_client.h"
#include "google/cloud/bigtable/resource_names.h"

Comment on lines +600 to +601
auto clusters = instance_admin->ListClusters(
InstanceName("project-id", "instance-id"));

Choose a reason for hiding this comment

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

medium

The example for ListClusters is a bit brief. Since ListClusters returns a StatusOr, it would be more helpful for users to see how to handle the status and iterate over the results.

Suggested change
auto clusters = instance_admin->ListClusters(
InstanceName("project-id", "instance-id"));
auto clusters = instance_admin->ListClusters(
InstanceName("project-id", "instance-id"));
if (!clusters) throw std::runtime_error(clusters.status().message());
for (auto const& c : clusters->clusters()) {
std::cout << c.name() << "\n";
}

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.79%. Comparing base (8b8506e) to head (3b637d2).

Additional details and impacted files
@@                  Coverage Diff                   @@
##           prepare-for-v3.0.0   #15920      +/-   ##
======================================================
- Coverage               92.86%   92.79%   -0.07%     
======================================================
  Files                    2343     2332      -11     
  Lines                  216218   214346    -1872     
======================================================
- Hits                   200795   198910    -1885     
- Misses                  15423    15436      +13     

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

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.

1 participant