http: migrate local_ratelimit/mcp/... to exception free#46038
Open
wbpcode wants to merge 2 commits into
Open
Conversation
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates several HTTP filter config factories and config construction paths from exception-based error handling to exception-free absl::Status/absl::StatusOr, aligning these extensions with Envoy’s exception-free factory infrastructure.
Changes:
- Converted OnDemand, local rate limit, MCP, MCP router, and original_src factories to
Common::ExceptionFreeFactoryBaseand updated factory methods to returnabsl::StatusOr<Http::FilterFactoryCb>. - Reworked
OnDemandFilterConfigandLocalRateLimitFilter::FilterConfigconstruction to report validation/configuration failures viaabsl::Statusinstead of throwingEnvoyException. - Updated affected unit tests and BUILD deps to validate failures via status matchers (and added
status_utilitydeps where needed).
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/extensions/filters/http/on_demand/on_demand_filter_test.cc | Updates config-construction test expectations to use absl::Status + HasStatus. |
| test/extensions/filters/http/on_demand/BUILD | Adds status_utility dependency for updated tests. |
| test/extensions/filters/http/local_ratelimit/filter_test.cc | Switches test config construction to capture and assert creation_status. |
| test/extensions/filters/http/local_ratelimit/config_test.cc | Replaces exception-based assertions with status-based assertions/matchers. |
| test/extensions/filters/http/local_ratelimit/BUILD | Adds status_utility dependency for updated tests. |
| source/extensions/filters/http/original_src/original_src_config_factory.h | Converts factory to exception-free base and status-returning factory method. |
| source/extensions/filters/http/original_src/original_src_config_factory.cc | Updates factory method return type to absl::StatusOr. |
| source/extensions/filters/http/on_demand/on_demand_update.h | Adds absl::Status& creation_status to config constructors. |
| source/extensions/filters/http/on_demand/on_demand_update.cc | Converts internal helper to StatusOr and plumbs status out of config constructors. |
| source/extensions/filters/http/on_demand/config.h | Converts factory to exception-free base and status-returning methods. |
| source/extensions/filters/http/on_demand/config.cc | Checks creation_status after config construction and returns non-OK status. |
| source/extensions/filters/http/mcp/config.h | Converts factory to exception-free base and status-returning methods. |
| source/extensions/filters/http/mcp/config.cc | Updates factory method return type to absl::StatusOr. |
| source/extensions/filters/http/mcp_router/config.h | Converts factory to exception-free base and status-returning factory method. |
| source/extensions/filters/http/mcp_router/config.cc | Updates factory method return type to absl::StatusOr. |
| source/extensions/filters/http/local_ratelimit/local_ratelimit.h | Adds absl::Status& creation_status to FilterConfig constructor. |
| source/extensions/filters/http/local_ratelimit/local_ratelimit.cc | Replaces throws with status-setting + early returns and plumbs creation failures. |
| source/extensions/filters/http/local_ratelimit/config.h | Converts factory to exception-free base and status-returning factory method. |
| source/extensions/filters/http/local_ratelimit/config.cc | Plumbs creation_status through filter config creation and returns errors via StatusOr. |
Member
Author
|
/coverage |
|
Coverage for this Pull Request will be rendered here: https://storage.googleapis.com/envoy-cncf-pr/46038/coverage/index.html For comparison, current coverage on https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html The coverage results are (re-)rendered each time the CI |
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: http: migrate local_ratelimit/mcp/... to exception free
Additional Description:
Migrate previous exceptions to absl::Status or absl::StatusOr.
Risk Level: low.
Testing: unit/integration.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.