Skip to content

Conversation

@hanshu-G
Copy link

Add features for supporting Directpath. This includes

  • Expose an env var called CBT_ENABLE_DIRECTPATH and remove the GOOGLE_CLOUD_ENABLE_DIRECT_PATH in client to turn on Directpath
  • If CBT_ENABLE_DIRECTPATH is set, use c2p::// prefix for DataEndpoint.
  • Remove GrpcNumChannelsOption set being to 1
  • If env var is set, attach traffic_director_enabled and direct_access_requested in the feature flags.

	modified:   google/cloud/bigtable/internal/defaults.cc
	modified:   google/cloud/bigtable/internal/defaults.cc
	modified:   google/cloud/bigtable/internal/defaults_test.cc
	modified:   google/cloud/bigtable/internal/defaults.cc
	modified:   google/cloud/bigtable/internal/defaults_test.cc
@hanshu-G hanshu-G requested a review from a team as a code owner January 14, 2026 22:12
@gemini-code-assist
Copy link

Summary of Changes

Hello @hanshu-G, 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 refactors the client-side configuration for enabling and utilizing Directpath with Bigtable. The changes streamline the activation process through a dedicated environment variable, simplify the data endpoint URL, and remove redundant gRPC channel settings, aligning the client's behavior more closely with gRPC's native Directpath capabilities. These updates aim to improve clarity and efficiency in how Directpath is configured and communicated to the Bigtable service.

Highlights

  • Directpath Activation: The mechanism for enabling Directpath has been updated. It now uses a new environment variable, CBT_ENABLE_DIRECTPATH, which accepts 'true' or '1' to activate Directpath, replacing the previous GOOGLE_CLOUD_ENABLE_DIRECT_PATH variable and its comma-separated value parsing.
  • Data Endpoint Configuration: When Directpath is enabled, the DataEndpointOption is now set to c2p://bigtable.googleapis.com, simplifying the endpoint specification compared to the previous google-c2p:///directpath-bigtable.googleapis.com.
  • gRPC Channel Management: The explicit setting of GrpcNumChannelsOption to 1 when Directpath is active has been removed. This change acknowledges that gRPC's internal load balancing handles channel management effectively with Directpath, making the client-side override unnecessary.
  • Feature Flag Updates: The FeaturesMetadata() function now conditionally sets traffic_director_enabled and direct_access_requested to true in the FeatureFlags proto when CBT_ENABLE_DIRECTPATH is active, ensuring proper signaling to the Bigtable service.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 support for DirectPath in Bigtable by introducing a new environment variable and updating feature flags and connection options. The changes are generally good, but I've found a few issues: significant code duplication that violates the repository's style guide, a stale comment that could cause confusion, and a test assertion that is now incorrect due to the changes. I've provided suggestions to address these points.

	modified:   google/cloud/bigtable/internal/defaults.cc
	modified:   google/cloud/bigtable/internal/defaults_test.cc
@hanshu-G hanshu-G changed the title Support Directpath in Bigtable feat(bigtable): Add DirectPath support via env var Jan 14, 2026
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Jan 15, 2026
@sushanb
Copy link

sushanb commented Jan 15, 2026

/gcbrun

	modified:   google/cloud/bigtable/internal/defaults.cc
	modified:   google/cloud/bigtable/internal/defaults.h
	modified:   google/cloud/bigtable/internal/defaults_test.cc
@hanshu-G
Copy link
Author

/gcbrun

@diegomarquezp
Copy link
Collaborator

/gcbrun

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.96%. Comparing base (113d8fa) to head (0044ce1).

Files with missing lines Patch % Lines
...e/cloud/bigtable/internal/bigtable_stub_factory.cc 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15884      +/-   ##
==========================================
- Coverage   92.96%   92.96%   -0.01%     
==========================================
  Files        2460     2460              
  Lines      228595   228598       +3     
==========================================
+ Hits       212504   212505       +1     
- Misses      16091    16093       +2     

☔ 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

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants