-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Add tracking to multi-provider #612
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #612 +/- ##
==========================================
+ Coverage 89.84% 89.94% +0.09%
==========================================
Files 77 77
Lines 3162 3192 +30
Branches 364 368 +4
==========================================
+ Hits 2841 2871 +30
Misses 251 251
Partials 70 70 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR adds tracking event support to the MultiProvider, enabling it to propagate tracking events to underlying providers based on a customizable strategy. The implementation includes error handling, logging for edge cases, and comprehensive test coverage.
Key Changes:
- Added
Trackmethod toMultiProviderwith validation, error handling, and strategy-based provider filtering - Introduced
ShouldTrackWithThisProvidermethod inBaseEvaluationStrategyto control tracking propagation (defaults to Ready providers) - Enhanced test utilities and added extensive test suite covering multiple scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| MultiProvider.cs | Implements the Track method with validation, disposal checks, strategy-based filtering, and exception handling |
| BaseEvaluationStrategy.cs | Adds virtual method to determine which providers should receive tracking events |
| TestProvider.cs | Extends test provider with tracking invocation recording and provider event simulation capabilities |
| MultiProviderTrackingTests.cs | Comprehensive test suite covering tracking scenarios including multiple providers, exceptions, custom strategies, and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
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.
Code Review
This pull request effectively adds tracking support to the MultiProvider, including a flexible strategy-based propagation of tracking events, robust error handling, and comprehensive tests. The code is well-structured and the changes are clear. I have one suggestion to improve the visibility of tracking errors by adjusting the log level.
…ategy Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…types Signed-off-by: André Silva <[email protected]>
… simulation Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…id tracking event name Signed-off-by: André Silva <[email protected]>
… flexibility Signed-off-by: André Silva <[email protected]>
…ider Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva [email protected]
This PR
This pull request adds support for tracking events in the
MultiProviderfeature flag provider, allowing tracking events to be propagated to underlying providers according to a customizable strategy. It introduces a newTrackmethod, provides robust error handling and logging, and adds comprehensive unit tests to verify tracking behavior under various scenarios.Tracking event support
Trackmethod toMultiProviderthat propagates tracking events to all eligible underlying providers, with error handling and logging for invalid event names and provider exceptions.ShouldTrackWithThisProvidermethod inBaseEvaluationStrategyto allow strategies to control which providers receive tracking events (defaulting to providers withReadystatus).Logging improvements
MultiProviderfor tracking event errors and empty event names.Testing and utilities
MultiProviderTrackingTestscovering scenarios such as multiple providers, exception handling, invalid event names, custom strategies, and propagation of complex tracking details.TestProviderutility to record tracking invocations for assertions in tests. [1] [2] [3] [4]Related Issues
Fixes #550