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 FeatureEnabled to Variant and fix spec testing #166

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

jameshartig
Copy link
Contributor

About the changes

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].

[1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448

Closes #159

Important files

Discussion points

See #165 (comment) but I'm not sure how to handle the JSON differences between the spec and *api.Variant.

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
@jameshartig
Copy link
Contributor Author

@FredrikOseberg took my best shot at fixing the spec tests and they seem to pass locally now.

@FredrikOseberg
Copy link
Contributor

@jameshartig Thanks. We don't have detailed documentation about our specification tests, but it's basically a set of tests that we use to ensure SDK compatibility across languages. Nice work on setting it up, finding the error and fixing it.

I noticed a flaw in our current workflow that only built and ran the tests when a push was made by someone with write access to the repository, so I added a new workflow that builds PRs and changed the other workflow to run on main. All the checks pass now!

@FredrikOseberg FredrikOseberg merged commit a9f89ed into Unleash:v4 Dec 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Return variant and feature enabled from a single method
2 participants