Skip to content

Allow specifying CLI version constraints required to run the bundle - #1320

Merged
andrewnester merged 10 commits into
mainfrom
runtime-min-version
Apr 2, 2024
Merged

Allow specifying CLI version constraints required to run the bundle#1320
andrewnester merged 10 commits into
mainfrom
runtime-min-version

Conversation

@andrewnester

@andrewnesterandrewnester commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

Changes

Allow specifying CLI version constraints required to run the bundle

Example of configuration:

only allow specific version

bundle:
name: my-bundle
databricks_cli_version: "0.210.0"

allow all patch releases

bundle:
name: my-bundle
databricks_cli_version: "0.210.*"

constrain minimum version

bundle:
name: my-bundle
databricks_cli_version: ">= 0.210.0"

constrain range

bundle:
name: my-bundle
databricks_cli_version: ">= 0.210.0, <= 1.0.0"

For other examples see: https://github.com/Masterminds/semver?tab=readme-ov-file#checking-version-constraints

Example error

sh-3.2$ databricks bundle validate
Error: Databricks CLI version constraint not satisfied. Required: >= 1.0.0, current: 0.216.0

Tests

Added unit test cover all possible configuration permutations

Comment threadbundle/config/mutator/verify_cli_version_test.go
Comment threadbundle/config/bundle.go Outdated
@andrewnesterandrewnester changed the title Allow specifying minimum and maximum CLI version required to run the bundleAllow specifying CLI version constraints required to run the bundleMar 28, 2024
},
{
currentVersion: "0.100.123",
constraint: "^0.100",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just stick to the operators of requirementst.txt? (https://pip.pypa.io/en/stable/reference/requirements-file-format/)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion here but since it's allowed by library we use for version check I'd prefer to have it as it's pretty common syntax in other languages / tools as well

Comment threadbundle/config/mutator/verify_cli_version_test.go
Comment threadbundle/config/mutator/verify_cli_version_test.go Outdated
Comment threadbundle/config/mutator/verify_cli_version.go Outdated
Co-authored-by: Lennart Kats (databricks) <lennart.kats@databricks.com>

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also include a mention of this library in our NOTICE file.

Comment threadgo.mod
Comment threadbundle/config/mutator/verify_cli_version_test.go
@andrewnester
andrewnester added this pull request to the merge queueApr 2, 2024
Merged via the queue into main with commit 56e393cApr 2, 2024
@andrewnester
andrewnester deleted the runtime-min-version branch April 2, 2024 13:02
andrewnester added a commit that referenced this pull request Apr 3, 2024
CLI:
* Added `auth describe` command ([#1244](#1244)).
* Fixed message for successful auth describe run ([#1336](#1336)).
Bundles:
* Make bundle validation print text output by default ([#1335](#1335)).
* Use UserName field to identify if service principal is used ([#1310](#1310)).
* Allow unknown properties in the config file for template initialization ([#1315](#1315)).
* Remove support for DATABRICKS_BUNDLE_INCLUDES ([#1317](#1317)).
* Make `bundle.deployment` optional in the bundle schema ([#1321](#1321)).
* Add allow list for resources when bundle `run_as` is set ([#1233](#1233)).
* Fix the generated DABs JSON schema ([#1322](#1322)).
* Make bundle loaders return diagnostics ([#1319](#1319)).
* Add `bundle debug terraform` command ([#1294](#1294)).
* Allow specifying CLI version constraints required to run the bundle ([#1320](#1320)).
Internal:
* Retain location information of variable reference ([#1333](#1333)).
* Define `dyn.Mapping` to represent maps ([#1301](#1301)).
* Return `diag.Diagnostics` from mutators ([#1305](#1305)).
* Fix flaky test in `libs/process` ([#1314](#1314)).
* Move path field to bundle type ([#1316](#1316)).
* Load bundle configuration from mutator ([#1318](#1318)).
* Return diagnostics from `config.Load` ([#1324](#1324)).
* Return warning for nil primitive types during normalization ([#1329](#1329)).
* Include `dyn.Path` in normalization warnings and errors ([#1332](#1332)).
* Make normalization return warnings instead of errors ([#1334](#1334)).
API Changes:
* Added `databricks lakeview migrate` command.
* Added `databricks lakeview unpublish` command.
* Changed `databricks ip-access-lists get` command . New request type is .
OpenAPI commit e316cc3d78d087522a74650e26586088da9ac8cb (2024-04-03)
Dependency updates:
* Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0 ([#1326](#1326)).
@andrewnesterandrewnester mentioned this pull request Apr 3, 2024
github-merge-queueBot pushed a commit that referenced this pull request Apr 3, 2024
Breaking Change:
* Add allow list for resources when bundle `run_as` is set
([#1233](#1233)).
* Make bundle validation print text output by default
([#1335](#1335)).
CLI:
* Added `auth describe` command
([#1244](#1244)).
* Fixed message for successful auth describe run
([#1336](#1336)).
Bundles:
* Use UserName field to identify if service principal is used
([#1310](#1310)).
* Allow unknown properties in the config file for template
initialization ([#1315](#1315)).
* Remove support for DATABRICKS_BUNDLE_INCLUDES
([#1317](#1317)).
* Make `bundle.deployment` optional in the bundle schema
([#1321](#1321)).
* Fix the generated DABs JSON schema
([#1322](#1322)).
* Make bundle loaders return diagnostics
([#1319](#1319)).
* Add `bundle debug terraform` command
([#1294](#1294)).
* Allow specifying CLI version constraints required to run the bundle
([#1320](#1320)).
Internal:
* Retain location information of variable reference
([#1333](#1333)).
* Define `dyn.Mapping` to represent maps
([#1301](#1301)).
* Return `diag.Diagnostics` from mutators
([#1305](#1305)).
* Fix flaky test in `libs/process`
([#1314](#1314)).
* Move path field to bundle type
([#1316](#1316)).
* Load bundle configuration from mutator
([#1318](#1318)).
* Return diagnostics from `config.Load`
([#1324](#1324)).
* Return warning for nil primitive types during normalization
([#1329](#1329)).
* Include `dyn.Path` in normalization warnings and errors
([#1332](#1332)).
* Make normalization return warnings instead of errors
([#1334](#1334)).
API Changes:
* Added `databricks lakeview migrate` command.
* Added `databricks lakeview unpublish` command.
* Changed `databricks ip-access-lists get` command . New request type is
.
OpenAPI commit e316cc3d78d087522a74650e26586088da9ac8cb (2024-04-03)
Dependency updates:
* Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0
([#1326](#1326)).
denik pushed a commit that referenced this pull request May 20, 2026
…1320)
## Changes
Allow specifying CLI version constraints required to run the bundle
Example of configuration:
#### only allow specific version
```
bundle:
name: my-bundle
databricks_cli_version: "0.210.0"
```
#### allow all patch releases
```
bundle:
name: my-bundle
databricks_cli_version: "0.210.*"
```
#### constrain minimum version
```
bundle:
name: my-bundle
databricks_cli_version: ">= 0.210.0"
```
#### constrain range
```
bundle:
name: my-bundle
databricks_cli_version: ">= 0.210.0, <= 1.0.0"
```
For other examples see:
https://github.com/Masterminds/semver?tab=readme-ov-file#checking-version-constraints
Example error
```
sh-3.2$ databricks bundle validate
Error: Databricks CLI version constraint not satisfied. Required: >= 1.0.0, current: 0.216.0
```
## Tests
Added unit test cover all possible configuration permutations
---------
Co-authored-by: Lennart Kats (databricks) <lennart.kats@databricks.com>
denik pushed a commit that referenced this pull request May 20, 2026
Breaking Change:
* Add allow list for resources when bundle `run_as` is set
([#1233](#1233)).
* Make bundle validation print text output by default
([#1335](#1335)).
CLI:
* Added `auth describe` command
([#1244](#1244)).
* Fixed message for successful auth describe run
([#1336](#1336)).
Bundles:
* Use UserName field to identify if service principal is used
([#1310](#1310)).
* Allow unknown properties in the config file for template
initialization ([#1315](#1315)).
* Remove support for DATABRICKS_BUNDLE_INCLUDES
([#1317](#1317)).
* Make `bundle.deployment` optional in the bundle schema
([#1321](#1321)).
* Fix the generated DABs JSON schema
([#1322](#1322)).
* Make bundle loaders return diagnostics
([#1319](#1319)).
* Add `bundle debug terraform` command
([#1294](#1294)).
* Allow specifying CLI version constraints required to run the bundle
([#1320](#1320)).
Internal:
* Retain location information of variable reference
([#1333](#1333)).
* Define `dyn.Mapping` to represent maps
([#1301](#1301)).
* Return `diag.Diagnostics` from mutators
([#1305](#1305)).
* Fix flaky test in `libs/process`
([#1314](#1314)).
* Move path field to bundle type
([#1316](#1316)).
* Load bundle configuration from mutator
([#1318](#1318)).
* Return diagnostics from `config.Load`
([#1324](#1324)).
* Return warning for nil primitive types during normalization
([#1329](#1329)).
* Include `dyn.Path` in normalization warnings and errors
([#1332](#1332)).
* Make normalization return warnings instead of errors
([#1334](#1334)).
API Changes:
* Added `databricks lakeview migrate` command.
* Added `databricks lakeview unpublish` command.
* Changed `databricks ip-access-lists get` command . New request type is
.
OpenAPI commit e316cc3d78d087522a74650e26586088da9ac8cb (2024-04-03)
Dependency updates:
* Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0
([#1326](#1326)).
Sign up for freeto 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.

4 participants

@andrewnester@pietern@lennartkats-db@shreyas-goenka