-
Notifications
You must be signed in to change notification settings - Fork 42
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: Support mapping a client to a given provider. #388
Conversation
a1f948e
to
a1bbf38
Compare
Codecov Report
@@ Coverage Diff @@
## main #388 +/- ##
============================================
+ Coverage 91.53% 93.20% +1.66%
- Complexity 213 220 +7
============================================
Files 23 23
Lines 496 500 +4
Branches 32 32
============================================
+ Hits 454 466 +12
+ Misses 24 17 -7
+ Partials 18 17 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
e9a298f
to
9932825
Compare
If you think it's worth it, it could be something we mention in the glossary. |
Doc improvement: open-feature/spec#186 |
7e5ec3d
to
f2abe39
Compare
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
… lock. Signed-off-by: Justin Abrahms <justin@abrah.ms>
Co-authored-by: Lars Opitz <lars@lars-opitz.de> Signed-off-by: Justin Abrahms <justin@abrah.ms>
There's no such thing as "API without a provider set" anymore. We now default to NoOpProvider in the API (not client). Signed-off-by: Justin Abrahms <justin@abrah.ms>
777cb0b
to
f5c60b5
Compare
Signed-off-by: Justin Abrahms <justin@abrah.ms>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work! ❤️
private EvaluationContext evaluationContext; | ||
private List<Hook> apiHooks; | ||
private final List<Hook> apiHooks; | ||
private FeatureProvider defaultProvider = new NoOpProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for the noop default provider. This ensures null safety where possible.
Kudos, SonarCloud Quality Gate passed!
|
@justinabrahms @toddbaert any concerns about merging this? |
Nope (but lets' not release until all this is done, IMO). |
This PR
This adds support for mapping a client name onto a given provider, while still providing backwards compatibility to existing clients.
Related Issues
Refs open-feature/ofep#56
Fixes: #442
Follow-up Tasks
I still need to clean up documentation around this to note the difference between a "default provider" and a client-specific provider.
How to test
Not sure about testing, but I'd especially love eyes on the thread safety. I don't think ConcurrentHashMap is doing a lot of work here, given we have to use locks to support
getProviderForClientOrDefault
. If you have a better way, I'm all ears.