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

Console command configure-feature does not validate input #12

Open
nclavaud opened this issue Mar 29, 2021 · 1 comment
Open

Console command configure-feature does not validate input #12

nclavaud opened this issue Mar 29, 2021 · 1 comment
Labels
Improvement New feature or request

Comments

@nclavaud
Copy link
Contributor

This call combined to this console command makes it possible to call any public method of a TogglingStrategy, including those that are not relevant to the command, for example:

console feature-toggles:configure-feature my_feature onoff getConfiguration

Not sure if this is an issue, but I guess it was not intended.

Also, the parameters are not validated, and such the following call (with a parameter missing) will throw an exception:

console feature-toggles:configure-feature my_feature percentage slide

I understand that this console command is here to provide some basic support, but maybe there should be a separate, dedicated command for each strategy, with each command featuring proper validation? Something like:

console feature-toggles:configure-feature:on-off my_feature on

console feature-toggles:configure-feature:percentage my_feature 10

console feature-toggles:configure-feature:whitelist my_feature my_target

What do you think?

@trompette
Copy link
Owner

What do you think?

I intended the ConfigureFeatureCommand to be the single CLI entrypoint to configure any feature, because I wanted adding new strategies to be as easy as possible.

But, since the class is generic, implementing strategy-specific behaviours like parameter validation is more complex.

I think what you are proposing is a good idea and would not make adding new strategies that more difficult.

@trompette trompette added the Improvement New feature or request label Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants