Skip to content

feat(bigtable): preserve base64 padding on bigtable-features header#16108

Merged
scotthart merged 1 commit into
googleapis:mainfrom
elinorli:encoding
May 19, 2026
Merged

feat(bigtable): preserve base64 padding on bigtable-features header#16108
scotthart merged 1 commit into
googleapis:mainfrom
elinorli:encoding

Conversation

@elinorli
Copy link
Copy Markdown
Contributor

Go's conformant base64.URLEncoding.DecodeString requires base64 padding (=) to decode successfully, failing with status 16 when padding is missing.

To resolve this, introduce UrlsafeBase64EncodeWithPadding helper that preserves base64 padding and use it to encode features metadata in the bigtable stub factory.

@elinorli elinorli requested a review from a team as a code owner May 19, 2026 17:44
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label May 19, 2026
Copy link
Copy Markdown

@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 introduces a new utility function, UrlsafeBase64EncodeWithPadding, in the base64_transforms header and updates the Bigtable stub factory to use this version for features metadata, accompanied by a new unit test. The review suggests refactoring the duplicated logic between the two encoding functions to improve maintainability and recommends caching the features metadata result using a static variable to avoid redundant computations.

Comment thread google/cloud/internal/base64_transforms.h Outdated
Comment thread google/cloud/bigtable/internal/bigtable_stub_factory.cc
Go's conformant `base64.URLEncoding.DecodeString` requires base64
padding (`=`) to decode successfully, failing with status 16 when
padding is missing.

To resolve this, introduce `UrlsafeBase64EncodeWithPadding` helper that
preserves base64 padding and use it to encode features metadata in the
bigtable stub factory.
@scotthart scotthart enabled auto-merge (squash) May 19, 2026 18:50
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.71%. Comparing base (1735f56) to head (2945014).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16108   +/-   ##
=======================================
  Coverage   92.71%   92.71%           
=======================================
  Files        2353     2353           
  Lines      218692   218700    +8     
=======================================
+ Hits       202764   202777   +13     
+ Misses      15928    15923    -5     

☔ 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 2e81b11 into googleapis:main May 19, 2026
53 of 59 checks passed
@elinorli elinorli deleted the encoding branch May 19, 2026 20:20
elinorli added a commit to elinorli/google-cloud-cpp that referenced this pull request May 19, 2026
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.

2 participants