Skip to content
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

feat!: add support for domains #271

Merged
merged 8 commits into from
Feb 20, 2024
Merged

Conversation

federicobond
Copy link
Member

This PR

Adds support for domains with a minimalist implementation. Feedback is especially welcome around public APIs and backward compatibility issues.

Builds on top of #270

Related Issues

Refs #125

Follow-up Tasks

  • Ensure the API is idiomatic and matches the spec guidelines
  • Test backward compatibility with existing clients and providers

@federicobond federicobond changed the title Domains feat: add support for domains Feb 3, 2024
Copy link

codecov bot commented Feb 3, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (0ec2b69) 94.40% compared to head (0425a15) 94.52%.

Files Patch % Lines
openfeature/provider/registry.py 95.65% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #271      +/-   ##
==========================================
+ Coverage   94.40%   94.52%   +0.11%     
==========================================
  Files          17       18       +1     
  Lines         447      493      +46     
==========================================
+ Hits          422      466      +44     
- Misses         25       27       +2     
Flag Coverage Δ
unittests 94.52% <96.92%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

Due to the argument renaming it becomes a breaking change and then you actually could completely get rid of _provider and initialize _providers like this

_providers: typing.Dict[typing.Optional[str], AbstractProvider] = {None: NoOpProvider()}

openfeature/api.py Outdated Show resolved Hide resolved
openfeature/api.py Show resolved Hide resolved
openfeature/client.py Show resolved Hide resolved
openfeature/client.py Outdated Show resolved Hide resolved
openfeature/api.py Show resolved Hide resolved
openfeature/api.py Outdated Show resolved Hide resolved
openfeature/api.py Show resolved Hide resolved
@federicobond federicobond changed the title feat: add support for domains feat!: add support for domains Feb 6, 2024
@federicobond federicobond force-pushed the domains branch 2 times, most recently from 531831a to 4d2dfdc Compare February 7, 2024 03:09
@federicobond federicobond marked this pull request as ready for review February 7, 2024 03:11
@federicobond
Copy link
Member Author

I introduced a ProviderRegistry in the last commit similar to the ones in other SDKs because the code was becoming a bit convoluted.

README.md Outdated Show resolved Hide resolved
openfeature/client.py Show resolved Hide resolved
openfeature/provider/registry.py Show resolved Hide resolved
@federicobond federicobond force-pushed the domains branch 2 times, most recently from b71012e to 376802e Compare February 10, 2024 01:17
@federicobond
Copy link
Member Author

Rebased on top of latest main.

README.md Show resolved Hide resolved
@federicobond federicobond force-pushed the domains branch 3 times, most recently from acac4dd to d1cc64c Compare February 18, 2024 02:59
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.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.

[FEATURE] Implement domain scoping
4 participants