From b599bd12c3c56068fcc6f77fbd25f86adf33045f Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 12 Jun 2026 14:29:32 +0200 Subject: [PATCH] Remove stale staticcheck nolint directives for workspace methods These `//nolint:staticcheck // Deprecated in SDK v0.127.0` directives suppressed SA1019 on Workspace methods (GetStatusByPath, MkdirsByPath, ListAll, Delete, Mkdirs). The SDK marked these deprecated in v0.127.0, but reverted it in v0.129.0 (databricks/databricks-sdk-go#1644). We are now on v0.141.0, so the directives have been dead for many releases. Co-authored-by: Isaac --- acceptance/dbr_test.go | 6 +++--- bundle/config/validate/folder_permissions.go | 2 +- bundle/deploy/files/delete.go | 2 +- bundle/deploy/resource_path_mkdir.go | 2 +- bundle/direct/dresources/all_test.go | 2 +- bundle/direct/dresources/dashboard.go | 2 +- bundle/direct/dresources/genie_space.go | 2 +- bundle/generate/downloader.go | 6 +++--- bundle/permissions/workspace_root.go | 2 +- bundle/phases/destroy.go | 2 +- cmd/apps/import.go | 2 +- cmd/bundle/generate/dashboard.go | 4 ++-- cmd/sync/completion.go | 2 +- cmd/workspace/repos/overrides.go | 2 +- experimental/ssh/internal/client/client.go | 2 +- .../assumptions/dashboard_assumptions_test.go | 2 +- integration/cmd/sync/sync_test.go | 14 +++++++------- integration/internal/acc/fixtures.go | 4 ++-- integration/libs/git/git_fetch_test.go | 2 +- libs/filer/workspace_files_client.go | 8 ++++---- libs/sync/path.go | 8 ++++---- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/acceptance/dbr_test.go b/acceptance/dbr_test.go index 4a264eecd53..7d182f971a8 100644 --- a/acceptance/dbr_test.go +++ b/acceptance/dbr_test.go @@ -86,7 +86,7 @@ func setupDbrTestDir(ctx context.Context, t *testing.T, uniqueID string) (*datab // API path (without /Workspace prefix) for workspace API calls. apiPath := path.Join("/Users", currentUser.UserName, "dbr-acceptance-test", uniqueID) - err = w.Workspace.MkdirsByPath(ctx, apiPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = w.Workspace.MkdirsByPath(ctx, apiPath) require.NoError(t, err) // Note: We do not cleanup test directories created here. They are kept around @@ -186,7 +186,7 @@ func runDbrTests(ctx context.Context, t *testing.T, w *databricks.WorkspaceClien // Create debug logs directory debugLogsDir := path.Join("/Users", currentUser.UserName, "dbr_acceptance_tests") - err = w.Workspace.MkdirsByPath(ctx, debugLogsDir) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = w.Workspace.MkdirsByPath(ctx, debugLogsDir) require.NoError(t, err) // Create an empty debug log file so we can get its URL before the job runs. @@ -205,7 +205,7 @@ func runDbrTests(ctx context.Context, t *testing.T, w *databricks.WorkspaceClien require.NoError(t, err) // Get the file's object ID for the URL - debugLogStatus, err := w.Workspace.GetStatusByPath(ctx, debugLogPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + debugLogStatus, err := w.Workspace.GetStatusByPath(ctx, debugLogPath) require.NoError(t, err) // Build cloud test parameters (Cloud=true tests, run with CLOUD_ENV set) diff --git a/bundle/config/validate/folder_permissions.go b/bundle/config/validate/folder_permissions.go index 7ea2ee8cee8..906b91a0a53 100644 --- a/bundle/config/validate/folder_permissions.go +++ b/bundle/config/validate/folder_permissions.go @@ -73,7 +73,7 @@ func checkFolderPermission(ctx context.Context, b *bundle.Bundle, folderPath str func getClosestExistingObject(ctx context.Context, w workspace.WorkspaceInterface, folderPath string) (*workspace.ObjectInfo, error) { for { - obj, err := w.GetStatusByPath(ctx, folderPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + obj, err := w.GetStatusByPath(ctx, folderPath) if err == nil { return obj, nil } diff --git a/bundle/deploy/files/delete.go b/bundle/deploy/files/delete.go index 921a4d2f31e..aab6cca9acc 100644 --- a/bundle/deploy/files/delete.go +++ b/bundle/deploy/files/delete.go @@ -23,7 +23,7 @@ func (m *delete) Name() string { func (m *delete) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics { cmdio.LogString(ctx, "Deleting files...") - err := b.WorkspaceClient(ctx).Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := b.WorkspaceClient(ctx).Workspace.Delete(ctx, workspace.Delete{ Path: b.Config.Workspace.RootPath, Recursive: true, }) diff --git a/bundle/deploy/resource_path_mkdir.go b/bundle/deploy/resource_path_mkdir.go index c697fd30dea..5c41a270a80 100644 --- a/bundle/deploy/resource_path_mkdir.go +++ b/bundle/deploy/resource_path_mkdir.go @@ -28,7 +28,7 @@ func (m *resourcePathMkdir) Apply(ctx context.Context, b *bundle.Bundle) diag.Di w := b.WorkspaceClient(ctx) // Optimisitcally create the resource path. If it already exists ignore the error. - err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath) if aerr, ok := errors.AsType[*apierr.APIError](err); ok && aerr.ErrorCode == "RESOURCE_ALREADY_EXISTS" { return nil } diff --git a/bundle/direct/dresources/all_test.go b/bundle/direct/dresources/all_test.go index 30adb4640cc..fbb234a4a11 100644 --- a/bundle/direct/dresources/all_test.go +++ b/bundle/direct/dresources/all_test.go @@ -479,7 +479,7 @@ var testDeps = map[string]prepareWorkspace{ parentPath := "/Workspace/Users/user@example.com" // Create parent directory if it doesn't exist - err := client.Workspace.MkdirsByPath(ctx, parentPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := client.Workspace.MkdirsByPath(ctx, parentPath) if err != nil { return nil, err } diff --git a/bundle/direct/dresources/dashboard.go b/bundle/direct/dresources/dashboard.go index dbf492a0bee..06cbca8a933 100644 --- a/bundle/direct/dresources/dashboard.go +++ b/bundle/direct/dresources/dashboard.go @@ -281,7 +281,7 @@ func (r *ResourceDashboard) DoCreate(ctx context.Context, config *DashboardState // The API returns 404 if the parent directory doesn't exist. // If the parent directory doesn't exist, create it and try again. if err != nil && apierr.IsMissing(err) { - err = r.client.Workspace.MkdirsByPath(ctx, config.ParentPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = r.client.Workspace.MkdirsByPath(ctx, config.ParentPath) if err != nil { return "", nil, fmt.Errorf("failed to create parent directory: %w", err) } diff --git a/bundle/direct/dresources/genie_space.go b/bundle/direct/dresources/genie_space.go index 16aa0a57e8a..21d2c632409 100644 --- a/bundle/direct/dresources/genie_space.go +++ b/bundle/direct/dresources/genie_space.go @@ -158,7 +158,7 @@ func (r *ResourceGenieSpace) DoCreate(ctx context.Context, config *resources.Gen // error or as INVALID_PARAMETER_VALUE with a "Tree node ... does not exist" // message depending on the backend. if err != nil && isMissingGenieParentPathError(err) { - err = r.client.Workspace.MkdirsByPath(ctx, config.ParentPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = r.client.Workspace.MkdirsByPath(ctx, config.ParentPath) if err != nil { return "", nil, fmt.Errorf("failed to create parent directory: %w", err) } diff --git a/bundle/generate/downloader.go b/bundle/generate/downloader.go index acfef1ff3db..c0d7a79e1ed 100644 --- a/bundle/generate/downloader.go +++ b/bundle/generate/downloader.go @@ -57,7 +57,7 @@ func (n *Downloader) MarkPipelineLibraryForDownload(ctx context.Context, lib *pi } func (n *Downloader) markFileForDownload(ctx context.Context, filePath *string) error { - _, err := n.w.Workspace.GetStatusByPath(ctx, *filePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + _, err := n.w.Workspace.GetStatusByPath(ctx, *filePath) if err != nil { return err } @@ -80,7 +80,7 @@ func (n *Downloader) markFileForDownload(ctx context.Context, filePath *string) } func (n *Downloader) MarkDirectoryForDownload(ctx context.Context, dirPath *string) error { - _, err := n.w.Workspace.GetStatusByPath(ctx, *dirPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + _, err := n.w.Workspace.GetStatusByPath(ctx, *dirPath) if err != nil { return err } @@ -120,7 +120,7 @@ func (n *Downloader) MarkDirectoryForDownload(ctx context.Context, dirPath *stri func (n *Downloader) recursiveListWithExclusions(ctx context.Context, dirPath string) ([]workspace.ObjectInfo, error) { var result []workspace.ObjectInfo - objects, err := n.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + objects, err := n.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ Path: dirPath, }) if err != nil { diff --git a/bundle/permissions/workspace_root.go b/bundle/permissions/workspace_root.go index 78b9bfd704a..aa412137810 100644 --- a/bundle/permissions/workspace_root.go +++ b/bundle/permissions/workspace_root.go @@ -73,7 +73,7 @@ func setPermissions(ctx context.Context, w workspace.WorkspaceInterface, path st return nil } - obj, err := w.GetStatusByPath(ctx, path) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + obj, err := w.GetStatusByPath(ctx, path) if err != nil { return err } diff --git a/bundle/phases/destroy.go b/bundle/phases/destroy.go index 5cd735a6302..b75e1e7b5a4 100644 --- a/bundle/phases/destroy.go +++ b/bundle/phases/destroy.go @@ -22,7 +22,7 @@ import ( func assertRootPathExists(ctx context.Context, b *bundle.Bundle) (bool, error) { w := b.WorkspaceClient(ctx) - _, err := w.Workspace.GetStatusByPath(ctx, b.Config.Workspace.RootPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + _, err := w.Workspace.GetStatusByPath(ctx, b.Config.Workspace.RootPath) if aerr, ok := errors.AsType[*apierr.APIError](err); ok && aerr.StatusCode == http.StatusNotFound { log.Infof(ctx, "Root path does not exist: %s", b.Config.Workspace.RootPath) diff --git a/cmd/apps/import.go b/cmd/apps/import.go index 42f9da4ec14..f22693277ce 100644 --- a/cmd/apps/import.go +++ b/cmd/apps/import.go @@ -197,7 +197,7 @@ Examples: cmdio.LogString(ctx, "Cleaning up previous app folder") } - err = w.Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = w.Workspace.Delete(ctx, workspace.Delete{ Path: oldSourceCodePath, Recursive: true, }) diff --git a/cmd/bundle/generate/dashboard.go b/cmd/bundle/generate/dashboard.go index b6b01e8c528..9675d3ff64b 100644 --- a/cmd/bundle/generate/dashboard.go +++ b/cmd/bundle/generate/dashboard.go @@ -85,7 +85,7 @@ func (d *dashboard) resolveID(ctx context.Context, b *bundle.Bundle) string { func (d *dashboard) resolveFromPath(ctx context.Context, b *bundle.Bundle) string { w := b.WorkspaceClient(ctx) - obj, err := w.Workspace.GetStatusByPath(ctx, d.existingPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + obj, err := w.Workspace.GetStatusByPath(ctx, d.existingPath) if err != nil { if apierr.IsMissing(err) { logdiag.LogError(ctx, fmt.Errorf("dashboard %q not found", path.Base(d.existingPath))) @@ -263,7 +263,7 @@ func waitForChanges(ctx context.Context, w *databricks.WorkspaceClient, dashboar } for { - obj, err := w.Workspace.GetStatusByPath(ctx, dashboard.Path) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + obj, err := w.Workspace.GetStatusByPath(ctx, dashboard.Path) if err != nil { logdiag.LogError(ctx, err) return diff --git a/cmd/sync/completion.go b/cmd/sync/completion.go index bc34c1581ac..c82d85a1c38 100644 --- a/cmd/sync/completion.go +++ b/cmd/sync/completion.go @@ -18,7 +18,7 @@ func fetchDirs(ctx context.Context, wsc *databricks.WorkspaceClient, path string go func() { defer close(ch) - files, err := wsc.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + files, err := wsc.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ Path: path, }) if err != nil { diff --git a/cmd/workspace/repos/overrides.go b/cmd/workspace/repos/overrides.go index 17ef8111ba0..72f58bb5010 100644 --- a/cmd/workspace/repos/overrides.go +++ b/cmd/workspace/repos/overrides.go @@ -167,7 +167,7 @@ func repoArgumentToRepoID(ctx context.Context, w *databricks.WorkspaceClient, ar } // If the argument cannot be parsed as a repo ID, try to look it up by name. - oi, err := w.Workspace.GetStatusByPath(ctx, arg) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + oi, err := w.Workspace.GetStatusByPath(ctx, arg) if err != nil { return 0, fmt.Errorf("failed to look up repo by path: %w", err) } diff --git a/experimental/ssh/internal/client/client.go b/experimental/ssh/internal/client/client.go index 00c1e05d0d0..c5d5476cc1b 100644 --- a/experimental/ssh/internal/client/client.go +++ b/experimental/ssh/internal/client/client.go @@ -499,7 +499,7 @@ func submitSSHTunnelJob(ctx context.Context, client *databricks.WorkspaceClient, return 0, fmt.Errorf("failed to get workspace content directory: %w", err) } - err = client.Workspace.MkdirsByPath(ctx, contentDir) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = client.Workspace.MkdirsByPath(ctx, contentDir) if err != nil { return 0, fmt.Errorf("failed to create directory in the remote workspace: %w", err) } diff --git a/integration/assumptions/dashboard_assumptions_test.go b/integration/assumptions/dashboard_assumptions_test.go index 7d127d10bfe..111482a6f81 100644 --- a/integration/assumptions/dashboard_assumptions_test.go +++ b/integration/assumptions/dashboard_assumptions_test.go @@ -54,7 +54,7 @@ func TestDashboardAssumptions_WorkspaceImport(t *testing.T) { // Cross-check consistency with the workspace object. { - obj, err := wt.W.Workspace.GetStatusByPath(ctx, dashboard.Path) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + obj, err := wt.W.Workspace.GetStatusByPath(ctx, dashboard.Path) require.NoError(t, err) // Confirm that the resource ID included in the response is equal to the dashboard ID. diff --git a/integration/cmd/sync/sync_test.go b/integration/cmd/sync/sync_test.go index e170c6259bc..b58d00ca2d0 100644 --- a/integration/cmd/sync/sync_test.go +++ b/integration/cmd/sync/sync_test.go @@ -126,13 +126,13 @@ func (a *syncTest) waitForCompletionMarker() { func (a *syncTest) remoteDirContent(ctx context.Context, relativeDir string, expectedFiles []string) { remoteDir := path.Join(a.remoteRoot, relativeDir) a.c.Eventually(func() bool { - objects, err := a.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + objects, err := a.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ Path: remoteDir, }) require.NoError(a.t, err) return len(objects) == len(expectedFiles) }, 30*time.Second, 5*time.Second) - objects, err := a.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + objects, err := a.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ Path: remoteDir, }) require.NoError(a.t, err) @@ -185,7 +185,7 @@ func (a *syncTest) objectType(ctx context.Context, relativePath, expected string path := path.Join(a.remoteRoot, relativePath) a.c.Eventually(func() bool { - metadata, err := a.w.Workspace.GetStatusByPath(ctx, path) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + metadata, err := a.w.Workspace.GetStatusByPath(ctx, path) if err != nil { return false } @@ -197,7 +197,7 @@ func (a *syncTest) language(ctx context.Context, relativePath, expected string) path := path.Join(a.remoteRoot, relativePath) a.c.Eventually(func() bool { - metadata, err := a.w.Workspace.GetStatusByPath(ctx, path) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + metadata, err := a.w.Workspace.GetStatusByPath(ctx, path) if err != nil { return false } @@ -518,7 +518,7 @@ func TestSyncEnsureRemotePathIsUsableIfRepoExists(t *testing.T) { assert.NoError(t, err) // Verify that the directory has been created. - info, err := wsc.Workspace.GetStatusByPath(ctx, nestedPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + info, err := wsc.Workspace.GetStatusByPath(ctx, nestedPath) require.NoError(t, err) require.Equal(t, workspace.ObjectTypeDirectory, info.ObjectType) } @@ -536,14 +536,14 @@ func TestSyncEnsureRemotePathIsUsableInWorkspace(t *testing.T) { // Clean up directory after test. defer func() { - err := wsc.Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := wsc.Workspace.Delete(ctx, workspace.Delete{ Path: remotePath, }) assert.NoError(t, err) }() // Verify that the directory has been created. - info, err := wsc.Workspace.GetStatusByPath(ctx, remotePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + info, err := wsc.Workspace.GetStatusByPath(ctx, remotePath) require.NoError(t, err) require.Equal(t, workspace.ObjectTypeDirectory, info.ObjectType) } diff --git a/integration/internal/acc/fixtures.go b/integration/internal/acc/fixtures.go index 8d61a9d35da..ff1949ee6ca 100644 --- a/integration/internal/acc/fixtures.go +++ b/integration/internal/acc/fixtures.go @@ -23,13 +23,13 @@ func TemporaryWorkspaceDir(t *WorkspaceT, name ...string) string { basePath := fmt.Sprintf("/Users/%s/%s", me.UserName, testutil.RandomName(name...)) t.Logf("Creating workspace directory %s", basePath) - err = t.W.Workspace.MkdirsByPath(ctx, basePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = t.W.Workspace.MkdirsByPath(ctx, basePath) require.NoError(t, err) // Remove test directory on test completion. t.Cleanup(func() { t.Logf("Removing workspace directory %s", basePath) - err := t.W.Workspace.Delete(context.WithoutCancel(ctx), workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := t.W.Workspace.Delete(context.WithoutCancel(ctx), workspace.Delete{ Path: basePath, Recursive: true, }) diff --git a/integration/libs/git/git_fetch_test.go b/integration/libs/git/git_fetch_test.go index 69c42a74e9f..95ca99eec30 100644 --- a/integration/libs/git/git_fetch_test.go +++ b/integration/libs/git/git_fetch_test.go @@ -72,7 +72,7 @@ func TestFetchRepositoryInfoAPI_FromNonRepo(t *testing.T) { rootPath := ensureWorkspacePrefix(acc.TemporaryWorkspaceDir(wt, "testing-nonrepo-")) // Create directory inside this root path (this is cleaned up as part of the root path). - err := wt.W.Workspace.MkdirsByPath(ctx, path.Join(rootPath, "a/b/c")) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err := wt.W.Workspace.MkdirsByPath(ctx, path.Join(rootPath, "a/b/c")) require.NoError(t, err) ctx = dbr.MockRuntime(ctx, dbr.Environment{IsDbr: true, Version: "15.4"}) diff --git a/libs/filer/workspace_files_client.go b/libs/filer/workspace_files_client.go index 6e54f5b4d97..5d88f858a05 100644 --- a/libs/filer/workspace_files_client.go +++ b/libs/filer/workspace_files_client.go @@ -188,7 +188,7 @@ func (w *WorkspaceFilesClient) Write(ctx context.Context, name string, reader io } // Create parent directory. - err = w.workspaceClient.Workspace.MkdirsByPath(ctx, path.Dir(absPath)) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = w.workspaceClient.Workspace.MkdirsByPath(ctx, path.Dir(absPath)) if err != nil { if mkdirErr, ok := errors.AsType[*apierr.APIError](err); ok && mkdirErr.StatusCode == http.StatusForbidden { return permissionError{absPath} @@ -260,7 +260,7 @@ func (w *WorkspaceFilesClient) Delete(ctx context.Context, name string, mode ... recursive := slices.Contains(mode, DeleteRecursively) - err = w.workspaceClient.Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = w.workspaceClient.Workspace.Delete(ctx, workspace.Delete{ Path: absPath, Recursive: recursive, }) @@ -294,7 +294,7 @@ func (w *WorkspaceFilesClient) ReadDir(ctx context.Context, name string) ([]fs.D return nil, err } - objects, err := w.workspaceClient.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + objects, err := w.workspaceClient.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ Path: absPath, }) @@ -326,7 +326,7 @@ func (w *WorkspaceFilesClient) Mkdir(ctx context.Context, name string) error { if err != nil { return err } - return w.workspaceClient.Workspace.Mkdirs(ctx, workspace.Mkdirs{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + return w.workspaceClient.Workspace.Mkdirs(ctx, workspace.Mkdirs{ Path: dirPath, }) } diff --git a/libs/sync/path.go b/libs/sync/path.go index f98099d2b81..6b60ef682de 100644 --- a/libs/sync/path.go +++ b/libs/sync/path.go @@ -40,7 +40,7 @@ func EnsureRemotePathIsUsable(ctx context.Context, wsc *databricks.WorkspaceClie // Ensure that the remote path exists. // If it is a repo, it has to exist. // If it is a workspace path, it may not exist. - info, err := wsc.Workspace.GetStatusByPath(ctx, remotePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + info, err := wsc.Workspace.GetStatusByPath(ctx, remotePath) if err != nil { // We only deal with 404s below. if !apierr.IsMissing(err) { @@ -50,7 +50,7 @@ func EnsureRemotePathIsUsable(ctx context.Context, wsc *databricks.WorkspaceClie // If the path is nested under a repo, the repo has to exist. if strings.HasPrefix(remotePath, "/Repos/") { repoPath := repoPathForPath(me, remotePath) - _, err = wsc.Workspace.GetStatusByPath(ctx, repoPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + _, err = wsc.Workspace.GetStatusByPath(ctx, repoPath) if err != nil && apierr.IsMissing(err) { return fmt.Errorf("%s does not exist; please create it first", repoPath) } @@ -62,11 +62,11 @@ func EnsureRemotePathIsUsable(ctx context.Context, wsc *databricks.WorkspaceClie } // The workspace path doesn't exist. Create it and try again. - err = wsc.Workspace.MkdirsByPath(ctx, remotePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + err = wsc.Workspace.MkdirsByPath(ctx, remotePath) if err != nil { return fmt.Errorf("unable to create directory at %s: %w", remotePath, err) } - info, err = wsc.Workspace.GetStatusByPath(ctx, remotePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately. + info, err = wsc.Workspace.GetStatusByPath(ctx, remotePath) if err != nil { return err }