databricks-cli/bundle/deploy
Pieter Noordhuis 424499ec1d
Abstract over filesystem interaction with libs/vfs (#1452)
## Changes

Introduce `libs/vfs` for an implementation of `fs.FS` and friends that
_includes_ the absolute path it is anchored to.

This is needed for:
1. Intercepting file operations to inject custom logic (e.g., logging,
access control).
2. Traversing directories to find specific leaf directories (e.g.,
`.git`).
3. Converting virtual paths to OS-native paths.

Options 2 and 3 are not possible with the standard `fs.FS` interface.
They are needed such that we can provide an instance to the sync package
and still detect the containing `.git` directory and convert paths to
native paths.

This change focuses on making the following packages use `vfs.Path`:
* libs/fileset
* libs/git
* libs/sync

All entries returned by `fileset.All` are now slash-separated. This has
2 consequences:
* The sync snapshot now always uses slash-separated paths
* We don't need to call `filepath.FromSlash` as much as we did

## Tests

* All unit tests pass
* All integration tests pass
* Manually confirmed that a deployment made on Windows by a previous
version of the CLI can be deployed by a new version of the CLI while
retaining the validity of the local sync snapshot as well as the remote
deployment state.
2024-05-30 07:41:50 +00:00
..
files Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
lock Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
metadata Annotate DLT pipelines when deployed using DABs (#1410) 2024-05-01 08:37:03 +00:00
terraform Don't merge-in remote resources during depolyments (#1432) 2024-05-15 12:41:44 +00:00
filer.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +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 Update `testutil` helpers to return path (#1383) 2024-04-19 15:05:36 +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 Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +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