Skip to content

Commit f711183

Browse files
authored
Bump databricks-sdk-go to v0.127.0 (#4984)
## Why New SDK release [v0.127.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.127.0) is available. Notable changes include fixing a data race in concurrent credentials initialization, retry logic for token acquisition, and updated OpenAPI spec. ## Changes Standard SDK bump: `go get`, `make generate`, acceptance test golden file updates, whitespace fixes. **Diff breakdown** (the diff looks large, but almost everything is generated): ``` ┌─────────────────┬───────┬────────┬──────────────────────────────────┐ │ Area │ Files │ +Lines │ What │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ cmd/workspace │ 133 │ +3,938 │ Generated command stubs (genkit) │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ python │ 25 │ +1,115 │ Generated Python dataclasses │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ bundle/schema │ 2 │ +840 │ Generated JSON schema │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ cmd/account │ 40 │ +553 │ Generated account command stubs │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ bundle/internal │ 5 │ +371 │ Generated annotations/validation │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ acceptance │ 1 │ +145 │ Refschema golden output │ ├─────────────────┼───────┼────────┼──────────────────────────────────┤ │ Manual fixes │ ~30 │ ~110 │ Our actual code changes │ └─────────────────┴───────┴────────┴──────────────────────────────────┘ ``` **Follow-up fixes for compatibility:** - **`errNotWorkspaceClient`**: The SDK removed `databricks.ErrNotWorkspaceClient` in v0.127.0. Defined it locally in `cmd/root/auth.go` since the CLI uses it as an internal sentinel between `workspaceClientOrPrompt` and `MustAnyClient`. The SDK stopped returning this error in v0.125.0, the CLI was already synthesizing it. - **`cmdio.WithLimit`**: New genkit feature. Generated list commands now support a `--limit` flag for client-side result capping. Implemented `WithLimit` context function and wired it into iterator rendering. - **Jobs `--limit` collision**: The Jobs API names its page size field `Limit`, which collided with the new genkit `--limit` flag. Renamed the API page size to `--page-size` (hidden) for both `list` and `list-runs`. - **exhaustruct fixes**: Added new SDK fields (`ManagedEncryptionSettings`, `EffectiveFileEventQueue`, `DefaultBranch`) to direct resource struct literals. - **`config.Root` field count**: Raised the `TestTypeRoot` guard threshold from (4600, 5000) to (5000, 5500) to accommodate new API fields. - **Deprecated Workspace API (SA1019)**: SDK v0.127.0 added deprecation annotations to `Workspace` methods (`GetStatusByPath`, `MkdirsByPath`, `Delete`, `ListAll`) in favor of `WorkspaceHierarchyService`. Added `//nolint:staticcheck` to all 42 call sites. Migration to the new API will be a separate follow-up PR. ## Test plan - [x] `go build ./...` compiles clean - [x] `go test ./internal/build ./bundle/internal/schema ./bundle/direct/dresources ./bundle/config/resources` all pass - [x] `go test ./acceptance -run refschema` passes (golden output updated) - [x] `go test ./acceptance -run account-help` passes (golden output updated) - [x] `go test ./acceptance -run pipelines/databricks-cli-help` passes (golden output updated) - [x] `go test ./libs/structs/structwalk/ -run TestTypeRoot` passes (threshold raised) - [x] `go tool -modfile=tools/go.mod golangci-lint run --timeout=15m` passes (0 issues) - [x] `make checks` passes clean This pull request was AI-assisted by Isaac.
1 parent eae8085 commit f711183

243 files changed

Lines changed: 7045 additions & 456 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codegen/_openapi_sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d09dbd77f5a9560cbb816746773da43a8bdbde08
1+
11ae6f9d98f0d0838a5e53c27032f178fecc4ee0

.github/workflows/tagging.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
workflow_dispatch:
77
# No inputs are required for the manual dispatch.
88

9+
# NOTE: Temporarily disable automated releases.
10+
#
911
# Runs at 8:00 UTC on Monday, Tuesday, Wednesday, and Thursday. To enable automated
1012
# tagging for a repository, simply add it to the if block of the tag job.
11-
schedule:
12-
- cron: '0 8 * * MON,TUE,WED,THU'
13+
# schedule:
14+
# - cron: '0 8 * * MON,TUE,WED,THU'
1315

1416
# Ensure that only a single instance of the workflow is running at a time.
1517
concurrency:

NEXT_CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
### CLI
88

9+
* Added `--limit` flag to all paginated list commands for client-side result capping ([#4984](https://github.com/databricks/cli/pull/4984)).
10+
911
### Bundles
1012

1113
### Dependency updates
1214

15+
* Bump `github.com/databricks/databricks-sdk-go` from v0.126.0 to v0.127.0 ([#4984](https://github.com/databricks/cli/pull/4984)).
16+
1317
### API Changes

acceptance/bundle/refschema/out.fields.txt

Lines changed: 145 additions & 0 deletions
Large diffs are not rendered by default.

acceptance/dbr_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func setupDbrTestDir(ctx context.Context, t *testing.T, uniqueID string) (*datab
8585
// API path (without /Workspace prefix) for workspace API calls.
8686
apiPath := path.Join("/Users", currentUser.UserName, "dbr-acceptance-test", uniqueID)
8787

88-
err = w.Workspace.MkdirsByPath(ctx, apiPath)
88+
err = w.Workspace.MkdirsByPath(ctx, apiPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
8989
require.NoError(t, err)
9090

9191
// Note: We do not cleanup test directories created here. They are kept around
@@ -185,7 +185,7 @@ func runDbrTests(ctx context.Context, t *testing.T, w *databricks.WorkspaceClien
185185

186186
// Create debug logs directory
187187
debugLogsDir := path.Join("/Users", currentUser.UserName, "dbr_acceptance_tests")
188-
err = w.Workspace.MkdirsByPath(ctx, debugLogsDir)
188+
err = w.Workspace.MkdirsByPath(ctx, debugLogsDir) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
189189
require.NoError(t, err)
190190

191191
// Create an empty debug log file so we can get its URL before the job runs.
@@ -204,7 +204,7 @@ func runDbrTests(ctx context.Context, t *testing.T, w *databricks.WorkspaceClien
204204
require.NoError(t, err)
205205

206206
// Get the file's object ID for the URL
207-
debugLogStatus, err := w.Workspace.GetStatusByPath(ctx, debugLogPath)
207+
debugLogStatus, err := w.Workspace.GetStatusByPath(ctx, debugLogPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
208208
require.NoError(t, err)
209209

210210
// Build cloud test parameters (Cloud=true tests, run with CLOUD_ENV set)

acceptance/help/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Databricks Workspace
88
git-credentials Registers personal access token for Databricks to do operations on behalf of the user.
99
repos The Repos API allows users to manage their git repos.
1010
secrets The Secrets API allows you to manage secrets, secret scopes, and access permissions.
11-
workspace The Workspace API allows you to list, import, export, and delete notebooks and folders.
11+
workspace The Workspace API allows you to list, import, export, and delete workspace objects such as notebooks, files, folders, and dashboards.
1212

1313
Compute
1414
cluster-policies You can use cluster policies to control users' ability to configure clusters based on a set of rules.

acceptance/pipelines/databricks-cli-help/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Available Commands
3131
stop Stop a pipeline
3232

3333
Management Commands
34+
apply-environment Apply the latest environment to the pipeline.
3435
clone Clone a pipeline.
3536
create Create a pipeline.
3637
delete Delete a pipeline.

bundle/config/validate/folder_permissions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func checkFolderPermission(ctx context.Context, b *bundle.Bundle, folderPath str
7373

7474
func getClosestExistingObject(ctx context.Context, w workspace.WorkspaceInterface, folderPath string) (*workspace.ObjectInfo, error) {
7575
for {
76-
obj, err := w.GetStatusByPath(ctx, folderPath)
76+
obj, err := w.GetStatusByPath(ctx, folderPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
7777
if err == nil {
7878
return obj, nil
7979
}

bundle/deploy/files/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (m *delete) Name() string {
2323
func (m *delete) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
2424
cmdio.LogString(ctx, "Deleting files...")
2525

26-
err := b.WorkspaceClient().Workspace.Delete(ctx, workspace.Delete{
26+
err := b.WorkspaceClient().Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
2727
Path: b.Config.Workspace.RootPath,
2828
Recursive: true,
2929
})

bundle/deploy/resource_path_mkdir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (m *resourcePathMkdir) Apply(ctx context.Context, b *bundle.Bundle) diag.Di
2828
w := b.WorkspaceClient()
2929

3030
// Optimisitcally create the resource path. If it already exists ignore the error.
31-
err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath)
31+
err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
3232
var aerr *apierr.APIError
3333
if errors.As(err, &aerr) && aerr.ErrorCode == "RESOURCE_ALREADY_EXISTS" {
3434
return nil

0 commit comments

Comments
 (0)