quarkus-unleash
quarkus-unleash copied to clipboard
The 'name' attribute of @FeatureVariant is confusing
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.