databricks-cli/bundle/libraries
Pieter Noordhuis 33c446dadd
Refactor library to artifact matching to not use pointers (#1172)
## Changes

The approach to do this was:
1. Iterate over all libraries in all job tasks
2. Find references to local libraries
3. Store pointer to `compute.Library` in the matching artifact file to
signal it should be uploaded

This breaks down when introducing #1098 because we can no longer track
unexported state across mutators. The approach in this PR performs the
path matching twice; once in the matching mutator where we check if each
referenced file has an artifacts section, and once during artifact
upload to rewrite the library path from a local file reference to an
absolute Databricks path.

## Tests

Integration tests pass.
2024-02-05 15:29:45 +00:00
..
testdata Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
helpers.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
helpers_test.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
libraries.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
libraries_test.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
local_path.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
local_path_test.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
match.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
match_test.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
workspace_path.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00
workspace_path_test.go Refactor library to artifact matching to not use pointers (#1172) 2024-02-05 15:29:45 +00:00