databricks-cli/bundle/config
shreyas-goenka 4bf88b4209
Support multiple locations for diagnostics (#1610)
## Changes
This PR changes `diag.Diagnostics` to allow including multiple locations
associated with the diagnostic message. The diagnostics that now return
multiple locations with this PR are:
1. Warning for unknown keys in config.
2. Use of experimental.run_as
3. Accidental sync.exludes that exclude all files.

## Tests
Existing unit tests pass. New unit test case to assert on error message
when multiple locations are included.

Example output:
```
➜  bundle-playground-2 ~/cli2/cli/cli bundle validate              
Warning: You are using the legacy mode of run_as. The support for this mode is experimental and might be removed in a future release of the CLI. In order to run the DLT pipelines in your DAB as the run_as user this mode changes the owners of the pipelines to the run_as identity, which requires the user deploying the bundle to be a workspace admin, and also a Metastore admin if the pipeline target is in UC.
  at experimental.use_legacy_run_as
  in resources.yml:10:22
     databricks.yml:13:22

Name: fix run_if
Target: default
Workspace:
  User: shreyas.goenka@databricks.com
  Path: /Users/shreyas.goenka@databricks.com/.bundle/fix run_if/default

Found 1 warning
```
2024-07-23 17:20:11 +00:00
..
generate Track multiple locations associated with a `dyn.Value` (#1510) 2024-07-16 11:27:27 +00:00
loader Return diagnostics from `config.Load` (#1324) 2024-03-28 10:59:03 +00:00
mutator Support multiple locations for diagnostics (#1610) 2024-07-23 17:20:11 +00:00
paths Remove dependency on `ConfigFilePath` from path translation mutator (#1437) 2024-05-17 09:26:09 +00:00
resources Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
testdata First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
validate Support multiple locations for diagnostics (#1610) 2024-07-23 17:20:11 +00:00
variable Added support for complex variables (#1467) 2024-06-26 10:25:32 +00:00
artifact.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
artifacts_test.go Added exec.NewCommandExecutor to execute commands with correct interpreter (#1075) 2023-12-21 15:45:23 +00:00
bundle.go Allow specifying CLI version constraints required to run the bundle (#1320) 2024-04-02 12:55:21 +00:00
deployment.go Disable locking for development mode (#1302) 2024-04-18 01:59:39 +00:00
experimental.go Add ApplyPythonMutator (#1430) 2024-06-20 08:43:08 +00:00
filename.go Move bundle configuration filename code (#917) 2023-10-25 09:54:39 +00:00
filename_test.go Move bundle configuration filename code (#917) 2023-10-25 09:54:39 +00:00
git.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
lock.go Disable locking for development mode (#1302) 2024-04-18 01:59:39 +00:00
lock_test.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
resources.go Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
resources_test.go Assert customer marshalling is implemented for resources (#1425) 2024-05-14 10:30:48 +00:00
root.go Support multiple locations for diagnostics (#1610) 2024-07-23 17:20:11 +00:00
root_test.go Override complex variables with target overrides instead of merging (#1567) 2024-07-04 11:57:29 +00:00
sync.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
target.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
workspace.go Added `auth describe` command (#1244) 2024-04-03 08:14:04 +00:00
workspace_test.go Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00