-
Notifications
You must be signed in to change notification settings - Fork 39
feat: implement Multi-Provider with parity fixes #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jonathannorris
wants to merge
16
commits into
main
Choose a base branch
from
feat/multi-provider-parity-568
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9a0c6ff
feat: implement Multi-Provider
vikasrao23 bb561a9
docs: clarify sequential implementation and planned async/parallel en…
vikasrao23 6601374
Address Gemini code review feedback
Vikky92 1befe9b
Address all remaining Gemini review comments
Vikky92 52bcc0b
Use Awaitable from collections.abc instead of typing.Awaitable
Vikky92 17a66dd
fix: close multi-provider parity gaps
cursoragent 25b7f4e
fix: address multi-provider review issues
jonathannorris 833ca18
fix: resolve CI failures in multi-provider
jonathannorris 4d2cf01
feat: add track() support to MultiProvider
jonathannorris b91d37f
docs: add docstring to ComparisonStrategy.determine_final_result
jonathannorris 028df90
fix: correct shutdown test to check multi_provider status directly
jonathannorris fc81faa
fix: use 'is True' for _is_internal_hook_provider check to prevent Mo…
jonathannorris 8c3207e
style: apply ruff formatting
jonathannorris f87d948
fix: guard against empty evaluations list in ComparisonStrategy.deter…
jonathannorris 21e931f
refactor: move InternalHookProvider to provider/_protocols.py
jonathannorris cefaaee
refactor: split multi_provider.py into a package with _strategies and…
jonathannorris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import typing | ||
|
|
||
| if typing.TYPE_CHECKING: | ||
| from openfeature.provider import ProviderStatus | ||
|
|
||
|
|
||
| @typing.runtime_checkable | ||
| class InternalHookProvider(typing.Protocol): | ||
| """Protocol for providers that manage their own provider hook execution. | ||
|
|
||
| Providers implementing this protocol (e.g. MultiProvider) handle provider | ||
| hook lifecycle internally. The client will skip its own provider hook | ||
| invocations and instead delegate to the provider via the set/reset methods. | ||
|
|
||
| The registry will also use get_status() from this protocol instead of its | ||
| own internal status tracking for providers that implement it. | ||
|
|
||
| Implementations must set ``_is_internal_hook_provider = True`` as a class | ||
| attribute. This marker is checked alongside ``isinstance`` to avoid false | ||
| positives from duck-typed objects (e.g. ``Mock``). | ||
| """ | ||
|
|
||
| _is_internal_hook_provider: typing.ClassVar[bool] | ||
|
|
||
| def uses_internal_provider_hooks(self) -> bool: ... | ||
|
|
||
| def set_internal_provider_hook_runtime( | ||
| self, | ||
| flag_type: typing.Any, | ||
| client_metadata: typing.Any, | ||
| hook_hints: typing.Any, | ||
| ) -> typing.Any: ... | ||
|
|
||
| def reset_internal_provider_hook_runtime(self, token: typing.Any) -> None: ... | ||
|
|
||
| def get_status(self) -> ProviderStatus: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from ._provider import MultiProvider, ProviderEntry | ||
| from ._strategies import ( | ||
| ComparisonStrategy, | ||
| EvaluationStrategy, | ||
| FirstMatchStrategy, | ||
| FirstSuccessfulStrategy, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "ComparisonStrategy", | ||
| "EvaluationStrategy", | ||
| "FirstMatchStrategy", | ||
| "FirstSuccessfulStrategy", | ||
| "MultiProvider", | ||
| "ProviderEntry", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.