Skip to content

http: migrate grpc_field_extraction/grpc... to exception free#46036

Open
wbpcode wants to merge 3 commits into
envoyproxy:mainfrom
wbpcode:dev-make-http-exception-free-4
Open

http: migrate grpc_field_extraction/grpc... to exception free#46036
wbpcode wants to merge 3 commits into
envoyproxy:mainfrom
wbpcode:dev-make-http-exception-free-4

Conversation

@wbpcode

@wbpcode wbpcode commented Jul 8, 2026

Copy link
Copy Markdown
Member

Commit Message: http: migrate grpc_field_extraction/grpc... to exception free
Additional Description:
Migrate exceptions of these filters to absl::Status and absl::StatusOr.

NOTE: This is AI assisted. But I reviewed all the changes and tests, and also did some manually update.

Risk Level: low.
Testing: unit/integration.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.

Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>

Copilot AI 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.

Pull request overview

This PR migrates several gRPC-related HTTP filters (gRPC JSON transcoder, reverse transcoder, field extraction, and gRPC HTTP/1 bridges) from exception-based construction/validation to exception-free patterns using absl::Status / absl::StatusOr, aligning them with Envoy’s exception-free factory interfaces.

Changes:

  • Convert filter factories to ExceptionFreeFactoryBase and return absl::StatusOr<Http::FilterFactoryCb>.
  • Refactor filter/config constructors to report initialization failures via absl::Status& instead of throwing.
  • Update affected unit tests to assert on returned absl::Status (via StatusHelpers::HasStatus) rather than exceptions.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc Updates config-parse and filter tests to validate failures via absl::Status instead of exceptions; adds helper utilities.
test/extensions/filters/http/grpc_json_transcoder/BUILD Adds status_utility_lib dependency for new status matchers/macros.
test/extensions/filters/http/grpc_json_reverse_transcoder/filter_test.cc Updates reverse transcoder tests to construct config with absl::Status& and assert on status results.
test/extensions/filters/http/grpc_json_reverse_transcoder/config_test.cc Updates factory validation tests to check StatusOr::ok() instead of expecting exceptions.
test/extensions/filters/http/grpc_json_reverse_transcoder/BUILD Adds status_utility_lib dependency for status matchers.
test/extensions/filters/http/grpc_field_extraction/filter_test.cc Updates filter test fixture to construct FilterConfig with absl::Status& and assert success.
test/extensions/filters/http/grpc_field_extraction/filter_config_test.cc Refactors config tests to validate creation errors via absl::Status matchers instead of exceptions.
test/extensions/filters/http/grpc_field_extraction/BUILD Adds status_utility_lib dependency for status matchers.
source/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter.h Updates JsonTranscoderConfig constructor and helper methods to be status-returning / exception-free.
source/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter.cc Implements exception-free error propagation in JsonTranscoderConfig and descriptor helpers.
source/extensions/filters/http/grpc_json_transcoder/config.h Migrates factory to ExceptionFreeFactoryBase and returns absl::StatusOr callbacks.
source/extensions/filters/http/grpc_json_transcoder/config.cc Propagates config-construction failures via absl::Status in factory methods.
source/extensions/filters/http/grpc_json_reverse_transcoder/filter_config.h Updates GrpcJsonReverseTranscoderConfig constructor to take absl::Status&.
source/extensions/filters/http/grpc_json_reverse_transcoder/filter_config.cc Implements exception-free error reporting for descriptor parsing/pool creation.
source/extensions/filters/http/grpc_json_reverse_transcoder/config.h Migrates factory to ExceptionFreeFactoryBase and returns absl::StatusOr callbacks.
source/extensions/filters/http/grpc_json_reverse_transcoder/config.cc Propagates config-construction failures via absl::Status in factory methods.
source/extensions/filters/http/grpc_http1_reverse_bridge/config.h Migrates factory to ExceptionFreeFactoryBase and returns absl::StatusOr callback.
source/extensions/filters/http/grpc_http1_reverse_bridge/config.cc Updates factory method signature to return absl::StatusOr<Http::FilterFactoryCb>.
source/extensions/filters/http/grpc_http1_bridge/config.h Migrates factory to ExceptionFreeFactoryBase and returns absl::StatusOr callback.
source/extensions/filters/http/grpc_http1_bridge/config.cc Updates factory method signature to return absl::StatusOr<Http::FilterFactoryCb>.
source/extensions/filters/http/grpc_field_extraction/filter_config.h Updates FilterConfig constructor and init helpers to report failures via absl::Status.
source/extensions/filters/http/grpc_field_extraction/filter_config.cc Implements exception-free init paths and status returns for descriptor/extractor initialization.
source/extensions/filters/http/grpc_field_extraction/config.h Migrates factory to ExceptionFreeFactoryBase and returns absl::StatusOr callback.
source/extensions/filters/http/grpc_field_extraction/config.cc Propagates FilterConfig construction failures via absl::Status in factory methods.

@wbpcode

wbpcode commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/coverage

@repokitteh-read-only

Copy link
Copy Markdown

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-cncf-pr/46036/coverage/index.html

For comparison, current coverage on main branch is here:

https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html

The coverage results are (re-)rendered each time the CI Envoy/Checks (coverage) job completes.

🐱

Caused by: a #46036 (comment) was created by @wbpcode.

see: more, trace.

wbpcode added 2 commits July 9, 2026 14:18
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
@wbpcode

wbpcode commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/retest

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.

2 participants