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

The 'name' attribute of @FeatureVariant is confusing #234

Open
gwenneg opened this issue Mar 6, 2024 · 0 comments
Open

The 'name' attribute of @FeatureVariant is confusing #234

gwenneg opened this issue Mar 6, 2024 · 0 comments

Comments

@gwenneg
Copy link
Contributor

gwenneg commented Mar 6, 2024

In Unleash, both toggles and variants have a name.

Toggle [name="foo", ...]
    \__ Variant [name="alpha", ...]
    \__ Variant [name="bravo", ...]
Toggle [name="bar", ...]

The @FeatureVariant annotation from quarkus-unleash, which is meant to retrieve the variant from a given toggle, requires a name attribute. Unless I missed something, there is currently no indication that the annotation requires the toggle name and not the variant name. If the variant name is provided (which is how I tried to use it initially), Unleash won't return any data.

My suggestion would be to introduce a new FeatureVariant#toggleName attribute, deprecate FeatureVariant#name immediately and remove it eventually. The annotation could also be better documented with Javadoc and the extension doc.

Finally, for the sake of consistency if that is implemented, FeatureToggle#toggleName could be considered as well to replace FeatureToggle#name.

@gwenneg gwenneg changed the title The 'name' attribute of @FeatureToggle is confusing The 'name' attribute of @FeatureVariant is confusing Mar 6, 2024
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

No branches or pull requests

1 participant