Skip to content

feat: support isolated API instances#171

Open
marcozabel wants to merge 2 commits intoopen-feature:mainfrom
marcozabel:feat/isolated-api-instances
Open

feat: support isolated API instances#171
marcozabel wants to merge 2 commits intoopen-feature:mainfrom
marcozabel:feat/isolated-api-instances

Conversation

@marcozabel
Copy link
Copy Markdown

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

@marcozabel marcozabel requested a review from tcarrio as a code owner April 16, 2026 13:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.04%. Comparing base (2123274) to head (07aa1f2).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #171      +/-   ##
============================================
+ Coverage     95.19%   97.04%   +1.84%     
- Complexity      227      229       +2     
============================================
  Files            40       41       +1     
  Lines           583      575       -8     
============================================
+ Hits            555      558       +3     
+ Misses           28       17      -11     

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

Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
@marcozabel marcozabel force-pushed the feat/isolated-api-instances branch from de7631e to 08c9cbd Compare April 16, 2026 13:09
Copy link
Copy Markdown

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

Comment thread tests/unit/IsolatedAPITest.php
Comment thread tests/unit/IsolatedAPITest.php
Comment thread tests/unit/IsolatedAPITest.php
Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
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.

Support isolated API instances

2 participants