-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add UI regex validation #130
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
Conversation
|
/run pipeline |
jor2
left a comment
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.
question about regex
|
/run pipeline |
|
/run pipeline |
|
/run pipeline |
|
/run pipeline |
vbontempi
left a comment
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.
asked a question valid for all the changes on variables.tf
| default = null | ||
| validation { | ||
| condition = var.repos_git_token_secret_crn != null ? can(regex("^crn\\:v\\d(\\:[\\w\\-_]*){4}\\:([aos]\\/[\\w_\\-]+)?(\\:[\\w_\\-]*){3}$", var.repos_git_token_secret_crn)) : true | ||
| condition = var.repos_git_token_secret_crn != null ? can(regex("^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:secret:[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", var.repos_git_token_secret_crn)) : true |
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.
you are making the regexp more strict forcing the service name to secrets-manager but you also make it more relaxed in terms of account/service IDs
Moreover is there a reason why you are replacing \w with [0-9a-fA-F] which represents the same set of characters?
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.
- @vbontempi :I initially misunderstood that the CRN pattern for this variable only allowed Secrets Manager secrets, but I’ve now realized it supports secret CRNs from other services as well. I’m reverting my changes to the previous version and will do the same in the catalog.
I was following the same pattern for other CRNs as well. As per your suggestion, since the account ID pattern is currently relaxed, I’ll make it stricter. Also, I’d like to confirm whether we’re using the service ID as part of the CRN.
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.
Based on the variable description (repos_git_token_secret_crn), this represents the CRN of an existing secret stored in Secrets Manager. However, when I tested it, the existing secret CRN didn’t match the current pattern.
I have done some modification in the CRN pattern (made it more stricter),it is matching to the CRN .
|
/run pipeline |
|
/run pipeline |
|
/run pipeline |
|
/run pipeline |
vbontempi
left a comment
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.
ok
|
🎉 This PR is included in version 2.6.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |











Description
Add UI regex valiadation in ibm_catalog.json.
Release required?
x.x.X)x.X.x)X.x.x)Release notes content
This PR is to enable input validation in the UI for the variable using the value_constraints array defined in the catalog, which the UI will use to validate user input at runtime.
Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
Checklist for reviewers
For mergers