databricks-cli/libs
shreyas-goenka 3700785dfa
Add support for validating CLI version when loading a jsonschema object (#883)
## Changes
Updates to bundle templates can require updated versions of the CLI.
This PR extends the JSON schema representation to allow template authors
to set a min CLI version they require for their templates.

This is required to make improvements/additions to the mlops-stacks repo

## Tests
Tested using unit tests and manually. 

For manualy testing, I created a custom build of the CLI using go
releaser and then tested it against a local instance of mlops-stack
When mlops-stack schema has:
```
  "min_databricks_cli_version": "v5000.1.1",
```

output (error as expected)
```
shreyas.goenka@THW32HFW6T bricks % ./dist/cli_darwin_arm64/databricks bundle init  ~/mlops-stack
Error: minimum CLI version "v5000.1.1" is greater than current CLI version "v0.207.2-dev+1b992c0". Please upgrade your current Databricks CLI
```

When the mlops-stack schema has:
```
  "min_databricks_cli_version": "v0.1.1",
```

output (validation passes)
```
shreyas.goenka@THW32HFW6T bricks % ./dist/cli_darwin_arm64/databricks bundle init  ~/mlops-stack
Welcome to MLOps Stack. For detailed information on project generation, see the README at https://github.com/databricks/mlops-stack/blob/main/README.md.

Project Name [my-mlops-project]: ^C
```
2023-10-19 14:01:48 +00:00
..
auth Fix IsServicePrincipal() only working for workspace admins (#732) 2023-09-05 11:20:55 +00:00
cmdio Prompt once for a client profile (#727) 2023-09-11 15:32:24 +00:00
databrickscfg Always resolve .databrickscfg file (#659) 2023-08-14 12:45:08 +00:00
env Added `process.Background()` and `process.Forwarded()` (#804) 2023-09-27 09:04:44 +00:00
errs Added ability for deferred mutator execution (#380) 2023-05-16 18:01:50 +02:00
filer Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
fileset Support .gitignore syntax in sync section and make sure it works recursively (#854) 2023-10-10 08:45:15 +00:00
flags Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
git Added `process.Background()` and `process.Forwarded()` (#804) 2023-09-27 09:04:44 +00:00
jsonschema Add support for validating CLI version when loading a jsonschema object (#883) 2023-10-19 14:01:48 +00:00
locker Correct name for force acquire deploy flag (#656) 2023-08-15 19:03:43 +00:00
log Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
notebook Error out if notebook file does not exist locally (#261) 2023-03-21 18:13:16 +01:00
process Added `process.Background()` and `process.Forwarded()` (#804) 2023-09-27 09:04:44 +00:00
python Added `python.DetectInterpreters` and other utils (#805) 2023-10-03 10:47:09 +00:00
set Added support for sync.include and sync.exclude sections (#671) 2023-08-18 08:07:25 +00:00
sync Support .gitignore syntax in sync section and make sure it works recursively (#854) 2023-10-10 08:45:15 +00:00
tags Library to validate and normalize cloud specific tags (#819) 2023-09-29 08:49:08 +00:00
template Improve the output of the `databricks bundle init` command (#795) 2023-10-19 07:08:36 +00:00
terraform Add bundle destroy command (#300) 2023-04-06 12:54:58 +02:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00