databricks-cli/libs/template
Pieter Noordhuis 75b09ff230
Use `filer.Filer` to write template instantiation (#1911)
## Changes

Prior to this change, the output directory was part of the `renderer`
type and passed down to every `file` it produced. Every file knew its
absolute destination path. This is incompatible with the use of a filer,
where all operations are automatically anchored to some base path.

To make this compatible, this change updates:
* the `file` type to only know its own path relative to the instantiation root,
* the `renderer` type to no longer require or pass along the output directory,
* the `persistToDisk` function to take a context and filer argument,
* the `filer.WriteMode` to represent permission bits

## Tests

* Existing tests pass.
* Manually confirmed template initialization works as expected.
2024-11-20 11:11:31 +01:00
..
templates Fix pipeline in default-python template not working for certain workspaces (#1854) 2024-10-22 15:52:46 +00:00
testdata Fix ability to import the CLI repository as module (#1671) 2024-08-12 14:20:04 +00:00
builtin.go Use `fs.FS` interface to read template (#1910) 2024-11-20 09:28:35 +00:00
builtin_test.go Use `fs.FS` interface to read template (#1910) 2024-11-20 09:28:35 +00:00
config.go Use `fs.FS` interface to read template (#1910) 2024-11-20 09:28:35 +00:00
config_test.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
file.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
file_test.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
helpers.go Ignore metastore permission error during template generation (#1819) 2024-10-11 12:28:56 +00:00
helpers_test.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
materialize.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
materialize_test.go Use `fs.FS` interface to read template (#1910) 2024-11-20 09:28:35 +00:00
renderer.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
renderer_test.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00