-
Notifications
You must be signed in to change notification settings - Fork 0
Implement filter configuration system #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
1 similar comment
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
1 similar comment
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
2 similar comments
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
da8fbb3 to
fdc7082
Compare
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
1 similar comment
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
| } | ||
|
|
||
| mcp_json_value_t createTypedConfigChain() { | ||
| // Create chain with typed_config style (Envoy-like) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never commit this type of key word, they should not be in our code history, please do these:
- backup branch
- hard reset the commit before this
- remove keyword
- cherry-pick later commits from backup branch.
| #Find packages | ||
| find_package(Threads REQUIRED) | ||
| find_package(OpenSSL REQUIRED) | ||
| find_package(yaml-cpp REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fallback to auto-install (e.g. refer to other FetchContent_Declare) if pre-installed is not available.
-- gopher-mcp: Building as standalone project
CMake Error at CMakeLists.txt:128 (find_package):
By not providing "Findyaml-cpp.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "yaml-cpp",
but CMake did not find one.
Could not find a package configuration file provided by "yaml-cpp" with any
of the following names:
yaml-cppConfig.cmake
yaml-cpp-config.cmake
Add the installation prefix of "yaml-cpp" to CMAKE_PREFIX_PATH or set
"yaml-cpp_DIR" to a directory containing one of the above files. If
"yaml-cpp" provides a separate development package or SDK, be sure it has
been installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing this
dab9e29 to
3f57e81
Compare
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
3 similar comments
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
- Check for duplicate filter chain names during validation - Include precise array indices in error messages - Improve transport reference error paths
- Cast chars to unsigned char for isalnum/isdigit - Prevents UB with non-ASCII or negative char values
- Wrap all j.get<>() calls with try-catch blocks - Provide precise field paths in error messages - Handle nested object parsing errors properly - Add error context for parseJsonSize and parseJsonDuration calls
Remove incorrect dereference operators when assigning to BootstrapConfig's node and admin members which are values, not pointers
- Use WithValidation types to enforce unknown field policy - Add validation context to parseConfiguration method - Check for unknown fields at root level - Report unknown fields based on STRICT/WARN/PERMISSIVE policy
- Copy listeners to local vector before invoking callbacks - Release mutex before calling listener functions - Prevents deadlocks and blocking on slow callbacks
Add fmt::fmt to mcp_example_client, mcp_example_server, and mcp_config_example_server for circuit breaker filter logging.
Implement Koffi-based FFI bindings for circuit breaker callback registration. Add CircuitBreakerCallbacks class with type-safe callback registration.
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
Add setCircuitBreakerCallbacks, clearCircuitBreakerCallbacks, and hasCircuitBreakerCallbacks methods to UnifiedFilterChain wrapper.
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
Change MetricsFilter constructor to accept shared_ptr<MetricsCallbacks> instead of reference, add setCallbacks() method for runtime updates, implement automatic metrics reporting via maybeReportMetrics(), complete updateSendRate() implementation, and add NullMetricsCallbacks pattern for safe operation.
Update filter factories, application base, and server to use shared_ptr<MetricsCallbacks> API. Add debug logging to filter registry.
Fix const-correctness for string view parameters in JSON bridge implementation.
Update filter_configurations example and metrics filter unit tests to use shared_ptr<MetricsCallbacks> API.
Implement C API bridge for metrics filter callbacks with mcp_filter_chain_set_metrics_callbacks(), mcp_filter_chain_clear_metrics_callbacks(), and mcp_filter_chain_has_metrics_callbacks(). Add mcp_connection_metrics_t struct for FFI-safe metrics transfer and MetricsCallbackBridge for C-to-C++ callback translation.
Extend AdvancedFilterChain with metrics callback management: - Add setMetricsCallbacks() to register callbacks - Add clearMetricsCallbacks() to unregister callbacks - Add hasMetricsCallbacks() to check registration status - Add applyMetricsCallbacksToFilters() for runtime updates - Ensure thread-safe dispatcher-based callback application
…102) Update circuit breaker callback handling to use AdvancedFilterChain: - Refactor to use consistent callback management pattern - Ensure uniform approach across all filter callback types - Improve code consistency and maintainability
Add TypeScript type definitions for metrics monitoring: - Add MetricsSnapshot interface for metrics data - Add MetricsThresholdEvent interface for threshold alerts - Add MetricsCallbacks interface for callback bundle - Export types from types/index.ts
Add Koffi bindings for metrics callback C API: - Define mcp_connection_metrics_t struct with unique naming - Add FFI function declarations for metrics callback API - Implement BigInt to number conversion with safe clamping - Support mcp_filter_chain_set/clear/has_metrics_callbacks
Implement metrics callback registration and lifecycle management: - Add registerMetricsCallbacks() with Koffi callback wrapping - Add unregisterMetricsCallbacks() with proper cleanup - Add MetricsCallbackHandle for callback lifecycle management - Implement error handling via onError callback - Export functions from index.ts
Add getChainHandle() method to GopherFilteredTransport: - Enable access to underlying filter chain for callback registration - Support metrics callback registration on transport instances - Maintain encapsulation while providing necessary access
Add metrics filter configuration to calculator-hybrid example: - Configure metrics filter with 10 second reporting interval - Enable metrics collection for example application - Prepare configuration for metrics callback integration
Add metrics callback integration to calculator-hybrid server: - Register metrics callbacks on transport instance - Add formatted metrics output with timestamps - Implement error handling for metrics events - Demonstrate real-time metrics monitoring usage
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
❌ Code Formatting Check FailedSome files in this PR are not properly formatted according to the project's clang-format rules. To fix this issue: make formatThen commit and push the changes. |
Implements #102 - File-based configuration system
This PR introduces the foundational configuration infrastructure required for the configuration-driven filter architecture. The implementation provides type-safe configuration structures with comprehensive validation and human-friendly error messages.
Typescript Calculator Server using official TS SDK + Gopher native filters