databricks-cli/bundle/config/validate
shreyas-goenka 7beb0fb8b5
Add validation mutator for volume `artifact_path` (#2050)
## Changes
This PR:
1. Incrementally improves the error messages shown to the user when the
volume they are referring to in `workspace.artifact_path` does not
exist.
2. Performs this validation in both `bundle validate` and `bundle
deploy` compared to before on just deployments.
3. It runs "fast" validations on `bundle deploy`, which earlier were
only run on `bundle validate`.


## Tests
Unit tests and manually. Also, existing integration tests provide
coverage (`TestUploadArtifactToVolumeNotYetDeployed`,
`TestUploadArtifactFileToVolumeThatDoesNotExist`)

Examples:
```
.venv➜  bundle-playground git:(master) ✗ cli bundle validate
Error: cannot access volume capital.whatever.my_volume: User does not have READ VOLUME on Volume 'capital.whatever.my_volume'.
  at workspace.artifact_path
  in databricks.yml:7:18
```

and

```
.venv➜  bundle-playground git:(master) ✗ cli bundle validate
Error: volume capital.whatever.foobar does not exist
  at workspace.artifact_path
     resources.volumes.foo
  in databricks.yml:7:18
     databricks.yml:12:7

You are using a volume in your artifact_path that is managed by
this bundle but which has not been deployed yet. Please first deploy
the volume using 'bundle deploy' and then switch over to using it in
the artifact_path.
```
2025-01-02 17:23:15 +05:30
..
all_resources_have_values.go Report all empty resources present in error diagnostic (#1685) 2024-08-20 00:22:00 +00:00
fast_validate.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
files_to_sync.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
files_to_sync_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
folder_permissions.go Fix lost diags across different mutators (#2057) 2024-12-31 14:01:45 +00:00
folder_permissions_test.go Added validator for folder permissions (#1824) 2024-10-24 12:36:17 +00:00
job_cluster_key_defined.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
job_cluster_key_defined_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
job_task_cluster_spec.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
job_task_cluster_spec_test.go Add JobTaskClusterSpec validate mutator (#1784) 2024-09-25 11:30:14 +00:00
single_node_cluster.go Add validation for single node clusters (#1909) 2024-11-22 15:48:09 +00:00
single_node_cluster_test.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
unique_resource_keys.go Pass copy of `dyn.Path` to callback function (#1747) 2024-09-05 11:05:16 +00:00
validate.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
validate_artifact_path.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
validate_artifact_path_test.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
validate_sync_patterns.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00