databricks-cli/bundle/config/mutator
Pieter Noordhuis 5d9bc3b553
Allow artifact path to be located outside the sync root (#2128)
## Changes

We perform a check during path translation that the path being
referenced is contained in the bundle's sync root. If it isn't, it's not
a valid remote reference. However, this doesn't apply to paths that are
_always_ local, such as the artifact path. An artifact's build command
is executed in its path. Files created by the artifact build (e.g.
wheels or JARs) don't need to be in the sync root because they have a
dedicated and different upload path into `${workspace.artifact_path}`.

Therefore, this check that a path is contained in the bundle's sync root
doesn't apply to artifact paths. This change modifies the structure of
path translation to allow opting out of this check.

Fixes #1927.

## Tests

* Existing and new tests pass.
* Manually confirmed that building and using a wheel built outside the
sync root path works as expected.
* No acceptance tests because we don't run build as part of validate.
2025-01-14 08:34:55 +00:00
..
paths Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
python Add 'experimental/python' support (#2052) 2025-01-08 09:29:45 +00:00
apply_presets.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
apply_presets_test.go Handle `${workspace.file_path}` references in source-linked deployments (#2046) 2025-01-08 12:43:56 +00:00
apply_source_linked_deployment_preset.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
apply_source_linked_deployment_preset_test.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
compute_id_compat.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
compute_id_compate_test.go Added support for creating all-purpose clusters (#1698) 2024-09-23 10:42:34 +00:00
configure_dashboard_defaults.go Add support for AI/BI dashboards (#1743) 2024-10-29 09:11:08 +00:00
configure_dashboard_defaults_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
configure_volume_defaults.go Add default value for `volume_type` for DABs (#1952) 2024-12-04 11:05:54 +00:00
configure_volume_defaults_test.go Add default value for `volume_type` for DABs (#1952) 2024-12-04 11:05:54 +00:00
configure_wsfs.go Extract functionality to detect if the CLI is running on DBR (#1889) 2024-11-14 16:10:45 +00:00
configure_wsfs_test.go Extract functionality to detect if the CLI is running on DBR (#1889) 2024-11-14 16:10:45 +00:00
default_queueing.go Enable job queueing by default (#1385) 2024-04-22 10:36:39 +00:00
default_queueing_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
default_target.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
default_target_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
default_workspace_paths.go Add resource path field to bundle workspace configuration (#1800) 2024-10-02 13:55:40 +00:00
default_workspace_paths_test.go Add resource path field to bundle workspace configuration (#1800) 2024-10-02 13:55:40 +00:00
default_workspace_root.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
default_workspace_root_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
environments_compat.go Compare `.Kind()` instead of direct equality checks on a `dyn.Value` (#1520) 2024-06-27 13:28:19 +00:00
environments_compat_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
expand_pipeline_glob_paths.go Track multiple locations associated with a `dyn.Value` (#1510) 2024-07-16 11:27:27 +00:00
expand_pipeline_glob_paths_test.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
expand_workspace_root.go Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
expand_workspace_root_test.go Always prepend bundle remote paths with /Workspace (#1724) 2024-10-02 15:34:00 +00:00
initialize_urls.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
initialize_urls_test.go Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
initialize_variables.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
initialize_variables_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
initialize_workspace_client.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
load_git_details.go Switch to `folders.FindDirWithLeaf` (#1963) 2024-12-11 09:44:22 +01:00
merge_apps.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
merge_apps_test.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
merge_job_clusters.go Compare `.Kind()` instead of direct equality checks on a `dyn.Value` (#1520) 2024-06-27 13:28:19 +00:00
merge_job_clusters_test.go Bump github.com/databricks/databricks-sdk-go from 0.36.0 to 0.37.0 (#1326) 2024-04-03 10:39:53 +00:00
merge_job_parameters.go Merge job parameters based on their name (#1659) 2024-08-06 16:12:18 +00:00
merge_job_parameters_test.go Merge job parameters based on their name (#1659) 2024-08-06 16:12:18 +00:00
merge_job_tasks.go Compare `.Kind()` instead of direct equality checks on a `dyn.Value` (#1520) 2024-06-27 13:28:19 +00:00
merge_job_tasks_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
merge_pipeline_clusters.go Compare `.Kind()` instead of direct equality checks on a `dyn.Value` (#1520) 2024-06-27 13:28:19 +00:00
merge_pipeline_clusters_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
mutator.go Move loadGitDetails mutator to Initialize phase (#1944) 2024-12-02 09:49:32 +00:00
noop.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
override_compute.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
override_compute_test.go Show an error when using a cluster override with 'mode: production' (#1994) 2024-12-11 14:57:31 +00:00
populate_current_user.go Move utility functions dealing with IAM to libs/iamutil (#1820) 2024-10-10 13:02:25 +00:00
populate_current_user_test.go Add short_name helper function to bundle init templates (#1167) 2024-02-01 16:46:07 +00:00
prepend_workspace_prefix.go Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
prepend_workspace_prefix_test.go Do not prepend paths starting with ~ or variable reference (#1905) 2024-11-15 15:03:59 +00:00
process_target_mode.go Encourage the use of root_path in production to ensure single deployment (#1712) 2025-01-13 12:19:12 +00:00
process_target_mode_test.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
resolve_resource_references.go Fix lost diags across different mutators (#2057) 2024-12-31 14:01:45 +00:00
resolve_resource_references_test.go Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
resolve_variable_references.go Handle `${workspace.file_path}` references in source-linked deployments (#2046) 2025-01-08 12:43:56 +00:00
resolve_variable_references_test.go Convert some resolve variables tests to acceptance test (#2100) 2025-01-08 17:44:52 +00:00
rewrite_sync_paths.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
rewrite_sync_paths_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
rewrite_workspace_prefix.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
rewrite_workspace_prefix_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
run_as.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
run_as_test.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
select_default_target.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
select_default_target_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
select_target.go Encourage the use of root_path in production to ensure single deployment (#1712) 2025-01-13 12:19:12 +00:00
select_target_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
set_variables.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
set_variables_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
sync_default_path.go Add paths field to bundle sync configuration (#1694) 2024-08-21 15:33:25 +00:00
sync_default_path_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
sync_infer_root.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
sync_infer_root_internal_test.go Add paths field to bundle sync configuration (#1694) 2024-08-21 15:33:25 +00:00
sync_infer_root_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
translate_paths.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_apps.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_apps_test.go Added support for Databricks Apps in DABs (#1928) 2025-01-13 16:43:48 +00:00
translate_paths_artifacts.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_artifacts_test.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_dashboards.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_dashboards_test.go Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0 (#1878) 2024-11-13 13:40:53 +00:00
translate_paths_jobs.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_pipelines.go Allow artifact path to be located outside the sync root (#2128) 2025-01-14 08:34:55 +00:00
translate_paths_test.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
validate_git_details.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
validate_git_details_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
verify_cli_version.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
verify_cli_version_test.go Ignore CLI version check on development builds of the CLI (#1714) 2024-08-23 10:13:21 +00:00