Skip to content

http: migrate local_ratelimit/mcp/... to exception free#46038

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

http: migrate local_ratelimit/mcp/... to exception free#46038
wbpcode wants to merge 2 commits into
envoyproxy:mainfrom
wbpcode:dev-make-http-exception-free-6

Conversation

@wbpcode

@wbpcode wbpcode commented Jul 8, 2026

Copy link
Copy Markdown
Member

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.

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

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::ExceptionFreeFactoryBase and updated factory methods to return absl::StatusOr<Http::FilterFactoryCb>.
  • Reworked OnDemandFilterConfig and LocalRateLimitFilter::FilterConfig construction to report validation/configuration failures via absl::Status instead of throwing EnvoyException.
  • Updated affected unit tests and BUILD deps to validate failures via status matchers (and added status_utility deps 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.

Comment thread test/extensions/filters/http/local_ratelimit/config_test.cc Outdated
@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/46038/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 #46038 (comment) was created by @wbpcode.

see: more, trace.

Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.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.

2 participants