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
RUMM-700 Environment regex changed #246
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JIRA also says to update the env
in Shopist project to match the one used in Android.
@@ -140,9 +140,9 @@ extension FeaturesConfiguration { | |||
} | |||
|
|||
private func ifValid(environment: String) throws -> String { | |||
let regex = #"^[a-zA-Z0-9_]+$"# | |||
let regex = #"^[a-zA-Z0-9_./-]+$"# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more rules to include in this regexp, i.e. "must start with a letter", "can be up to 200 characters long".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref to Android regexp: DataDog/dd-sdk-android#369 (comment)
d38d463
to
0e9eea7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The JIRA also says to update the env in Shopist project to match the one used in Android.
0e9eea7
to
4b37e93
Compare
Android's regex is used, which allows "_./-" as non-alphanumerics
4b37e93
to
ec457fa
Compare
What and why?
There was a discrepancy between Android's environment validation rule and ours.
For instance,
shop.ist
was invalid for us whereas it was valid for Android and more importantly valid for RUM Explorer.How?
Now we use Android's regex, which allows "_./-" as non-alphanumerics.
Review checklist