open-feature / go-sdk

Go SDK for OpenFeature
https://openfeature.dev
Apache License 2.0
126 stars 30 forks source link

feat: Blocking provider mutator #244

Closed znonthedev closed 7 months ago

znonthedev commented 8 months ago

This PR

Adds setProviderAndWait method in the API that will set the provider synchronously

Related Issues

Fixes #240

Follow-up Tasks

add test scenarios update readme

znonthedev commented 8 months ago

Hi @toddbaert, could you please review this PR? I am very new to Go and not sure if this implementation is correct. I will refactor it and keep it DRY if the current implementation meets the expectations outlined in the issue. Thanks in advance.

toddbaert commented 8 months ago

Thank you @znonthedev !

I will review, and also add some reviewers who are more experienced with Go than me! Many people are on holiday however, so it may take a few days to get some approvals. Your patience is appreciated! :pray:

codecov[bot] commented 8 months ago

Codecov Report

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

Comparison is base (95f592a) 81.61% compared to head (2d95374) 79.83%.

Files Patch % Lines
openfeature/api.go 61.97% 23 Missing and 4 partials :warning:
openfeature/openfeature.go 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #244 +/- ## ========================================== - Coverage 81.61% 79.83% -1.78% ========================================== Files 10 10 Lines 1142 1195 +53 ========================================== + Hits 932 954 +22 - Misses 192 220 +28 - Partials 18 21 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

znonthedev commented 8 months ago

I have updated the PR based on the comments. I have added two test cases also. I am not sure on the test cases. Do I need to add more test cases or change the current ones

toddbaert commented 8 months ago

We need to add an equivalent function for setting a named provider and waiting (see here).

toddbaert commented 8 months ago

@bacherfl when you get a moment, could you take a look at this as well?

znonthedev commented 8 months ago

We need to add an equivalent function for setting a named provider and waiting (see here).

Certainly, @toddbaert. I had the same thought. I will incorporate the necessary changes into the PR

Kavindu-Dodan commented 7 months ago

@znonthedev are you planning to complete this contribution soon ? There are pending changes in some providers which require this feature.

toddbaert commented 7 months ago

Closed with https://github.com/open-feature/go-sdk/pull/251