databricks-cli/bundle/libraries
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
..
testdata Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
expand_glob_references.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
expand_glob_references_test.go Modify SetLocation test utility to take full locations as argument (#1788) 2024-09-25 16:13:48 +00:00
filer.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
filer_test.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
filer_volume.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
filer_volume_test.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30
filer_workspace.go Add DABs support for Unity Catalog volumes (#1762) 2024-12-02 21:18:07 +00:00
filer_workspace_test.go Add DABs support for Unity Catalog volumes (#1762) 2024-12-02 21:18:07 +00:00
helpers.go Do not treat empty path as a local path (#1717) 2024-08-26 10:03:56 +00:00
helpers_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
libraries.go Do not treat empty path as a local path (#1717) 2024-08-26 10:03:56 +00:00
local_path.go Added support for pip options in environment dependencies (#1842) 2024-10-21 11:45:39 +00:00
local_path_test.go Correctly mark PyPI package name specs with multiple specifiers as remote libraries (#1725) 2024-08-28 11:39:06 +00:00
match_test.go Expand library globs relative to the sync root (#1756) 2024-09-09 09:56:16 +00:00
path.go Use SetPermissions instead of UpdatePermissions when setting folder permissions based on top-level ones (#1822) 2024-10-29 12:06:38 +00:00
path_test.go Added validator for folder permissions (#1824) 2024-10-24 12:36:17 +00:00
upload.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
upload_test.go Add validation mutator for volume `artifact_path` (#2050) 2025-01-02 17:23:15 +05:30