Skip to content

Conversation

@doriandekoning
Copy link
Contributor

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Bug Fix: Disabled Flag Handling: The pull request addresses an issue where the openfeature-go-feature-flag-provider was not correctly handling flags that were disabled by the go-feature-flags service. Previously, it would return a value provided by go-feature-flags even when the flag was explicitly disabled, which was inconsistent with the expected behavior of falling back to the SDK's default value.
  • Fallback to SDK Default: The provider now explicitly checks if the reason for a flag evaluation is DISABLED. If so, it ensures that the SDK::Provider::ResolutionDetails returns the default_value provided by the OpenFeature SDK, along with the DISABLED reason, aligning with standard feature flag practices.
  • New Test Case: A new test case has been added to provider_spec.rb to verify this corrected behavior, ensuring that when a flag is disabled by the go-feature-flags service, the OpenFeature provider correctly returns the default_value.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@doriandekoning doriandekoning force-pushed the fix-sdk-default-not-returned-with-reason-disabled branch 2 times, most recently from 555edd4 to b2d6a86 Compare November 6, 2025 12:03
…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>
@doriandekoning doriandekoning force-pushed the fix-sdk-default-not-returned-with-reason-disabled branch from b2d6a86 to 00bc88d Compare November 10, 2025 12:28
@thomaspoignant thomaspoignant merged commit 6cb08c0 into open-feature:main Nov 11, 2025
2 checks passed
thomaspoignant pushed a commit that referenced this pull request Nov 11, 2025
🤖 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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 21, 2025
…-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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 21, 2025
…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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 21, 2025
…-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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 26, 2025
…-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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 26, 2025
…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>
Zaimwa9 pushed a commit to Zaimwa9/ruby-sdk-contrib that referenced this pull request Nov 26, 2025
…-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>
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.

3 participants