-
Notifications
You must be signed in to change notification settings - Fork 9
fix(openfeature-go-feature-flag-provider): fallback to sdkDefault if reason is DISABLED #64
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
fix(openfeature-go-feature-flag-provider): fallback to sdkDefault if reason is DISABLED #64
Conversation
Summary of ChangesHello @doriandekoning, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an inconsistency in how the OpenFeature GoFeatureFlag provider handles disabled flags. Previously, when a flag was disabled by the GoFeatureFlag service, the provider would return a value from the service rather than the expected SDK default. The changes ensure that the provider now correctly falls back to the SDK's default value when a flag is disabled, improving reliability and adherence to OpenFeature specifications. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly implements the fallback to the SDK's default value when the go-feature-flag provider returns a DISABLED reason. The logic is sound and a corresponding test case has been added to ensure this behavior. My review includes one suggestion to improve the clarity and consistency of the new test case.
providers/openfeature-go-feature-flag-provider/spec/openfeature/gofeatureflag/provider_spec.rb
Outdated
Show resolved
Hide resolved
555edd4 to
b2d6a86
Compare
...feature-go-feature-flag-provider/lib/openfeature/go-feature-flag/go_feature_flag_provider.rb
Show resolved
Hide resolved
…reason is DISABLED
Currently, when go-feature-flags has a disabled flag it returns a response in the following format:
{"key":"my_flag","value":"thisisadefaultvaluethatItest1233%%","reason":"DISABLED","variant":"SdkDefault"}
This `thisisadefault...` comes directly from go-feature-flags. The client package returns this, but sdkDefault makes more sense.
Signed-off-by: Dorian de Koning <dorian.koning@vinted.com>
b2d6a86 to
00bc88d
Compare
🤖 I have created a release *beep* *boop* --- ## [0.1.6](openfeature-go-feature-flag-provider/v0.1.5...openfeature-go-feature-flag-provider/v0.1.6) (2025-11-11) ### 🐛 Bug Fixes * **openfeature-go-feature-flag-provider:** fallback to sdkDefault if reason is DISABLED ([#64](#64)) ([6cb08c0](6cb08c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
…-feature#65) 🤖 I have created a release *beep* *boop* --- ## [0.1.6](open-feature/ruby-sdk-contrib@openfeature-go-feature-flag-provider/v0.1.5...openfeature-go-feature-flag-provider/v0.1.6) (2025-11-11) ### 🐛 Bug Fixes * **openfeature-go-feature-flag-provider:** fallback to sdkDefault if reason is DISABLED ([open-feature#64](open-feature#64)) ([6cb08c0](open-feature@6cb08c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
…reason is DISABLED (open-feature#64) ## This PR Currently, when go-feature-flags has a disabled flag it returns a response in the following format: `{"key":"my_flag","value":"thisisadefaultvaluethatItest1233%%","reason":"DISABLED","variant":"SdkDefault"}`. This `thisisadefault...` comes directly from go-feature-flags. The client package returns this, but sdkDefault makes more sense. https://github.com/thomaspoignant/go-feature-flag/blob/de4d46dd7d513da32a9c67f0c38ae577d51ff6bd/cmd/relayproxy/ofrep/evaluate.go#L95C19-L95C51 Signed-off-by: Dorian de Koning <dorian.koning@vinted.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
…-feature#65) 🤖 I have created a release *beep* *boop* --- ## [0.1.6](open-feature/ruby-sdk-contrib@openfeature-go-feature-flag-provider/v0.1.5...openfeature-go-feature-flag-provider/v0.1.6) (2025-11-11) ### 🐛 Bug Fixes * **openfeature-go-feature-flag-provider:** fallback to sdkDefault if reason is DISABLED ([open-feature#64](open-feature#64)) ([6cb08c0](open-feature@6cb08c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
…-feature#65) 🤖 I have created a release *beep* *boop* --- ## [0.1.6](open-feature/ruby-sdk-contrib@openfeature-go-feature-flag-provider/v0.1.5...openfeature-go-feature-flag-provider/v0.1.6) (2025-11-11) ### 🐛 Bug Fixes * **openfeature-go-feature-flag-provider:** fallback to sdkDefault if reason is DISABLED ([open-feature#64](open-feature#64)) ([6cb08c0](open-feature@6cb08c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
…reason is DISABLED (open-feature#64) ## This PR Currently, when go-feature-flags has a disabled flag it returns a response in the following format: `{"key":"my_flag","value":"thisisadefaultvaluethatItest1233%%","reason":"DISABLED","variant":"SdkDefault"}`. This `thisisadefault...` comes directly from go-feature-flags. The client package returns this, but sdkDefault makes more sense. https://github.com/thomaspoignant/go-feature-flag/blob/de4d46dd7d513da32a9c67f0c38ae577d51ff6bd/cmd/relayproxy/ofrep/evaluate.go#L95C19-L95C51 Signed-off-by: Dorian de Koning <dorian.koning@vinted.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
…-feature#65) 🤖 I have created a release *beep* *boop* --- ## [0.1.6](open-feature/ruby-sdk-contrib@openfeature-go-feature-flag-provider/v0.1.5...openfeature-go-feature-flag-provider/v0.1.6) (2025-11-11) ### 🐛 Bug Fixes * **openfeature-go-feature-flag-provider:** fallback to sdkDefault if reason is DISABLED ([open-feature#64](open-feature#64)) ([6cb08c0](open-feature@6cb08c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: wadii <wadii.zaim@flagsmith.com>
This PR
Currently, when go-feature-flags has a disabled flag it returns a response in the following format:
{"key":"my_flag","value":"thisisadefaultvaluethatItest1233%%","reason":"DISABLED","variant":"SdkDefault"}. Thisthisisadefault...comes directly from go-feature-flags. The client package returns this, but sdkDefault makes more sense.https://github.com/thomaspoignant/go-feature-flag/blob/de4d46dd7d513da32a9c67f0c38ae577d51ff6bd/cmd/relayproxy/ofrep/evaluate.go#L95C19-L95C51