feat: support isolated API instances#171
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
============================================
+ Coverage 95.19% 96.81% +1.62%
- Complexity 227 336 +109
============================================
Files 40 50 +10
Lines 583 849 +266
============================================
+ Hits 555 822 +267
+ Misses 28 27 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
de7631e to
08c9cbd
Compare
There was a problem hiding this comment.
Code Review
This pull request implements isolated OpenFeature API instances by changing the OpenFeatureAPI constructor to public and introducing a new OpenFeatureAPIFactory. This allows for independent API instances with their own providers, hooks, and contexts, fulfilling specification requirements. Feedback was provided regarding the unit tests, which currently interact with the global singleton; it is recommended to use multiple isolated instances in these tests to prevent global state pollution and potential test flakiness.
b032f86 to
f4fbddb
Compare
|
Hey @marcozabel; pushed a fixup adding |
Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
f4fbddb to
b1da28c
Compare
This PR
This PR introduces support for creating isolated OpenFeature API instances, each with their own providers, hooks, context, and event handling - enabling multi-tenant or side-by-side usage without shared global state.
Related Issues
Fixes #170
Notes
Follow-up Tasks
How to test