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

Add support for regex patterns in template schema #768

Merged
merged 11 commits into from
Sep 25, 2023

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Sep 12, 2023

Changes

This PR introduces support for regex pattern validation in our custom jsonschema validator. This allows us to fail early if a user enters an invalid value for a field.

For example, now this is what initializing the default template looks like with an invalid project name:

shreyas.goenka@THW32HFW6T bricks % cli bundle init
Template to use [default-python]: 
Unique name for this project [my_project]: (_*_)
Error: invalid value for project_name: (_*_). Must consist of letter and underscores only.

Tests

New unit tests and manually.

@shreyas-goenka shreyas-goenka changed the title wip Add support for regex patterns in template schema Sep 12, 2023
@shreyas-goenka shreyas-goenka marked this pull request as ready for review September 13, 2023 22:48
libs/jsonschema/extension.go Outdated Show resolved Hide resolved
libs/template/config.go Show resolved Hide resolved
libs/jsonschema/utils.go Outdated Show resolved Hide resolved
libs/template/config.go Show resolved Hide resolved
libs/jsonschema/utils.go Show resolved Hide resolved
libs/template/config.go Show resolved Hide resolved
@shreyas-goenka shreyas-goenka added this pull request to the merge queue Sep 25, 2023
Merged via the queue into main with commit 757d5ef Sep 25, 2023
4 checks passed
@shreyas-goenka shreyas-goenka deleted the template-pattern branch September 25, 2023 10:02
andrewnester added a commit that referenced this pull request Sep 27, 2023
Bundles:
 * Enable target overrides for pipeline clusters ([#792](#792)).
 * Add support for regex patterns in template schema ([#768](#768)).
 * Make the default `databricks bundle init` template more self-explanatory ([#796](#796)).
 * Make a notebook wrapper for Python wheel tasks optional ([#797](#797)).
 * Added a warning when Python wheel wrapper needs to be used ([#807](#807)).

Internal:
 * Added `process.Background()` and `process.Forwarded()` ([#804](#804)).

Dependency updates:
 * Bump golang.org/x/term from 0.11.0 to 0.12.0 ([#798](#798)).
 * Bump github.com/hashicorp/terraform-exec from 0.18.1 to 0.19.0 ([#801](#801)).
 * Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0 ([#802](#802)).
@andrewnester andrewnester mentioned this pull request Sep 27, 2023
github-merge-queue bot pushed a commit that referenced this pull request Sep 27, 2023
Bundles:
* Enable target overrides for pipeline clusters
([#792](#792)).
* Add support for regex patterns in template schema
([#768](#768)).
* Make the default `databricks bundle init` template more
self-explanatory ([#796](#796)).
* Make a notebook wrapper for Python wheel tasks optional
([#797](#797)).
* Added a warning when Python wheel wrapper needs to be used
([#807](#807)).

Internal:
* Added `process.Background()` and `process.Forwarded()`
([#804](#804)).

Dependency updates:
* Bump golang.org/x/term from 0.11.0 to 0.12.0
([#798](#798)).
* Bump github.com/hashicorp/terraform-exec from 0.18.1 to 0.19.0
([#801](#801)).
* Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0
([#802](#802)).
hectorcast-db pushed a commit that referenced this pull request Oct 13, 2023
## Changes
This PR introduces support for regex pattern validation in our custom
jsonschema validator. This allows us to fail early if a user enters an
invalid value for a field.

For example, now this is what initializing the default template looks
like with an invalid project name:
```
shreyas.goenka@THW32HFW6T bricks % cli bundle init
Template to use [default-python]: 
Unique name for this project [my_project]: (_*_)
Error: invalid value for project_name: (_*_). Must consist of letter and underscores only.
```

## Tests
New unit tests and manually.
hectorcast-db pushed a commit that referenced this pull request Oct 13, 2023
Bundles:
* Enable target overrides for pipeline clusters
([#792](#792)).
* Add support for regex patterns in template schema
([#768](#768)).
* Make the default `databricks bundle init` template more
self-explanatory ([#796](#796)).
* Make a notebook wrapper for Python wheel tasks optional
([#797](#797)).
* Added a warning when Python wheel wrapper needs to be used
([#807](#807)).

Internal:
* Added `process.Background()` and `process.Forwarded()`
([#804](#804)).

Dependency updates:
* Bump golang.org/x/term from 0.11.0 to 0.12.0
([#798](#798)).
* Bump github.com/hashicorp/terraform-exec from 0.18.1 to 0.19.0
([#801](#801)).
* Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0
([#802](#802)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants