Skip to content

chore: migrate from deprecated absl types to std equivalents - #16400

Open
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:chore_absl_deprecated_to_std
Open

chore: migrate from deprecated absl types to std equivalents#16400
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:chore_absl_deprecated_to_std

Conversation

@scotthart

@scotthart scotthart commented Aug 27, 2026

Copy link
Copy Markdown
Member

fixes #16354

@scotthart
scotthart requested review from a team as code owners August 27, 2026 23:21

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 migrates various Abseil utilities (such as absl::variant, absl::visit, absl::holds_alternative, absl::get, absl::conjunction, absl::disjunction, and absl::void_t) to their standard C++17 library equivalents (std::variant, std::visit, etc.) across the codebase. The review feedback identifies a potential compilation failure in default_row_reader.cc due to mismatched return types, an unused Abseil header in list_objects_and_prefixes_reader.h, and a missed migration from absl::optional to std::optional in validate_metadata.cc.

while (true) {
auto variant = AdvanceOrFail();
if (absl::holds_alternative<bigtable::Row>(variant)) {
if (std::holds_alternative<bigtable::Row>(variant)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The return type of DefaultRowReader::Advance() (and potentially AdvanceOrFail()) still appears to be absl::variant (as seen in the hunk header). If AdvanceOrFail() returns absl::variant, using std::holds_alternative and std::get on it will fail to compile. Please ensure that the return types of both Advance() and AdvanceOrFail() are also migrated to std::variant in the corresponding header and source files to fully adhere to the style guide.

References
  1. Use std::variant instead of absl::variant. (link)

#include "absl/types/variant.h"
#include <iterator>
#include <string>
#include <variant>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since absl::visit has been migrated to std::visit in this file, the #include "absl/types/variant.h" on line 20 is likely no longer needed and should be removed to keep the includes clean.

References
  1. Use std::variant instead of absl::variant. (link)

template <typename T>
struct GetAuthorityImpl<
T, absl::void_t<decltype(std::declval<T>().ExperimentalGetAuthority())>> {
T, std::void_t<decltype(std::declval<T>().ExperimentalGetAuthority())>> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

On the next line, absl::optional<std::string> is still used as the return type for Get. Please migrate it to std::optional<std::string> to adhere to the repository style guide.

References
  1. Use std::optional instead of absl::optional. (link)

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.26%. Comparing base (80d2a81) to head (1826c0b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...torage/internal/async/writer_connection_resumed.cc 80.00% 2 Missing ⚠️
generator/internal/http_option_utils.cc 80.00% 1 Missing ⚠️
...orage/internal/async/writer_connection_buffered.cc 92.30% 1 Missing ⚠️
...d/storage/internal/async/writer_connection_impl.cc 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16400      +/-   ##
==========================================
- Coverage   92.26%   92.26%   -0.01%     
==========================================
  Files        2246     2246              
  Lines      212121   212121              
==========================================
- Hits       195721   195705      -16     
- Misses      16400    16416      +16     

☔ View full report in Codecov by Harness.
📢 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.

Deprecation warnings with Abseil 20260526.0 cause build failures with -Werror

1 participant