Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d09dbd77f5a9560cbb816746773da43a8bdbde08
11ae6f9d98f0d0838a5e53c27032f178fecc4ee0
6 changes: 4 additions & 2 deletions .github/workflows/tagging.yml
Comment thread
simonfaltum marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
workflow_dispatch:
# No inputs are required for the manual dispatch.

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

# Ensure that only a single instance of the workflow is running at a time.
concurrency:
Expand Down
4 changes: 4 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@

### CLI

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

### Bundles
Comment thread
simonfaltum marked this conversation as resolved.

### Dependency updates

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

### API Changes
145 changes: 145 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions acceptance/dbr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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)
err = w.Workspace.MkdirsByPath(ctx, apiPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
require.NoError(t, err)

// Note: We do not cleanup test directories created here. They are kept around
Expand Down Expand Up @@ -185,7 +185,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)
err = w.Workspace.MkdirsByPath(ctx, debugLogsDir) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
require.NoError(t, err)

// Create an empty debug log file so we can get its URL before the job runs.
Expand All @@ -204,7 +204,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)
debugLogStatus, err := w.Workspace.GetStatusByPath(ctx, debugLogPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
require.NoError(t, err)

// Build cloud test parameters (Cloud=true tests, run with CLOUD_ENV set)
Expand Down
2 changes: 1 addition & 1 deletion acceptance/help/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Databricks Workspace
git-credentials Registers personal access token for Databricks to do operations on behalf of the user.
repos The Repos API allows users to manage their git repos.
secrets The Secrets API allows you to manage secrets, secret scopes, and access permissions.
workspace The Workspace API allows you to list, import, export, and delete notebooks and folders.
workspace The Workspace API allows you to list, import, export, and delete workspace objects such as notebooks, files, folders, and dashboards.

Compute
cluster-policies You can use cluster policies to control users' ability to configure clusters based on a set of rules.
Expand Down
1 change: 1 addition & 0 deletions acceptance/pipelines/databricks-cli-help/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Available Commands
stop Stop a pipeline

Management Commands
apply-environment Apply the latest environment to the pipeline.
clone Clone a pipeline.
create Create a pipeline.
delete Delete a pipeline.
Expand Down
2 changes: 1 addition & 1 deletion bundle/config/validate/folder_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
obj, err := w.GetStatusByPath(ctx, folderPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
if err == nil {
return obj, nil
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/deploy/files/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().Workspace.Delete(ctx, workspace.Delete{
err := b.WorkspaceClient().Workspace.Delete(ctx, workspace.Delete{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
Path: b.Config.Workspace.RootPath,
Recursive: true,
})
Expand Down
2 changes: 1 addition & 1 deletion bundle/deploy/resource_path_mkdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (m *resourcePathMkdir) Apply(ctx context.Context, b *bundle.Bundle) diag.Di
w := b.WorkspaceClient()

// Optimisitcally create the resource path. If it already exists ignore the error.
err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath)
err := w.Workspace.MkdirsByPath(ctx, b.Config.Workspace.ResourcePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
var aerr *apierr.APIError
if errors.As(err, &aerr) && aerr.ErrorCode == "RESOURCE_ALREADY_EXISTS" {
return nil
Expand Down
2 changes: 1 addition & 1 deletion bundle/direct/dresources/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,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)
err := client.Workspace.MkdirsByPath(ctx, parentPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/direct/dresources/apitypes.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ postgres_branches: postgres.BranchSpec

postgres_endpoints: postgres.EndpointSpec

postgres_projects: postgres.ProjectSpec
postgres_projects: postgres.ProjectStatus
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong. Can this be non-deterministic? I know the spec and status structs look similar.

cc @denik

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generator (generate_apitypes.py) picks types by field overlap, and ProjectStatus probably scored higher after the SDK added DefaultBranch to both types. But apitypes.yml already pins postgres_projects: postgres.ProjectSpec as a manual override, so the generated value doesn't take effect. Agreed this is a bit fragile, the generator could be more deterministic about preferring Spec over Status types.


quality_monitors: catalog.CreateMonitor

Expand Down
21 changes: 12 additions & 9 deletions bundle/direct/dresources/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ func (*ResourceCatalog) PrepareState(input *resources.Catalog) *catalog.CreateCa

func (*ResourceCatalog) RemapState(info *catalog.CatalogInfo) *catalog.CreateCatalog {
return &catalog.CreateCatalog{
Comment: info.Comment,
ConnectionName: info.ConnectionName,
Name: info.Name,
Options: info.Options,
Properties: info.Properties,
ProviderName: info.ProviderName,
ShareName: info.ShareName,
StorageRoot: info.StorageRoot,
ForceSendFields: utils.FilterFields[catalog.CreateCatalog](info.ForceSendFields),
Comment: info.Comment,
ConnectionName: info.ConnectionName,
ManagedEncryptionSettings: info.ManagedEncryptionSettings,
Name: info.Name,
Options: info.Options,
Properties: info.Properties,
ProviderName: info.ProviderName,
ShareName: info.ShareName,
StorageRoot: info.StorageRoot,
ForceSendFields: utils.FilterFields[catalog.CreateCatalog](info.ForceSendFields),
}
}

Expand All @@ -53,6 +54,7 @@ func (r *ResourceCatalog) DoUpdate(ctx context.Context, id string, config *catal
Comment: config.Comment,
EnablePredictiveOptimization: "", // Not supported by DABs
IsolationMode: "", // Not supported by DABs
ManagedEncryptionSettings: config.ManagedEncryptionSettings,
Name: id,
NewName: "", // Only set if name actually changes (see DoUpdateWithID)
Options: config.Options,
Expand All @@ -75,6 +77,7 @@ func (r *ResourceCatalog) DoUpdateWithID(ctx context.Context, id string, config
Comment: config.Comment,
EnablePredictiveOptimization: "", // Not supported by DABs
IsolationMode: "", // Not supported by DABs
ManagedEncryptionSettings: config.ManagedEncryptionSettings,
Name: id,
NewName: "", // Initialized below if needed
Options: config.Options,
Expand Down
2 changes: 1 addition & 1 deletion bundle/direct/dresources/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
err = r.client.Workspace.MkdirsByPath(ctx, config.ParentPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
if err != nil {
return "", nil, fmt.Errorf("failed to create parent directory: %w", err)
}
Expand Down
19 changes: 10 additions & 9 deletions bundle/direct/dresources/external_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ func (*ResourceExternalLocation) RemapState(info *catalog.ExternalLocationInfo)
return &catalog.CreateExternalLocation{
Comment: info.Comment,
CredentialName: info.CredentialName,
// Output-only field mirrored into state to avoid churn in remapped config.
// Output-only fields mirrored into state to avoid churn in remapped config.
EffectiveEnableFileEvents: info.EffectiveEnableFileEvents,
EffectiveFileEventQueue: info.EffectiveFileEventQueue,
EnableFileEvents: info.EnableFileEvents,
EncryptionDetails: info.EncryptionDetails,
Fallback: info.Fallback,
Expand Down Expand Up @@ -54,10 +55,10 @@ func (r *ResourceExternalLocation) DoCreate(ctx context.Context, config *catalog
// DoUpdate updates the external location in place and returns remote state.
func (r *ResourceExternalLocation) DoUpdate(ctx context.Context, id string, config *catalog.CreateExternalLocation, _ *PlanEntry) (*catalog.ExternalLocationInfo, error) {
updateRequest := catalog.UpdateExternalLocation{
Comment: config.Comment,
CredentialName: config.CredentialName,
// Output-only field; never sent in update payload.
EffectiveEnableFileEvents: false,
Comment: config.Comment,
CredentialName: config.CredentialName,
EffectiveEnableFileEvents: false, // Output-only field; never sent in update payload.
EffectiveFileEventQueue: nil,
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
Expand All @@ -79,10 +80,10 @@ func (r *ResourceExternalLocation) DoUpdate(ctx context.Context, id string, conf
// DoUpdateWithID updates the external location and returns the new ID if the name changes.
func (r *ResourceExternalLocation) DoUpdateWithID(ctx context.Context, id string, config *catalog.CreateExternalLocation) (string, *catalog.ExternalLocationInfo, error) {
updateRequest := catalog.UpdateExternalLocation{
Comment: config.Comment,
CredentialName: config.CredentialName,
// Output-only field; never sent in update payload.
EffectiveEnableFileEvents: false,
Comment: config.Comment,
CredentialName: config.CredentialName,
EffectiveEnableFileEvents: false, // Output-only field; never sent in update payload.
EffectiveFileEventQueue: nil,
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
Expand Down
1 change: 1 addition & 0 deletions bundle/direct/dresources/postgres_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (*ResourcePostgresProject) RemapState(remote *postgres.Project) *PostgresPr
ProjectSpec: postgres.ProjectSpec{
BudgetPolicyId: "",
CustomTags: nil,
DefaultBranch: "",
DefaultEndpointSettings: nil,
DisplayName: "",
EnablePgNativeLogin: false,
Expand Down
8 changes: 3 additions & 5 deletions bundle/direct/dresources/resources.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ resources:
ignore_remote_changes:
- field: effective_enable_file_events
reason: spec:output_only
- field: file_event_queue.managed_aqs.managed_resource_id
reason: spec:output_only
- field: file_event_queue.managed_pubsub.managed_resource_id
reason: spec:output_only
- field: file_event_queue.managed_sqs.managed_resource_id
- field: effective_file_event_queue
reason: spec:output_only

# jobs: no api field behaviors
Expand Down Expand Up @@ -245,6 +241,8 @@ resources:
reason: spec:input_only
- field: custom_tags
reason: spec:input_only
- field: default_branch
reason: spec:input_only
- field: default_endpoint_settings
reason: spec:input_only
- field: display_name
Expand Down
1 change: 1 addition & 0 deletions bundle/direct/dresources/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var knownMissingInRemoteType = map[string][]string{
"postgres_projects": {
"budget_policy_id",
"custom_tags",
"default_branch",
"default_endpoint_settings",
"display_name",
"enable_pg_native_login",
Expand Down
6 changes: 3 additions & 3 deletions bundle/generate/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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)
_, err := n.w.Workspace.GetStatusByPath(ctx, *filePath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
if err != nil {
return err
}
Expand All @@ -78,7 +78,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)
_, err := n.w.Workspace.GetStatusByPath(ctx, *dirPath) //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
if err != nil {
return err
}
Expand Down Expand Up @@ -118,7 +118,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{
objects, err := n.w.Workspace.ListAll(ctx, workspace.ListWorkspaceRequest{ //nolint:staticcheck // Deprecated in SDK v0.127.0. Migration to WorkspaceHierarchyService tracked separately.
Path: dirPath,
})
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions bundle/internal/schema/annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,9 @@ github.com/databricks/cli/bundle/config/resources.PostgresProject:
"custom_tags":
"description": |-
PLACEHOLDER
"default_branch":
"description": |-
PLACEHOLDER
"default_endpoint_settings":
"description": |-
PLACEHOLDER
Expand Down
Loading
Loading