Skip to content

feat: support isolated API instances#171

Merged
toddbaert merged 3 commits into
open-feature:mainfrom
marcozabel:feat/isolated-api-instances
Jun 10, 2026
Merged

feat: support isolated API instances#171
toddbaert merged 3 commits into
open-feature:mainfrom
marcozabel:feat/isolated-api-instances

Conversation

@marcozabel

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

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

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

@marcozabel marcozabel force-pushed the feat/isolated-api-instances branch from de7631e to 08c9cbd Compare April 16, 2026 13:09

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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
Comment thread src/isolated/OpenFeatureAPIFactory.php
@toddbaert toddbaert force-pushed the feat/isolated-api-instances branch from b032f86 to f4fbddb Compare June 9, 2026 17:21
@toddbaert

Copy link
Copy Markdown
Member

Hey @marcozabel; pushed a fixup adding @experimental PHPDoc tags on the new isolated factory class and method (per spec 1.8 marker; new surface only). CI is green.

marcozabel and others added 3 commits June 9, 2026 14:10
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>
@toddbaert toddbaert force-pushed the feat/isolated-api-instances branch from f4fbddb to b1da28c Compare June 9, 2026 18:10
@toddbaert toddbaert merged commit 48301ee into open-feature:main Jun 10, 2026
10 checks passed
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

4 participants