Skip to content
Closed
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 @@
69a174b6c47c5e1039a5f14271440c10e33998ce
281b4455821119945fcc4c850cf2cfad03e23c6c
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cmd/account/custom-app-integration/custom-app-integration.go linguist-generated=
cmd/account/disable-legacy-features/disable-legacy-features.go linguist-generated=true
cmd/account/enable-ip-access-lists/enable-ip-access-lists.go linguist-generated=true
cmd/account/encryption-keys/encryption-keys.go linguist-generated=true
cmd/account/endpoints/endpoints.go linguist-generated=true
cmd/account/esm-enablement-account/esm-enablement-account.go linguist-generated=true
cmd/account/federation-policy/federation-policy.go linguist-generated=true
cmd/account/groups-v2/groups-v2.go linguist-generated=true
Expand Down
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
### Dependency updates
* Upgrade Go SDK to v0.106.0 (([#4486](https://github.com/databricks/cli/pull/4486)))
* Upgrade Terraform provider to v1.106.0 (([#4542](https://github.com/databricks/cli/pull/4542)))

### API Changes
20 changes: 20 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ resources.apps.*.service_principal_client_id string ALL
resources.apps.*.service_principal_id int64 ALL
resources.apps.*.service_principal_name string ALL
resources.apps.*.source_code_path string INPUT
resources.apps.*.space string ALL
resources.apps.*.update_time string ALL
resources.apps.*.updater string ALL
resources.apps.*.url string ALL
Expand Down Expand Up @@ -668,6 +669,7 @@ resources.external_locations.*.created_at int64 REMOTE
resources.external_locations.*.created_by string REMOTE
resources.external_locations.*.credential_id string REMOTE
resources.external_locations.*.credential_name string ALL
resources.external_locations.*.effective_enable_file_events bool ALL
resources.external_locations.*.enable_file_events bool ALL
resources.external_locations.*.encryption_details *catalog.EncryptionDetails ALL
resources.external_locations.*.encryption_details.sse_encryption_details *catalog.SseEncryptionDetails ALL
Expand Down Expand Up @@ -771,6 +773,9 @@ resources.jobs.*.git_source.job_source *jobs.JobSource ALL
resources.jobs.*.git_source.job_source.dirty_state jobs.JobSourceDirtyState ALL
resources.jobs.*.git_source.job_source.import_from_git_branch string ALL
resources.jobs.*.git_source.job_source.job_config_path string ALL
resources.jobs.*.git_source.sparse_checkout *jobs.SparseCheckout ALL
resources.jobs.*.git_source.sparse_checkout.patterns []string ALL
resources.jobs.*.git_source.sparse_checkout.patterns[*] string ALL
resources.jobs.*.health *jobs.JobsHealthRules ALL
resources.jobs.*.health.rules []jobs.JobsHealthRule ALL
resources.jobs.*.health.rules[*] jobs.JobsHealthRule ALL
Expand Down Expand Up @@ -2573,7 +2578,12 @@ resources.postgres_endpoints.*.suspend_timeout_duration *duration.Duration INPUT
resources.postgres_endpoints.*.uid string REMOTE
resources.postgres_endpoints.*.update_time *time.Time REMOTE
resources.postgres_endpoints.*.url string INPUT
resources.postgres_projects.*.budget_policy_id string INPUT STATE
resources.postgres_projects.*.create_time *time.Time REMOTE
resources.postgres_projects.*.custom_tags []postgres.ProjectCustomTag INPUT STATE
resources.postgres_projects.*.custom_tags[*] postgres.ProjectCustomTag INPUT STATE
resources.postgres_projects.*.custom_tags[*].key string INPUT STATE
resources.postgres_projects.*.custom_tags[*].value string INPUT STATE
resources.postgres_projects.*.default_endpoint_settings *postgres.ProjectDefaultEndpointSettings INPUT STATE
resources.postgres_projects.*.default_endpoint_settings.autoscaling_limit_max_cu float64 INPUT STATE
resources.postgres_projects.*.default_endpoint_settings.autoscaling_limit_min_cu float64 INPUT STATE
Expand All @@ -2591,6 +2601,11 @@ resources.postgres_projects.*.name string REMOTE
resources.postgres_projects.*.pg_version int INPUT STATE
resources.postgres_projects.*.project_id string INPUT STATE
resources.postgres_projects.*.spec *postgres.ProjectSpec REMOTE
resources.postgres_projects.*.spec.budget_policy_id string REMOTE
resources.postgres_projects.*.spec.custom_tags []postgres.ProjectCustomTag REMOTE
resources.postgres_projects.*.spec.custom_tags[*] postgres.ProjectCustomTag REMOTE
resources.postgres_projects.*.spec.custom_tags[*].key string REMOTE
resources.postgres_projects.*.spec.custom_tags[*].value string REMOTE
resources.postgres_projects.*.spec.default_endpoint_settings *postgres.ProjectDefaultEndpointSettings REMOTE
resources.postgres_projects.*.spec.default_endpoint_settings.autoscaling_limit_max_cu float64 REMOTE
resources.postgres_projects.*.spec.default_endpoint_settings.autoscaling_limit_min_cu float64 REMOTE
Expand All @@ -2603,6 +2618,11 @@ resources.postgres_projects.*.spec.history_retention_duration *duration.Duration
resources.postgres_projects.*.spec.pg_version int REMOTE
resources.postgres_projects.*.status *postgres.ProjectStatus REMOTE
resources.postgres_projects.*.status.branch_logical_size_limit_bytes int64 REMOTE
resources.postgres_projects.*.status.budget_policy_id string REMOTE
resources.postgres_projects.*.status.custom_tags []postgres.ProjectCustomTag REMOTE
resources.postgres_projects.*.status.custom_tags[*] postgres.ProjectCustomTag REMOTE
resources.postgres_projects.*.status.custom_tags[*].key string REMOTE
resources.postgres_projects.*.status.custom_tags[*].value string REMOTE
resources.postgres_projects.*.status.default_endpoint_settings *postgres.ProjectDefaultEndpointSettings REMOTE
resources.postgres_projects.*.status.default_endpoint_settings.autoscaling_limit_max_cu float64 REMOTE
resources.postgres_projects.*.status.default_endpoint_settings.autoscaling_limit_min_cu float64 REMOTE
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/quality_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (s QualityMonitor) MarshalJSON() ([]byte, error) {
}

func (s *QualityMonitor) Exists(ctx context.Context, w *databricks.WorkspaceClient, id string) (bool, error) {
//nolint:staticcheck // Bundle resource still uses legacy QualityMonitors API until direct migration is complete.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is broken?

Copy link
Member Author

Choose a reason for hiding this comment

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

In SDK v0.110.0, the catalog.QualityMonitors.* methods were marked deprecated in Go doc comments and staticcheck treats calls to deprecated APIs as SA1019

seems like the code here still calls those methods (e.g. Get/Create/Update/Delete) because it hasn’t been migrated to the newer Data Quality API path yet

effectively after the SDK bump, CI started failing on lint even though runtime behavior remained the same

_, err := w.QualityMonitors.Get(ctx, catalog.GetQualityMonitorRequest{
TableName: id,
})
Expand Down
85 changes: 44 additions & 41 deletions bundle/direct/dresources/external_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ func (*ResourceExternalLocation) PrepareState(input *resources.ExternalLocation)

func (*ResourceExternalLocation) RemapState(info *catalog.ExternalLocationInfo) *catalog.CreateExternalLocation {
return &catalog.CreateExternalLocation{
Comment: info.Comment,
CredentialName: info.CredentialName,
EnableFileEvents: info.EnableFileEvents,
EncryptionDetails: info.EncryptionDetails,
Fallback: info.Fallback,
FileEventQueue: info.FileEventQueue,
Name: info.Name,
ReadOnly: info.ReadOnly,
SkipValidation: false, // This is an input-only parameter, never returned by API
Url: info.Url,
ForceSendFields: utils.FilterFields[catalog.CreateExternalLocation](info.ForceSendFields),
Comment: info.Comment,
CredentialName: info.CredentialName,
EffectiveEnableFileEvents: false, // Output-only; do not persist to desired state.
EnableFileEvents: info.EnableFileEvents,
EncryptionDetails: info.EncryptionDetails,
Fallback: info.Fallback,
FileEventQueue: info.FileEventQueue,
Name: info.Name,
ReadOnly: info.ReadOnly,
SkipValidation: false, // This is an input-only parameter, never returned by API
Url: info.Url,
ForceSendFields: utils.FilterFields[catalog.CreateExternalLocation](info.ForceSendFields, "EffectiveEnableFileEvents"),
}
}

Expand All @@ -52,21 +53,22 @@ 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, _ Changes) (*catalog.ExternalLocationInfo, error) {
updateRequest := catalog.UpdateExternalLocation{
Comment: config.Comment,
CredentialName: config.CredentialName,
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
FileEventQueue: config.FileEventQueue,
Force: false,
IsolationMode: "", // Not supported by DABs
Name: id,
NewName: "", // Only set if name actually changes (see DoUpdateWithID)
Owner: "", // Not supported by DABs
ReadOnly: config.ReadOnly,
SkipValidation: config.SkipValidation,
Url: config.Url,
ForceSendFields: utils.FilterFields[catalog.UpdateExternalLocation](config.ForceSendFields, "IsolationMode", "Owner"),
Comment: config.Comment,
CredentialName: config.CredentialName,
EffectiveEnableFileEvents: false, // Output-only field, should never be sent in update payload.
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
FileEventQueue: config.FileEventQueue,
Force: false,
IsolationMode: "", // Not supported by DABs
Name: id,
NewName: "", // Only set if name actually changes (see DoUpdateWithID)
Owner: "", // Not supported by DABs
ReadOnly: config.ReadOnly,
SkipValidation: config.SkipValidation,
Url: config.Url,
ForceSendFields: utils.FilterFields[catalog.UpdateExternalLocation](config.ForceSendFields, "IsolationMode", "Owner", "EffectiveEnableFileEvents"),
}

return r.client.ExternalLocations.Update(ctx, updateRequest)
Expand All @@ -75,21 +77,22 @@ 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,
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
FileEventQueue: config.FileEventQueue,
Force: false,
IsolationMode: "", // Not supported by DABs
Name: id,
NewName: "", // Initialized below if needed
Owner: "", // Not supported by DABs
ReadOnly: config.ReadOnly,
SkipValidation: config.SkipValidation,
Url: config.Url,
ForceSendFields: utils.FilterFields[catalog.UpdateExternalLocation](config.ForceSendFields, "IsolationMode", "Owner"),
Comment: config.Comment,
CredentialName: config.CredentialName,
EffectiveEnableFileEvents: false, // Output-only field, should never be sent in update payload.
EnableFileEvents: config.EnableFileEvents,
EncryptionDetails: config.EncryptionDetails,
Fallback: config.Fallback,
FileEventQueue: config.FileEventQueue,
Force: false,
IsolationMode: "", // Not supported by DABs
Name: id,
NewName: "", // Initialized below if needed
Owner: "", // Not supported by DABs
ReadOnly: config.ReadOnly,
SkipValidation: config.SkipValidation,
Url: config.Url,
ForceSendFields: utils.FilterFields[catalog.UpdateExternalLocation](config.ForceSendFields, "IsolationMode", "Owner", "EffectiveEnableFileEvents"),
}

if config.Name != id {
Expand Down
2 changes: 2 additions & 0 deletions bundle/direct/dresources/postgres_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func (*ResourcePostgresProject) RemapState(remote *postgres.Project) *PostgresPr
// This means we cannot detect remote drift for spec fields.
// Use an empty struct (not nil) so field-level diffing works correctly.
ProjectSpec: postgres.ProjectSpec{
BudgetPolicyId: "",
CustomTags: nil,
DefaultEndpointSettings: nil,
DisplayName: "",
HistoryRetentionDuration: nil,
Expand Down
4 changes: 4 additions & 0 deletions bundle/direct/dresources/quality_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (*ResourceQualityMonitor) RemapState(info *catalog.MonitorInfo) *QualityMon
}

func (r *ResourceQualityMonitor) DoRead(ctx context.Context, id string) (*catalog.MonitorInfo, error) {
//nolint:staticcheck // Direct resource still uses legacy QualityMonitors API until migration to data-quality API.
return r.client.QualityMonitors.Get(ctx, catalog.GetQualityMonitorRequest{
TableName: id,
})
Expand All @@ -74,6 +75,7 @@ func (r *ResourceQualityMonitor) DoRead(ctx context.Context, id string) (*catalo
func (r *ResourceQualityMonitor) DoCreate(ctx context.Context, config *QualityMonitorState) (string, *catalog.MonitorInfo, error) {
req := config.CreateMonitor
req.TableName = config.TableName
//nolint:staticcheck // Direct resource still uses legacy QualityMonitors API until migration to data-quality API.
response, err := r.client.QualityMonitors.Create(ctx, req)
if err != nil || response == nil {
return "", nil, err
Expand All @@ -99,6 +101,7 @@ func (r *ResourceQualityMonitor) DoUpdate(ctx context.Context, id string, config
ForceSendFields: utils.FilterFields[catalog.UpdateMonitor](config.ForceSendFields),
}

//nolint:staticcheck // Direct resource still uses legacy QualityMonitors API until migration to data-quality API.
response, err := r.client.QualityMonitors.Update(ctx, updateRequest)
if err != nil {
return nil, err
Expand All @@ -108,6 +111,7 @@ func (r *ResourceQualityMonitor) DoUpdate(ctx context.Context, id string, config
}

func (r *ResourceQualityMonitor) DoDelete(ctx context.Context, id string) error {
//nolint:staticcheck // Direct resource still uses legacy QualityMonitors API until migration to data-quality API.
_, err := r.client.QualityMonitors.Delete(ctx, catalog.DeleteQualityMonitorRequest{
TableName: id,
})
Expand Down
2 changes: 2 additions & 0 deletions bundle/direct/dresources/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ var knownMissingInRemoteType = map[string][]string{
"suspend_timeout_duration",
},
"postgres_projects": {
"budget_policy_id",
"custom_tags",
"default_endpoint_settings",
"display_name",
"history_retention_duration",
Expand Down
6 changes: 6 additions & 0 deletions bundle/internal/schema/annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,15 @@ github.com/databricks/cli/bundle/config/resources.PostgresEndpoint:
"description": |-
PLACEHOLDER
github.com/databricks/cli/bundle/config/resources.PostgresProject:
"budget_policy_id":
"description": |-
PLACEHOLDER
"create_time":
"description": |-
PLACEHOLDER
"custom_tags":
"description": |-
PLACEHOLDER
"default_endpoint_settings":
"description": |-
PLACEHOLDER
Expand Down
Loading