Skip to content

Conversation

@askpt
Copy link
Member

@askpt askpt commented Oct 27, 2025

Signed-off-by: André Silva [email protected]

This PR

This pull request adds support for tracking events in the MultiProvider feature flag provider, allowing tracking events to be propagated to underlying providers according to a customizable strategy. It introduces a new Track method, provides robust error handling and logging, and adds comprehensive unit tests to verify tracking behavior under various scenarios.

Tracking event support

  • Added a Track method to MultiProvider that propagates tracking events to all eligible underlying providers, with error handling and logging for invalid event names and provider exceptions.
  • Implemented the ShouldTrackWithThisProvider method in BaseEvaluationStrategy to allow strategies to control which providers receive tracking events (defaulting to providers with Ready status).

Logging improvements

  • Added new logger message methods to MultiProvider for tracking event errors and empty event names.

Testing and utilities

  • Added a new test suite MultiProviderTrackingTests covering scenarios such as multiple providers, exception handling, invalid event names, custom strategies, and propagation of complex tracking details.
  • Enhanced the TestProvider utility to record tracking invocations for assertions in tests. [1] [2] [3] [4]

Related Issues

Fixes #550

@askpt askpt changed the base branch from askpt/issue610 to main October 27, 2025 16:17
@askpt askpt requested a review from Copilot October 27, 2025 16:20
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.94%. Comparing base (c987b58) to head (51e7adb).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 Track method to MultiProvider with validation, error handling, and strategy-based provider filtering
  • Introduced ShouldTrackWithThisProvider method in BaseEvaluationStrategy to 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.

@askpt
Copy link
Member Author

askpt commented Oct 27, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@askpt askpt marked this pull request as ready for review October 29, 2025 17:11
@askpt askpt requested a review from a team as a code owner October 29, 2025 17:11
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.

[FEATURE] Add tracking support to the multi-provider

3 participants