You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something like: ^[\w\d-]+$ would allow a user to use lowercase, uppercase, numbers, underscores and dashes in their keys.
Steps to Reproduce (for bugs)
Create a new flag
Change flag key to: "TEST"
An error pops up saying: "cannot create flag due to invalid key. reason: key:TEST should have the format ^[a-z]+[a-z0-9_]*$"
Context
We are currently switching from a different system which allowed us to use any test key. We need to rename some of our flag and variant keys in order to work with Flagr. I don't really see the point of having the key names so restrictive.
The text was updated successfully, but these errors were encountered:
maarten-blokker
changed the title
Arbitrary validation rules in test name and variant names
Arbitrary validation rules in feature and variant keys
May 14, 2019
@maarten-blokker I think it makes sense to use ^[\w\d-]+$, I restricted it before and hoped that the key (flag_key and variant_key) can be shaped in a simple form like ^[a-z]+[a-z0-9_]*$, but didn't expect people are actually migrating from their existing system. We can work on fixing this.
Expected Behavior
I want to use numbers as variant keys and capital letters in my flag keys.
Current Behavior
I'm not allowed due to the current regular expression.
Possible Solution
Change the regular expression to be more permissive in
Util.isSafeKey
:https://github.com/checkr/flagr/blob/master/pkg/util/util.go
Something like:
^[\w\d-]+$
would allow a user to use lowercase, uppercase, numbers, underscores and dashes in their keys.Steps to Reproduce (for bugs)
Context
We are currently switching from a different system which allowed us to use any test key. We need to rename some of our flag and variant keys in order to work with Flagr. I don't really see the point of having the key names so restrictive.
The text was updated successfully, but these errors were encountered: