-
Notifications
You must be signed in to change notification settings - Fork 170
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
Move regex validation checks to template schema #108
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.
This is awesome thanks a ton @shreyas-goenka ! I'll approve once the CLI PR merges and we can test this out with some project generations
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.
@shreyas-goenka would you mind updating the tests in tests/test_create_project.py::test_generate_fails_with_invalid_params
for the expected error once the CLI update goes out? I believe the tests should pass after that and we can merge this in!
This PR requires a CLI side fix before proceeding: databricks/cli#959 |
## Changes This PR removes validation for default value against the regex pattern specified in a JSON schema at schema load time. This is required because #795 introduces parameterising the default value as a Go text template impling that the default value now does not necessarily have to match the pattern at schema load time. This will also unblock: databricks/mlops-stacks#108 Note, this does not remove runtime validation for input parameters right before template initialization, which happens here: https://github.com/databricks/cli/blob/fb32e78c9b9fb000ce898b8a60b0b47920f487d3/libs/template/materialize.go#L76 ## Tests Changes to existing test.
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.
Approved with one minor ask, thanks @shreyas-goenka !
Changes
This PR moves regex validation checks to the template schema. This has the following advantages:
Note: We first need to get databricks/cli#912 in, and set / update the minimum CLI version for mlops-stacks before this PR can be merged.
Tests
Tested manually. Here are the cases:
Case project_name: ab
Case project_name: abcd/
Case staging URL: abc