databricks-cli/cmd/bundle
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
..
debug Add `bundle debug terraform` command (#1294) 2024-04-02 12:56:27 +00:00
deployment Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
generate Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0 (#1326) 2024-04-03 10:39:53 +00:00
utils Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
bundle.go Add `bundle debug terraform` command (#1294) 2024-04-02 12:56:27 +00:00
debug.go Add `bundle debug terraform` command (#1294) 2024-04-02 12:56:27 +00:00
deploy.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
destroy.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
generate.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
init.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
init_test.go Improve experience for multiple builtin templates (#1052) 2023-12-27 12:03:08 +00:00
launch.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
run.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
schema.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
summary.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
sync.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
test.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
validate.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
variables.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00