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 method to set provider and block during init #563

Merged
merged 10 commits into from
Aug 28, 2023

Conversation

liran2000
Copy link
Member

The API SHOULD provide functions to set a provider and wait for the initialize function to return or throw

This PR

implements spec Requirement 1.1.8.

following blocking setProvider PR.

The API SHOULD provide functions to set a provider and wait for the initialize function to return or throw

Signed-off-by: liran2000 <[email protected]>
@liran2000 liran2000 requested a review from a team as a code owner August 16, 2023 16:14
@liran2000
Copy link
Member Author

hi @toddbaert,

on the approach to implement it, I thought it can be good in this case to call initialize on the same caller thread as it needs to wait.

@thomaspoignant for your recent spec addition.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #563 (37345c0) into main (7b1eb1c) will increase coverage by 0.51%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main     #563      +/-   ##
============================================
+ Coverage     94.25%   94.76%   +0.51%     
- Complexity      356      358       +2     
============================================
  Files            32       32              
  Lines           835      841       +6     
  Branches         50       51       +1     
============================================
+ Hits            787      797      +10     
+ Misses           27       24       -3     
+ Partials         21       20       -1     
Flag Coverage Δ
unittests 94.76% <100.00%> (+0.51%) ⬆️

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

Files Changed Coverage Δ
.../main/java/dev/openfeature/sdk/OpenFeatureAPI.java 100.00% <100.00%> (ø)
...n/java/dev/openfeature/sdk/ProviderRepository.java 98.46% <100.00%> (+0.10%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks! Interested in @thomaspoignant 's opinion.

My only requested change is this, which is a naming issue mostly (let me know if you disagree). Otherwise just optional suggestions.

@toddbaert
Copy link
Member

hi @toddbaert,

on the approach to implement it, I thought it can be good in this case to call initialize on the same caller thread as it needs to wait.

@thomaspoignant for your recent spec addition.

I'm fine with this approach.

@toddbaert toddbaert changed the title feat: spec 1.1.8 - setProviderAndWait feat: add method to set provider and await Aug 16, 2023
@toddbaert
Copy link
Member

@liran2000 I've updated the PR title to be more "friendly" since it goes into our release notes.

@toddbaert toddbaert changed the title feat: add method to set provider and await feat: add method to set provider and block during init Aug 16, 2023
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

LGTM, left 2 more small nits!

@beeme1mr beeme1mr requested a review from thisthat August 17, 2023 20:04
@beeme1mr beeme1mr requested a review from lopitz August 17, 2023 20:04
@toddbaert
Copy link
Member

@thomaspoignant since you came up with this spec proposal, I'm interested in your opinion of this implementation.

@toddbaert
Copy link
Member

I'm going to merge this EOD unless I hear objections.

cc @justinabrahms @thomaspoignant

@sonarcloud
Copy link

sonarcloud bot commented Aug 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@toddbaert toddbaert merged commit 506e89f into open-feature:main Aug 28, 2023
8 checks passed
@liran2000 liran2000 deleted the feat_spec_1_1_8 branch August 29, 2023 15:40
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.

5 participants