change link to docs page

This commit is contained in:
Andrew Nester 2024-09-16 16:40:11 +02:00
parent c80e8984df
commit b2a77c1b64
No known key found for this signature in database
GPG Key ID: 12BC628A44B7DA57
3 changed files with 4 additions and 21 deletions

View File

@ -44,7 +44,7 @@ func (m *rewriteWorkspacePrefix) Apply(ctx context.Context, b *bundle.Bundle) di
if strings.Contains(vv, path) {
diags = append(diags, diag.Diagnostic{
Severity: diag.Warning,
Summary: fmt.Sprintf("substring %q found in %q. Please update this to %q. For more information, please refer to: https://github.com/databricks/cli/blob/main/docs/release_notes/workspace_prefix.md", path, vv, strings.Replace(vv, "/Workspace/", "", 1)),
Summary: fmt.Sprintf("substring %q found in %q. Please update this to %q. For more information, please refer to: https://docs.databricks.com/en/release-notes/bundles.html#workspace-paths-will-be-automatically-prefixed", path, vv, strings.Replace(vv, "/Workspace/", "", 1)),
Locations: v.Locations(),
Paths: []dyn.Path{p},
})

View File

@ -65,9 +65,9 @@ func TestNoWorkspacePrefixUsed(t *testing.T) {
require.Len(t, diags, 3)
expectedErrors := map[string]bool{
`substring "/Workspace/${workspace.root_path}" found in "/Workspace/${workspace.root_path}/file1.py". Please update this to "${workspace.root_path}/file1.py". For more information, please refer to: https://github.com/databricks/cli/blob/main/docs/release_notes/workspace_prefix.md`: true,
`substring "/Workspace/${workspace.file_path}" found in "/Workspace/${workspace.file_path}/notebook1". Please update this to "${workspace.file_path}/notebook1". For more information, please refer to: https://github.com/databricks/cli/blob/main/docs/release_notes/workspace_prefix.md`: true,
`substring "/Workspace/${workspace.artifact_path}" found in "/Workspace/${workspace.artifact_path}/jar1.jar". Please update this to "${workspace.artifact_path}/jar1.jar". For more information, please refer to: https://github.com/databricks/cli/blob/main/docs/release_notes/workspace_prefix.md`: true,
`substring "/Workspace/${workspace.root_path}" found in "/Workspace/${workspace.root_path}/file1.py". Please update this to "${workspace.root_path}/file1.py". For more information, please refer to: https://docs.databricks.com/en/release-notes/bundles.html#workspace-paths-will-be-automatically-prefixed`: true,
`substring "/Workspace/${workspace.file_path}" found in "/Workspace/${workspace.file_path}/notebook1". Please update this to "${workspace.file_path}/notebook1". For more information, please refer to: https://docs.databricks.com/en/release-notes/bundles.html#workspace-paths-will-be-automatically-prefixed`: true,
`substring "/Workspace/${workspace.artifact_path}" found in "/Workspace/${workspace.artifact_path}/jar1.jar". Please update this to "${workspace.artifact_path}/jar1.jar". For more information, please refer to: https://docs.databricks.com/en/release-notes/bundles.html#workspace-paths-will-be-automatically-prefixed`: true,
}
for _, d := range diags {

View File

@ -1,17 +0,0 @@
## /Workspace prefix
This PR (https://github.com/databricks/cli/pull/1724) introduced the following changes:
1. Default remote bundle paths became automatically prefixed with /Workspace prefix
2. All usage of path strings like `/Workspace/${workspace.root_path}/...` and etc. in bundle configuration now automatically replaced with `${workspace.root_path}/...` and generates a warning as part of `bundle validate`
If users have specified a custom `workspace.{root,artifact,file,state}_path`, then DABs will automatically ensure it is prefixed with /Workspace.
This also means that if they use any of these as variables (for example, `my_config_path: /Workspace/${workspace.file_path}/config`), then theyll need to update those entries to remove the `/Workspace` prefix to avoid the warning.
If they pass along one of these as variables and prefix them in their code, theyll need to update their code to no longer do this.
The reason for this is the following:
Historically, the workspace file system was rooted at `/`, with home directories under `/Users`, for example.
To access workspace paths through the API you would use these paths directly. To access workspace paths from your code, you could use the `/Workspace` file path that mounts the workspace file system on Databricks clusters. Home directories were available under `/Workspace/Users`. This duality proved inconvenient, and with the introduction of UC volumes it even became ambiguous (UC volumes are accessible under `/Volumes` ). To avoid both the duality of workspace paths and as well as ambiguity between workspace paths and UC volume paths, were now prefixing all workspace paths with `/Workspace`. This means they no longer need to be manually prefixed to be used as a POSIX path (e.g. to open a file from Python), nor is there ambiguity between workspace paths and UC volume paths.