From 2b1cceb8aedcbeaaba5859a2c0bba8affa91693e Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 6 Mar 2026 11:37:00 +0100 Subject: [PATCH] Remove unused configRoot parameter from DeploymentBundle.Apply It must not be used, all actions must be performed based on plan, not config. Needed for "bundle deploy --plan" to work reliably. Co-Authored-By: Claude Sonnet 4.6 --- bundle/direct/bundle_apply.go | 3 +-- bundle/phases/deploy.go | 2 +- bundle/phases/destroy.go | 2 +- bundle/statemgmt/upload_state_for_yaml_sync.go | 2 +- cmd/bundle/deployment/migrate.go | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bundle/direct/bundle_apply.go b/bundle/direct/bundle_apply.go index 4a0b9359ee..18c415504d 100644 --- a/bundle/direct/bundle_apply.go +++ b/bundle/direct/bundle_apply.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" - "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/bundle/deployplan" "github.com/databricks/cli/libs/logdiag" "github.com/databricks/cli/libs/structs/structaccess" @@ -16,7 +15,7 @@ import ( type MigrateMode bool -func (b *DeploymentBundle) Apply(ctx context.Context, client *databricks.WorkspaceClient, configRoot *config.Root, plan *deployplan.Plan, migrateMode MigrateMode) { +func (b *DeploymentBundle) Apply(ctx context.Context, client *databricks.WorkspaceClient, plan *deployplan.Plan, migrateMode MigrateMode) { if plan == nil { panic("Planning is not done") } diff --git a/bundle/phases/deploy.go b/bundle/phases/deploy.go index 35c4161eae..4613a7a211 100644 --- a/bundle/phases/deploy.go +++ b/bundle/phases/deploy.go @@ -103,7 +103,7 @@ func deployCore(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan, ta cmdio.LogString(ctx, "Deploying resources...") if targetEngine.IsDirect() { - b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(false)) + b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(false)) } else { bundle.ApplyContext(ctx, b, terraform.Apply()) } diff --git a/bundle/phases/destroy.go b/bundle/phases/destroy.go index 6c6657c8ce..e6be00b579 100644 --- a/bundle/phases/destroy.go +++ b/bundle/phases/destroy.go @@ -96,7 +96,7 @@ func approvalForDestroy(ctx context.Context, b *bundle.Bundle, plan *deployplan. func destroyCore(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan, engine engine.EngineType) { if engine.IsDirect() { - b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(false)) + b.DeploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(false)) } else { // Core destructive mutators for destroy. These require informed user consent. bundle.ApplyContext(ctx, b, terraform.Apply()) diff --git a/bundle/statemgmt/upload_state_for_yaml_sync.go b/bundle/statemgmt/upload_state_for_yaml_sync.go index a71fa241cb..7d7c766743 100644 --- a/bundle/statemgmt/upload_state_for_yaml_sync.go +++ b/bundle/statemgmt/upload_state_for_yaml_sync.go @@ -176,7 +176,7 @@ func (m *uploadStateForYamlSync) convertState(ctx context.Context, b *bundle.Bun } } - deploymentBundle.Apply(ctx, b.WorkspaceClient(), &uninterpolatedConfig, plan, direct.MigrateMode(true)) + deploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(true)) return diags } diff --git a/cmd/bundle/deployment/migrate.go b/cmd/bundle/deployment/migrate.go index 6c6e9951ba..a257c42d03 100644 --- a/cmd/bundle/deployment/migrate.go +++ b/cmd/bundle/deployment/migrate.go @@ -262,7 +262,7 @@ To start using direct engine, deploy with DATABRICKS_BUNDLE_ENGINE=direct env va } } - deploymentBundle.Apply(ctx, b.WorkspaceClient(), &b.Config, plan, direct.MigrateMode(true)) + deploymentBundle.Apply(ctx, b.WorkspaceClient(), plan, direct.MigrateMode(true)) if logdiag.HasError(ctx) { logdiag.LogError(ctx, errors.New("migration failed; ensure you have done full deploy before the migration")) return root.ErrAlreadyPrinted