Skip to content

Conversation

askpt
Copy link
Member

@askpt askpt commented Jun 6, 2025

This PR

This pull request introduces the experimental "Multi-Provider" feature to the OpenFeature library, enabling simultaneous use of multiple feature flag providers with configurable evaluation strategies. The changes include updates to documentation, new classes and methods to support multi-provider functionality, and a sample implementation in AspNetCore. Below is a summary of the most important changes grouped by theme.

Documentation Updates:

  • Added "Multi-Provider" to the feature list in README.md, marking it as experimental.
  • Included a detailed section in README.md explaining the usage, evaluation strategies, modes, and limitations of the Multi-Provider feature.

Sample Implementation:

  • Updated samples/AspNetCore/Program.cs to demonstrate Multi-Provider usage, including flag evaluation and error handling. [1] [2]

Core Multi-Provider Functionality:

  • Introduced the MultiProvider class in src/OpenFeature/Providers/MultiProvider/MultiProvider.cs, implementing support for multiple providers, evaluation strategies, initialization, and shutdown logic.
  • Added the ProviderEntry class to represent individual providers in the Multi-Provider configuration.

Supporting Models and Extensions:

  • Created ProviderStatus and RegisteredProvider models to track provider states and metadata. [1] [2]
  • Added ProviderExtensions to handle evaluation logic for individual providers.

Related Issues

Fixes #487

Notes

I didn't do proper testing for Hooks and Events. This PR is already quite big, and I would appreciate some feedback on the overall design.

Follow-up Tasks

  • Add Hooks and Events support for Multi-Provider.
  • Add Dependency Injection support.

How to test

Open the samples app and enjoy!

askpt added 13 commits June 5, 2025 16:42
…provider feature flag evaluation

Signed-off-by: André Silva <[email protected]>
…Strategy classes for feature flag evaluation

Signed-off-by: André Silva <[email protected]>
…pecific feature resolution

Signed-off-by: André Silva <[email protected]>
…ulti-type feature resolution

Signed-off-by: André Silva <[email protected]>
…hod for improved multi-provider support

Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…gy to enhance multi-provider support

Signed-off-by: André Silva <[email protected]>
…date multi-provider functionality

Signed-off-by: André Silva <[email protected]>
@askpt askpt linked an issue Jun 6, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

❌ Patch coverage is 95.82310% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (417f3fe) to head (bfeab28).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...enFeature/Providers/MultiProvider/MultiProvider.cs 95.91% 5 Missing and 3 partials ⚠️
...MultiProvider/Strategies/BaseEvaluationStrategy.cs 85.36% 2 Missing and 4 partials ⚠️
...ture/Providers/MultiProvider/ProviderExtensions.cs 92.00% 0 Missing and 2 partials ⚠️
...er/Strategies/Models/StrategyPerProviderContext.cs 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
+ Coverage   88.48%   89.67%   +1.18%     
==========================================
  Files          50       64      +14     
  Lines        2102     2509     +407     
  Branches      245      296      +51     
==========================================
+ Hits         1860     2250     +390     
- Misses        191      199       +8     
- Partials       51       60       +9     

☔ 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.

@toddbaert toddbaert self-requested a review June 19, 2025 12:57
@sergheevxo
Copy link

Do you have any idea when this will be implemented in the NuGet package?

@askpt
Copy link
Member Author

askpt commented Jun 25, 2025

Do you have any idea when this will be implemented in the NuGet package?

@sergheevxo I am actively working on #338, and this feature is next on my list.

askpt added 5 commits July 31, 2025 17:14
… and add corresponding tests

Signed-off-by: André Silva <[email protected]>
…te location in ComparisonStrategy

Signed-off-by: André Silva <[email protected]>
# Conflicts:
#	samples/AspNetCore/Program.cs
…ect async initialization and shutdown

Signed-off-by: André Silva <[email protected]>
Copy link
Contributor

@chrfwow chrfwow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀

@askpt
Copy link
Member Author

askpt commented Aug 4, 2025

@arttonoyan Could you please have another look into this PR?

@askpt askpt requested a review from arttonoyan August 6, 2025 15:07
@askpt askpt force-pushed the askpt/487-add-multi-provider-support branch from cce748e to 003e343 Compare August 6, 2025 15:12
@toddbaert toddbaert self-requested a review August 12, 2025 15:58
@askpt askpt added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit 7237053 Aug 12, 2025
17 checks passed
@askpt askpt deleted the askpt/487-add-multi-provider-support branch August 23, 2025 14:37
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.

Add multi-provider support
7 participants