Skip to content

Use std::optional instead of absl::optional#45607

Merged
yanavlasov merged 1 commit into
envoyproxy:mainfrom
nezdolik:absl-opt-to-std-opt
Jun 25, 2026
Merged

Use std::optional instead of absl::optional#45607
yanavlasov merged 1 commit into
envoyproxy:mainfrom
nezdolik:absl-opt-to-std-opt

Conversation

@nezdolik

Copy link
Copy Markdown
Member

Abseil is deprecating absl::optional, so migrate Envoy's codebase to std::optional, std::nullopt, and std::make_optional.

Update the format checker to reject the deprecated Abseil optional APIs and header, and refresh the formatter test fixtures.

Codex/Ai assisted.

Commit Message:
Additional Description:
Risk Level: Low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

krinkinmu
krinkinmu previously approved these changes Jun 12, 2026

@krinkinmu krinkinmu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved for Istio

mathetake
mathetake previously approved these changes Jun 12, 2026
@yanavlasov

yanavlasov commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Wow thanks for slogging through this. I think we should lock main to get CI pass for this PR and then merge it. Otherwise merge conflicts will be wack-a-mole.

/wait-any

@yanavlasov

Copy link
Copy Markdown
Contributor

/wait-any

@nezdolik

Copy link
Copy Markdown
Member Author

PR for contrib: #45658

agrawroh
agrawroh previously approved these changes Jun 16, 2026
@botengyao

Copy link
Copy Markdown
Member

need to wait for the release, and address the merge conflicts.

/wait

@nezdolik

nezdolik commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@yanavlasov @botengyao here is resynced version after security release. Feel free to merge if all passes and looks good

@wbpcode

wbpcode commented Jun 24, 2026

Copy link
Copy Markdown
Member

😱 8000+

@yanavlasov

Copy link
Copy Markdown
Contributor

Oh, sorry, my PR with the function change caused merge conflicts and GH says it is too complex to resolve in web editor. I will hold off on checking exception refactors, so we can close on this one.

/wait

@yanavlasov

Copy link
Copy Markdown
Contributor

Also looks like mobile format is not happy. https://github.com/envoyproxy/envoy/actions/runs/28097997526/job/83192404353#step:21:772

Abseil has deprecated absl::optional in favor of the standard library optional type. Migrate Envoy sources and tests to std::optional, std::nullopt, and std::make_optional.

Update the format checker to reject the deprecated absl optional APIs and cover the diagnostics with check_format fixtures.

Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>
@nezdolik nezdolik force-pushed the absl-opt-to-std-opt branch from 62419e5 to e7ebaed Compare June 25, 2026 11:53
@nezdolik

Copy link
Copy Markdown
Member Author

rebased on top of latest main, fixed mobile format check, fingers crossed all passes now

@nezdolik

Copy link
Copy Markdown
Member Author

@yanavlasov ptal

@yanavlasov yanavlasov merged commit 8873877 into envoyproxy:main Jun 25, 2026
26 checks passed
bellatoris added a commit to bellatoris/envoy that referenced this pull request Jul 5, 2026
Conflicts were confined to the RESP3-extended client factory lineage and
resolved by adopting upstream envoyproxy#45607 std::optional/std::nullopt spelling
while keeping the RESP3 additions:
- ClientFactory/ClientImpl create + ctor signatures keep the appended
  upstream_protocol_version and OptRef<Stats::Counter> hello-failure
  params (OptRef args stay absl::nullopt per OptRef convention)
- ClientFactoryImpl::create keeps the unconditional initialize() (init
  routing moved inside ClientImpl by the RESP3 init state machine)
- proxy_filter.cc keeps both new includes: upstream <openssl/mem.h>
  (envoyproxy#45472 constant-time password compare) and RESP3 <algorithm>
- HEXPIRE (envoyproxy#44887) and cluster string_view (envoyproxy#45967) merged cleanly

Signed-off-by: Doogie Min <doogie.min@sendbird.com>
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.

7 participants