databricks-cli/bundle/deploy
Andrew Nester 27f51c760f
Added validate mutator to surface additional bundle warnings (#1352)
## Changes
All these validators will return warnings as part of `bundle validate`
run

Added 2 mutators: 
1. To check that if tasks use job_cluster_key it is actually defined
2. To check if there are any files to sync as part of deployment

Also added `bundle.Parallel` to run them in parallel

To make sure mutators under bundle.Parallel do not mutate config,
introduced new `ReadOnlyMutator`, `ReadOnlyBundle` and `ReadOnlyConfig`.

Example 

```
databricks bundle validate -p deco-staging
Warning: unknown field: new_cluster
  at resources.jobs.my_job
  in bundle.yml:24:7

Warning: job_cluster_key high_cpu_workload_job_cluster is not defined
  at resources.jobs.my_job.tasks[0].job_cluster_key
  in bundle.yml:35:28

Warning: There are no files to sync, please check your your .gitignore and sync.exclude configuration
  at sync.exclude
  in bundle.yml:18:5

Name: test
Target: default
Workspace:
  Host: https://acme.databricks.com
  User: andrew.nester@databricks.com
  Path: /Users/andrew.nester@databricks.com/.bundle/test/default

Found 3 warnings
```

## Tests
Added unit tests
2024-04-18 15:13:16 +00:00
..
files Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
lock Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
metadata Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0 (#1326) 2024-04-03 10:39:53 +00:00
terraform Add docker images for the CLI (#1353) 2024-04-12 15:22:30 +00:00
check_running_resources.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
check_running_resources_test.go Added warning when trying to deploy bundle with `--fail-if-running` and running resources (#1163) 2024-02-07 11:17:17 +00:00
filer.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state_pull.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
state_pull_test.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
state_push.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_push_test.go Move path field to bundle type (#1316) 2024-03-27 09:03:24 +00:00
state_test.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state_update.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
state_update_test.go Move path field to bundle type (#1316) 2024-03-27 09:03:24 +00:00