-
Notifications
You must be signed in to change notification settings - Fork 55
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
Return variant and feature enabled from a single method #159
Comments
If we can decide on a path I'm fine doing the change and submitting a PR. |
I'm actually leaning more towards the second path because we also need the underlying |
Thanks for pointing this out, it's definitely a gap we're looking to close. When this SDK was first created it was based on our node-client, which had this interface already. As we have SDKs in multiple different languages, we do strive to keep the API surface as similar as possible, both to avoid SDK bloat but also to keep the mental model clean across language boundaries. Expanding the API for one SDK is really something we want to try to avoid. Especially since we have started this journey already in our python SDK here. Would it be acceptable for now to add a similar property to the GetVariant response? Look forward to hearing from you |
You're talking about adding |
Perfect! Do you want to cook something up? I will make sure we follow up
next week. By the way I think the property was renamed FeatureEnabled after
discussions in the PR.
Would be nice to keep the same naming conventions here.
fre. 8. des. 2023 kl. 16:39 skrev James Hartig ***@***.***>:
… Would it be acceptable for now to add a similar property to the GetVariant
response?
You're talking about adding IsFeatureEnabled to api.Variant? Yes, that
seems fine. I appreciate the quick reply!
—
Reply to this email directly, view it on GitHub
<#159 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD2WIPQTETSEPRLSPBEXC6LYIMYBNAVCNFSM6AAAAABALHRSZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGQYDAMJXGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes Unleash#159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448
FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes Unleash#159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448
FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes #159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448
FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes Unleash#159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448
* feat: add FeatureEnabled to Variant and fix spec testing FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes #159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448 * fix: add workflow to build PRs --------- Co-authored-by: Fredrik Oseberg <[email protected]>
Describe the feature request
Currently there's no way with a single call to differentiate between a feature being disabled and no variants on the feature. Both of those cases return the default variant. Ideally there would be a call that returns
(variant, enabled)
.Background
We would like to make a single call and understand if a feature is enabled and what variant is applicable, if any. Instead we have to make 2 calls to understand the distinction. I'm surprised that this hasn't been brought up already and I'm curious how others are using this library in production with variants.
Solution suggestions
There are 2 potential solutions I see:
Personally we're fine with either but the options being broken does seem like it should be fixed and might lend itself to just adding a new option.
The text was updated successfully, but these errors were encountered: