From 8486481dc45fab339968e670b18e9c893e632832 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 3 Sep 2025 14:36:17 +0200 Subject: [PATCH 1/8] Add summary for 'bundle plan' output and print to stdout --- acceptance/bundle/apps/app_yaml/output.txt | 3 +- acceptance/bundle/bundle_tag/id/output.txt | 3 +- acceptance/bundle/bundle_tag/url/output.txt | 3 +- .../url_ref/out.plan.direct-exp.txt | 1 + .../bundle_tag/url_ref/out.plan.terraform.txt | 5 +-- .../bundle/debug/out.stderr.terraform.txt | 2 +- .../bundle/deploy/jobs/task-source/output.txt | 3 +- .../deploy/pipeline/auto-approve/output.txt | 5 +-- .../deploy/pipeline/recreate/output.txt | 5 +-- acceptance/bundle/plan/no_upload/output.txt | 3 +- .../bad_syntax/out.plan.direct-exp.txt | 5 +-- .../bad_syntax/out.plan.terraform.txt | 1 + .../resource_deps/create_error/output.txt | 16 +++++---- .../bundle/resource_deps/id_chain/output.txt | 22 ++++++------ .../bundle/resource_deps/job_id/output.txt | 5 +-- .../resource_deps/jobs_update/output.txt | 10 ++++-- .../loop_jobs/out.plan.direct-exp.txt | 1 + .../loop_jobs/out.plan.terraform.txt | 1 + .../loop_self/out.plan.direct-exp.txt | 1 + .../loop_self/out.plan.terraform.txt | 1 + .../out.plan.direct-exp.txt | 1 + .../out.plan.terraform.txt | 1 + .../missing_map_key/out.plan.direct-exp.txt | 1 + .../missing_map_key/out.plan.terraform.txt | 1 + .../out.plan.direct-exp.txt | 1 + .../out.plan.terraform.txt | 1 + .../out.plan.direct-exp.txt | 5 +-- .../out.plan.terraform.txt | 5 +-- .../out.plan.direct-exp.txt | 1 + .../non_existent_field/out.plan.terraform.txt | 1 + .../pipelines_recreate/output.txt | 12 ++++--- .../out.plan.direct-exp.txt | 5 +-- .../out.plan.terraform.txt | 1 + .../remote_field_storage_location/output.txt | 7 ++-- .../bundle/resources/apps/update/output.txt | 10 ++++-- .../bundle/resources/jobs/update/output.txt | 8 +++-- .../recreate/change-catalog/output.txt | 6 ++-- .../change-ingestion-definition/output.txt | 6 ++-- .../recreate/change-storage/output.txt | 6 ++-- .../resources/schemas/recreate/output.txt | 3 +- .../resources/volumes/change-name/output.txt | 3 +- .../volumes/change-schema-name/output.txt | 3 +- .../volumes/set-storage-location/output.txt | 5 +-- cmd/bundle/plan.go | 36 +++++++++++++++++-- 44 files changed, 158 insertions(+), 67 deletions(-) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index 6cd79b8ce7..8748943877 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -9,7 +9,8 @@ Workspace: Validation OK! >>> [CLI] bundle plan -create apps.myapp +Plan: 1 to add, 0 to change, 0 to delete + create apps.myapp >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index f94cd91d5e..4db8ae5174 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -30,7 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete + create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index e7f0f7d6b6..f49888cdfe 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -30,7 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete + create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt index f8ee1da817..83acc7119a 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt @@ -4,5 +4,6 @@ Error: cannot plan jobs.bar: dependency failed: jobs.foo Error: planning failed +No changes. Your infrastructure matches the configuration. Exit code: 1 diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index bee5cee74f..7dd5f4d80b 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,2 +1,3 @@ -create jobs.bar -create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete + create jobs.bar + create jobs.foo diff --git a/acceptance/bundle/debug/out.stderr.terraform.txt b/acceptance/bundle/debug/out.stderr.terraform.txt index 99c0d4688f..ffe2c6cb1d 100644 --- a/acceptance/bundle/debug/out.stderr.terraform.txt +++ b/acceptance/bundle/debug/out.stderr.terraform.txt @@ -64,7 +64,7 @@ 10:07:59 Debug: Apply pid=12345 mutator=metadata.AnnotatePipelines 10:07:59 Debug: Apply pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Using Terraform from DATABRICKS_TF_EXEC_PATH at [TERRAFORM] pid=12345 mutator=terraform.Initialize -10:07:59 Debug: Using Terraform CLI config from DATABRICKS_TF_CLI_CONFIG_FILE at [DATABRICKS_TF_CLI_CONFIG_FILE] pid=12345 mutator=terraform.Initialize +10:07:59 Debug: DATABRICKS_TF_PROVIDER_VERSION as 1.84.0 does not match the current version 1.88.0, ignoring DATABRICKS_TF_CLI_CONFIG_FILE pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Environment variables for Terraform: ...redacted... pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Apply pid=12345 mutator=scripts.postinit 10:07:59 Debug: No script defined for postinit, skipping pid=12345 mutator=scripts.postinit diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index 287e94a092..7539149296 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -14,7 +14,8 @@ Deployment complete! >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | select(.body.name=="workspace_job") | .body out.requests.txt >>> [CLI] bundle plan -update jobs.git_job +Plan: 0 to add, 1 to change, 0 to delete + update jobs.git_job >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/task-source/default/files... diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt index f03fbfe338..402646c55d 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt +++ b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt @@ -36,8 +36,9 @@ Deployment complete! >>> rm resources.yml >>> [CLI] bundle plan -delete jobs.foo -delete pipelines.bar +Plan: 0 to add, 0 to change, 2 to delete + delete jobs.foo + delete pipelines.bar === Try to redeploy the bundle - should fail without --auto-approve >>> errcode [CLI] bundle deploy diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index 4c75853b53..4c2c0fd18f 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -30,9 +30,10 @@ Deployment complete! } } + recreate pipelines.foo + recreate schemas.bar >>> [CLI] bundle plan --var=catalog=another_catalog -recreate pipelines.foo -recreate schemas.bar +Plan: 2 to add, 0 to change, 2 to delete === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog >>> errcode [CLI] bundle deploy --force-lock --var=catalog=another_catalog diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index 8997a8b2f2..e2372ad7d6 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,5 +1,6 @@ >>> [CLI] bundle plan -create jobs.my_job +Plan: 1 to add, 0 to change, 0 to delete + create jobs.my_job >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index 097c41a2cf..f62afcafcc 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,2 +1,3 @@ -create volumes.bar -create volumes.foo +Plan: 2 to add, 0 to change, 0 to delete + create volumes.bar + create volumes.foo diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt index b8f8078aba..fc7d71561a 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt @@ -8,3 +8,4 @@ Error: Invalid attribute name An attribute name is required after a dot. +No changes. Your infrastructure matches the configuration. diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index 44997eb857..c7d24db796 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -1,9 +1,10 @@ >>> [CLI] bundle plan -create jobs.bar -create jobs.baz -create jobs.foo -create jobs.independent +Plan: 4 to add, 0 to change, 0 to delete + create jobs.bar + create jobs.baz + create jobs.foo + create jobs.independent >>> print_sorted_requests { @@ -66,9 +67,10 @@ Resources: === Plan should still contain foo and bar >>> [CLI] bundle plan -create jobs.bar -create jobs.baz -create jobs.foo +Plan: 3 to add, 0 to change, 0 to delete + create jobs.bar + create jobs.baz + create jobs.foo === Expecting no difference in the output between first and second deploy >>> print_requests diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index ba119778f9..04413fa5bd 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -1,10 +1,11 @@ >>> [CLI] bundle plan -create jobs.a -create jobs.b -create jobs.c -create jobs.d -create jobs.e +Plan: 5 to add, 0 to change, 0 to delete + create jobs.a + create jobs.b + create jobs.c + create jobs.d + create jobs.e >>> print_requests @@ -26,11 +27,12 @@ Deployment complete! >>> update_file.py databricks.yml prefix new_prefix >>> [CLI] bundle plan -update jobs.a -update jobs.b -update jobs.c -update jobs.d -update jobs.e +Plan: 0 to add, 5 to change, 0 to delete + update jobs.a + update jobs.b + update jobs.c + update jobs.d + update jobs.e >>> print_requests diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index 0de46706a2..e286f86a13 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -1,7 +1,8 @@ >>> [CLI] bundle plan -create jobs.bar -create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete + create jobs.bar + create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index 26ab67029b..0cfe26335f 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -1,7 +1,8 @@ >>> [CLI] bundle plan -create jobs.bar -create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete + create jobs.bar + create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -63,12 +64,14 @@ Deployment complete! } >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. === Update trigger.periodic.unit and re-deploy; jobs.bar is unchanged >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete + update jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -115,6 +118,7 @@ Deployment complete! } >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. === Fetch job ID and verify remote state >>> [CLI] jobs get [FOO_ID] diff --git a/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt index 79d8640680..3b1c786a2b 100644 --- a/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt @@ -1,4 +1,5 @@ Error: cycle detected: jobs.foo refers to jobs.bar via ${resources.jobs.bar.id} which refers to jobs.foo via ${resources.jobs.foo.id} +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt b/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt index 9b5905750f..5c9962b974 100644 --- a/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt @@ -4,5 +4,6 @@ Error: Cycle: databricks_job.foo, databricks_job.bar +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt index 528213730a..3169468971 100644 --- a/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt @@ -1,4 +1,5 @@ Error: cycle detected: jobs.foo refers to itself via ${resources.jobs.foo.id} +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt b/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt index 9526ddf5ea..2fd4bdc51c 100644 --- a/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt @@ -15,5 +15,6 @@ Error: Self-referential block Configuration for databricks_job.foo may not refer to itself. +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt index 098d1334b4..9a04e03a5d 100644 --- a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt @@ -4,5 +4,6 @@ Error: cannot plan pipelines.bar: dependency failed: pipelines.foo Error: planning failed +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt index 0255c96dd6..506e5696fe 100644 --- a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt @@ -9,5 +9,6 @@ Block type "ingestion_definition" is represented by a list of objects, so it must be indexed using a numeric key, like .ingestion_definition[0]. +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt index a31caa4337..d0699f8a32 100644 --- a/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt @@ -4,5 +4,6 @@ Error: cannot plan jobs.bar: dependency failed: jobs.test Error: planning failed +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt index ca1c8d65dc..38e7db9fea 100644 --- a/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt @@ -9,5 +9,6 @@ This object has no argument, nested block, or exported attribute named "tasks". Did you mean "tags"? +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt index d698c84c29..fa5f32e255 100644 --- a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt @@ -4,5 +4,6 @@ Error: cannot plan jobs.bar: dependency failed: jobs.test Error: planning failed +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt index 6f338a03f3..4cf5600786 100644 --- a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt @@ -10,5 +10,6 @@ Error: Missing map element This map does not have an element with the key "missing_tag". +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index 78328158fe..a7eee391ba 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -2,5 +2,6 @@ Warning: expected a string value, found null at resources.pipelines.bar.catalog in databricks.yml:6:16 -create pipelines.bar -create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete + create pipelines.bar + create pipelines.foo diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index 1aa5fa515e..1337f08aea 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,2 +1,3 @@ -create pipelines.bar -create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete + create pipelines.bar + create pipelines.foo diff --git a/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt index 971bd4635a..0ced59599c 100644 --- a/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt @@ -4,5 +4,6 @@ Error: cannot plan volumes.foo: dependency failed: volumes.bar Error: planning failed +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt index c08bb33dbb..23dcda83bf 100644 --- a/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt @@ -9,5 +9,6 @@ This object has no argument, nested block, or exported attribute named "non_existent". +No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index 52d9e67644..365a90f7a0 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -1,7 +1,8 @@ >>> [CLI] bundle plan -create jobs.bar -create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete + create jobs.bar + create pipelines.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -44,13 +45,15 @@ Deployment complete! } >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. === Update catalog, triggering recreate for pipeline; this means updating downstream deps >>> update_file.py databricks.yml mycatalog mynewcatalog >>> [CLI] bundle plan -update jobs.bar -recreate pipelines.foo +Plan: 1 to add, 1 to change, 1 to delete + update jobs.bar + recreate pipelines.foo >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -153,6 +156,7 @@ Exit code (musterr): 1 === Follow up plan & deploy do nothing >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index 1aa5fa515e..1337f08aea 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,2 +1,3 @@ -create pipelines.bar -create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete + create pipelines.bar + create pipelines.foo diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt index d084d3dd3a..5ec74260d9 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt @@ -9,5 +9,6 @@ Block type "ingestion_definition" is represented by a list of objects, so it must be indexed using a numeric key, like .ingestion_definition[0]. +No changes. Your infrastructure matches the configuration. Exit code: 1 diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 7752a9c61d..5ece67a37c 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -25,9 +25,10 @@ } >>> [CLI] bundle plan -create schemas.my -create volumes.bar -create volumes.foo +Plan: 3 to add, 0 to change, 0 to delete + create schemas.my + create volumes.bar + create volumes.foo >>> print_requests diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index d4ebc25fd3..c0821b3ed1 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,6 +1,7 @@ >>> [CLI] bundle plan -create apps.mykey +Plan: 1 to add, 0 to change, 0 to delete + create apps.mykey >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -34,7 +35,8 @@ Resources: >>> update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION >>> [CLI] bundle plan -update apps.mykey +Plan: 0 to add, 1 to change, 0 to delete + update apps.mykey >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -68,7 +70,8 @@ Resources: >>> update_file.py databricks.yml myappname mynewappname >>> [CLI] bundle plan -recreate apps.mykey +Plan: 1 to add, 0 to change, 1 to delete + recreate apps.mykey >>> [CLI] bundle summary Name: test-bundle @@ -104,6 +107,7 @@ Deployment complete! } >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. >>> [CLI] bundle summary Name: test-bundle diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index e78f4fe7ab..9a32280a51 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,6 +1,7 @@ >>> [CLI] bundle plan -create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete + create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -9,6 +10,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. >>> print_requests { @@ -50,7 +52,8 @@ jobs foo id='[JOB_ID]' name='foo' >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete + update jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -59,6 +62,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle plan +No changes. Your infrastructure matches the configuration. >>> print_requests { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index 133a70c63f..7c32e1d9f4 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -15,7 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete + create pipelines.my >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... @@ -49,7 +50,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog1 catalog2 >>> [CLI] bundle plan -recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete + recreate pipelines.my >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index 8fe843dcd6..6fcefdb92c 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -15,7 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete + create pipelines.my >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... @@ -54,7 +55,8 @@ Deployment complete! >>> update_file.py databricks.yml my_connection my_new_connection >>> [CLI] bundle plan -recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete + recreate pipelines.my >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index 8827f7d4f4..e914f554df 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -15,7 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete + create pipelines.my >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... @@ -49,7 +50,8 @@ Deployment complete! >>> update_file.py databricks.yml pipelines/custom pipelines/newcustom >>> [CLI] bundle plan -recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete + recreate pipelines.my >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default/files... diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index a4ec4beff2..392bb9a330 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -31,7 +31,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog_name: main catalog_name: newmain >>> [CLI] bundle plan -recreate schemas.schema1 +Plan: 1 to add, 0 to change, 1 to delete + recreate schemas.schema1 >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index 41982016c1..6c8afe48c9 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -37,7 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myvolume mynewvolume >>> [CLI] bundle plan -update volumes.volume1 +Plan: 0 to add, 1 to change, 0 to delete + update volumes.volume1 >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index 724626d90b..f4b7ae58a0 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -37,7 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myschema mynewschema >>> [CLI] bundle plan -recreate volumes.volume1 +Plan: 1 to add, 0 to change, 1 to delete + recreate volumes.volume1 >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index 7b6816dd49..bca6db6b6d 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -1,7 +1,8 @@ >>> [CLI] bundle plan -create schemas.myschema -create volumes.volume1 +Plan: 2 to add, 0 to change, 0 to delete + create schemas.myschema + create volumes.volume1 >>> print_requests diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index 4895097523..efa6c95de2 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -9,7 +9,6 @@ import ( "github.com/databricks/cli/bundle/phases" "github.com/databricks/cli/cmd/bundle/utils" "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/cmdio" "github.com/databricks/cli/libs/logdiag" "github.com/spf13/cobra" ) @@ -74,8 +73,41 @@ func newPlanCommand() *cobra.Command { changes := phases.Diff(ctx, b) + // Count actions by type and collect formatted actions + createCount := 0 + updateCount := 0 + deleteCount := 0 + var actions []string + for _, change := range changes { - cmdio.LogString(ctx, fmt.Sprintf("%s %s.%s", change.ActionType, change.Group, change.Key)) + actionItem := fmt.Sprintf(" %s %s.%s", change.ActionType, change.Group, change.Key) + actions = append(actions, actionItem) + + switch change.ActionType.String() { + case "create": + createCount++ + case "update", "update_with_id": + updateCount++ + case "delete": + deleteCount++ + case "recreate": + // A recreate counts as both a delete and a create + deleteCount++ + createCount++ + } + } + + // Print summary line and actions to stdout + totalChanges := createCount + updateCount + deleteCount + if totalChanges > 0 { + fmt.Printf("Plan: %d to add, %d to change, %d to delete\n", createCount, updateCount, deleteCount) + + // Print all actions in the order they were processed + for _, action := range actions { + fmt.Println(action) + } + } else { + fmt.Println("No changes. Your infrastructure matches the configuration.") } if logdiag.HasError(ctx) { From f517a4028d2dabb2773f3da9ef79508607cf8133 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 3 Sep 2025 14:57:23 +0200 Subject: [PATCH 2/8] fix bundle debug test output --- acceptance/bundle/debug/out.stderr.terraform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/debug/out.stderr.terraform.txt b/acceptance/bundle/debug/out.stderr.terraform.txt index ffe2c6cb1d..99c0d4688f 100644 --- a/acceptance/bundle/debug/out.stderr.terraform.txt +++ b/acceptance/bundle/debug/out.stderr.terraform.txt @@ -64,7 +64,7 @@ 10:07:59 Debug: Apply pid=12345 mutator=metadata.AnnotatePipelines 10:07:59 Debug: Apply pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Using Terraform from DATABRICKS_TF_EXEC_PATH at [TERRAFORM] pid=12345 mutator=terraform.Initialize -10:07:59 Debug: DATABRICKS_TF_PROVIDER_VERSION as 1.84.0 does not match the current version 1.88.0, ignoring DATABRICKS_TF_CLI_CONFIG_FILE pid=12345 mutator=terraform.Initialize +10:07:59 Debug: Using Terraform CLI config from DATABRICKS_TF_CLI_CONFIG_FILE at [DATABRICKS_TF_CLI_CONFIG_FILE] pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Environment variables for Terraform: ...redacted... pid=12345 mutator=terraform.Initialize 10:07:59 Debug: Apply pid=12345 mutator=scripts.postinit 10:07:59 Debug: No script defined for postinit, skipping pid=12345 mutator=scripts.postinit From 5e5c01d9d27161e1fdd0504ef4f1d9f5c9c1130d Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 10 Sep 2025 15:40:33 +0200 Subject: [PATCH 3/8] update plan output --- acceptance/bundle/apps/app_yaml/output.txt | 2 +- acceptance/bundle/bundle_tag/id/output.txt | 2 +- acceptance/bundle/bundle_tag/url/output.txt | 2 +- .../url_ref/out.plan.direct-exp.txt | 1 - .../bundle_tag/url_ref/out.plan.terraform.txt | 2 +- .../bundle/deploy/jobs/task-source/output.txt | 2 +- .../deploy/pipeline/auto-approve/output.txt | 2 +- .../deploy/pipeline/recreate/output.txt | 4 +-- .../bundle/deploy/pipeline/recreate/script | 2 +- acceptance/bundle/plan/no_upload/output.txt | 2 +- .../bad_syntax/out.plan.direct-exp.txt | 2 +- .../bad_syntax/out.plan.terraform.txt | 1 - .../resource_deps/create_error/output.txt | 4 +-- .../bundle/resource_deps/id_chain/output.txt | 4 +-- .../bundle/resource_deps/job_id/output.txt | 2 +- .../resource_deps/jobs_update/output.txt | 8 +++--- .../loop_jobs/out.plan.direct-exp.txt | 1 - .../loop_jobs/out.plan.terraform.txt | 1 - .../loop_self/out.plan.direct-exp.txt | 1 - .../loop_self/out.plan.terraform.txt | 1 - .../out.plan.direct-exp.txt | 1 - .../out.plan.terraform.txt | 1 - .../missing_map_key/out.plan.direct-exp.txt | 1 - .../missing_map_key/out.plan.terraform.txt | 1 - .../out.plan.direct-exp.txt | 1 - .../out.plan.terraform.txt | 1 - .../out.plan.direct-exp.txt | 2 +- .../out.plan.terraform.txt | 2 +- .../out.plan.direct-exp.txt | 1 - .../non_existent_field/out.plan.terraform.txt | 1 - .../pipelines_recreate/output.txt | 8 +++--- .../out.plan.direct-exp.txt | 2 +- .../out.plan.terraform.txt | 1 - .../remote_field_storage_location/output.txt | 2 +- .../bundle/resources/apps/update/output.txt | 8 +++--- .../bundle/resources/jobs/update/output.txt | 8 +++--- .../recreate/change-catalog/output.txt | 4 +-- .../change-ingestion-definition/output.txt | 4 +-- .../recreate/change-storage/output.txt | 4 +-- .../resources/schemas/recreate/output.txt | 2 +- .../resources/volumes/change-name/output.txt | 2 +- .../volumes/change-schema-name/output.txt | 2 +- .../volumes/set-storage-location/output.txt | 2 +- cmd/bundle/plan.go | 28 ++++++++++++++++--- 44 files changed, 70 insertions(+), 65 deletions(-) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index 8748943877..b7f4444cea 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -9,7 +9,7 @@ Workspace: Validation OK! >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create apps.myapp >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index 4db8ae5174..28e129a3c3 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -30,7 +30,7 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create jobs.foo >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index f49888cdfe..81b26c4fff 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -30,7 +30,7 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create jobs.foo >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt index 83acc7119a..f8ee1da817 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.direct-exp.txt @@ -4,6 +4,5 @@ Error: cannot plan jobs.bar: dependency failed: jobs.foo Error: planning failed -No changes. Your infrastructure matches the configuration. Exit code: 1 diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index 7dd5f4d80b..a7dc0a04ea 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create jobs.bar create jobs.foo diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index 7539149296..307aa25bc6 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -14,7 +14,7 @@ Deployment complete! >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | select(.body.name=="workspace_job") | .body out.requests.txt >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged update jobs.git_job >>> [CLI] bundle deploy diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt index 402646c55d..0a1b7dd32e 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt +++ b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt @@ -36,7 +36,7 @@ Deployment complete! >>> rm resources.yml >>> [CLI] bundle plan -Plan: 0 to add, 0 to change, 2 to delete +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete jobs.foo delete pipelines.bar diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index 4c2c0fd18f..ea8a6c8287 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -30,10 +30,10 @@ Deployment complete! } } +>>> [CLI] bundle plan --var=catalog=another_catalog +Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged recreate pipelines.foo recreate schemas.bar ->>> [CLI] bundle plan --var=catalog=another_catalog -Plan: 2 to add, 0 to change, 2 to delete === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog >>> errcode [CLI] bundle deploy --force-lock --var=catalog=another_catalog diff --git a/acceptance/bundle/deploy/pipeline/recreate/script b/acceptance/bundle/deploy/pipeline/recreate/script index bdad9c652d..f648dcaeff 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/script +++ b/acceptance/bundle/deploy/pipeline/recreate/script @@ -11,7 +11,7 @@ title "Assert the pipeline is created" PIPELINE_ID=$($CLI bundle summary -o json | jq -r '.resources.pipelines.foo.id') trace $CLI pipelines get "${PIPELINE_ID}" | jq "{spec}" -trace $CLI bundle plan --var="catalog=another_catalog" 2>&1 | sort +trace $CLI bundle plan --var="catalog=another_catalog" 2>&1 title "Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog" trace errcode $CLI bundle deploy --force-lock --var="catalog=another_catalog" diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index e2372ad7d6..7acd3ea657 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create jobs.my_job >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index f62afcafcc..8e1cb91bec 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create volumes.bar create volumes.foo diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt index fc7d71561a..b8f8078aba 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.terraform.txt @@ -8,4 +8,3 @@ Error: Invalid attribute name An attribute name is required after a dot. -No changes. Your infrastructure matches the configuration. diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index c7d24db796..d1a64fe75c 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 4 to add, 0 to change, 0 to delete +Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged create jobs.bar create jobs.baz create jobs.foo @@ -67,7 +67,7 @@ Resources: === Plan should still contain foo and bar >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete +Plan: 3 to add, 0 to change, 0 to delete, 1 unchanged create jobs.bar create jobs.baz create jobs.foo diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index 04413fa5bd..1fcefecd07 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 5 to add, 0 to change, 0 to delete +Plan: 5 to add, 0 to change, 0 to delete, 0 unchanged create jobs.a create jobs.b create jobs.c @@ -27,7 +27,7 @@ Deployment complete! >>> update_file.py databricks.yml prefix new_prefix >>> [CLI] bundle plan -Plan: 0 to add, 5 to change, 0 to delete +Plan: 0 to add, 5 to change, 0 to delete, 0 unchanged update jobs.a update jobs.b update jobs.c diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index e286f86a13..96b6c89b5d 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create jobs.bar create jobs.foo diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index 0cfe26335f..b3df85d0e9 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create jobs.bar create jobs.foo @@ -64,13 +64,13 @@ Deployment complete! } >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged === Update trigger.periodic.unit and re-deploy; jobs.bar is unchanged >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged update jobs.foo >>> [CLI] bundle deploy @@ -118,7 +118,7 @@ Deployment complete! } >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged === Fetch job ID and verify remote state >>> [CLI] jobs get [FOO_ID] diff --git a/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt index 3b1c786a2b..79d8640680 100644 --- a/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/loop_jobs/out.plan.direct-exp.txt @@ -1,5 +1,4 @@ Error: cycle detected: jobs.foo refers to jobs.bar via ${resources.jobs.bar.id} which refers to jobs.foo via ${resources.jobs.foo.id} -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt b/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt index 5c9962b974..9b5905750f 100644 --- a/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/loop_jobs/out.plan.terraform.txt @@ -4,6 +4,5 @@ Error: Cycle: databricks_job.foo, databricks_job.bar -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt index 3169468971..528213730a 100644 --- a/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/loop_self/out.plan.direct-exp.txt @@ -1,5 +1,4 @@ Error: cycle detected: jobs.foo refers to itself via ${resources.jobs.foo.id} -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt b/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt index 2fd4bdc51c..9526ddf5ea 100644 --- a/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/loop_self/out.plan.terraform.txt @@ -15,6 +15,5 @@ Error: Self-referential block Configuration for databricks_job.foo may not refer to itself. -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt index 9a04e03a5d..098d1334b4 100644 --- a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.direct-exp.txt @@ -4,6 +4,5 @@ Error: cannot plan pipelines.bar: dependency failed: pipelines.foo Error: planning failed -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt index 506e5696fe..0255c96dd6 100644 --- a/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_ingestion_definition/out.plan.terraform.txt @@ -9,6 +9,5 @@ Block type "ingestion_definition" is represented by a list of objects, so it must be indexed using a numeric key, like .ingestion_definition[0]. -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt index d0699f8a32..a31caa4337 100644 --- a/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_map_key/out.plan.direct-exp.txt @@ -4,6 +4,5 @@ Error: cannot plan jobs.bar: dependency failed: jobs.test Error: planning failed -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt index 38e7db9fea..ca1c8d65dc 100644 --- a/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_map_key/out.plan.terraform.txt @@ -9,6 +9,5 @@ This object has no argument, nested block, or exported attribute named "tasks". Did you mean "tags"? -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt index fa5f32e255..d698c84c29 100644 --- a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.direct-exp.txt @@ -4,6 +4,5 @@ Error: cannot plan jobs.bar: dependency failed: jobs.test Error: planning failed -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt index 4cf5600786..6f338a03f3 100644 --- a/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_map_key_tffix/out.plan.terraform.txt @@ -10,6 +10,5 @@ Error: Missing map element This map does not have an element with the key "missing_tag". -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index a7eee391ba..a8b2b80288 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -2,6 +2,6 @@ Warning: expected a string value, found null at resources.pipelines.bar.catalog in databricks.yml:6:16 -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.bar create pipelines.foo diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index 1337f08aea..5689d254a4 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.bar create pipelines.foo diff --git a/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt index 0ced59599c..971bd4635a 100644 --- a/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/non_existent_field/out.plan.direct-exp.txt @@ -4,6 +4,5 @@ Error: cannot plan volumes.foo: dependency failed: volumes.bar Error: planning failed -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt index 23dcda83bf..c08bb33dbb 100644 --- a/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/non_existent_field/out.plan.terraform.txt @@ -9,6 +9,5 @@ This object has no argument, nested block, or exported attribute named "non_existent". -No changes. Your infrastructure matches the configuration. Exit code (musterr): 1 diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index 365a90f7a0..588de396d8 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create jobs.bar create pipelines.foo @@ -45,13 +45,13 @@ Deployment complete! } >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged === Update catalog, triggering recreate for pipeline; this means updating downstream deps >>> update_file.py databricks.yml mycatalog mynewcatalog >>> [CLI] bundle plan -Plan: 1 to add, 1 to change, 1 to delete +Plan: 1 to add, 1 to change, 1 to delete, 0 unchanged update jobs.bar recreate pipelines.foo @@ -156,7 +156,7 @@ Exit code (musterr): 1 === Follow up plan & deploy do nothing >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index 1337f08aea..5689d254a4 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.bar create pipelines.foo diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt index 5ec74260d9..d084d3dd3a 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.terraform.txt @@ -9,6 +9,5 @@ Block type "ingestion_definition" is represented by a list of objects, so it must be indexed using a numeric key, like .ingestion_definition[0]. -No changes. Your infrastructure matches the configuration. Exit code: 1 diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 5ece67a37c..91c32e1f26 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -25,7 +25,7 @@ } >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete +Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged create schemas.my create volumes.bar create volumes.foo diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index c0821b3ed1..bc534816ce 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create apps.mykey >>> [CLI] bundle deploy @@ -35,7 +35,7 @@ Resources: >>> update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged update apps.mykey >>> [CLI] bundle deploy @@ -70,7 +70,7 @@ Resources: >>> update_file.py databricks.yml myappname mynewappname >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate apps.mykey >>> [CLI] bundle summary @@ -107,7 +107,7 @@ Deployment complete! } >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle summary Name: test-bundle diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index 9a32280a51..161a7ef645 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create jobs.foo >>> [CLI] bundle deploy @@ -10,7 +10,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged >>> print_requests { @@ -52,7 +52,7 @@ jobs foo id='[JOB_ID]' name='foo' >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged update jobs.foo >>> [CLI] bundle deploy @@ -62,7 +62,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle plan -No changes. Your infrastructure matches the configuration. +Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged >>> print_requests { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index 7c32e1d9f4..2cb9e7cfea 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -15,7 +15,7 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.my >>> [CLI] bundle deploy @@ -50,7 +50,7 @@ Deployment complete! >>> update_file.py databricks.yml catalog1 catalog2 >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate pipelines.my >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index 6fcefdb92c..a8986a4056 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -15,7 +15,7 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.my >>> [CLI] bundle deploy @@ -55,7 +55,7 @@ Deployment complete! >>> update_file.py databricks.yml my_connection my_new_connection >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate pipelines.my >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index e914f554df..d7a25efbfd 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -15,7 +15,7 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged create pipelines.my >>> [CLI] bundle deploy @@ -50,7 +50,7 @@ Deployment complete! >>> update_file.py databricks.yml pipelines/custom pipelines/newcustom >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate pipelines.my >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index 392bb9a330..8f22771b7c 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -31,7 +31,7 @@ Deployment complete! >>> update_file.py databricks.yml catalog_name: main catalog_name: newmain >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate schemas.schema1 >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index 6c8afe48c9..8260c09df5 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -37,7 +37,7 @@ Deployment complete! >>> update_file.py databricks.yml myvolume mynewvolume >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged update volumes.volume1 >>> [CLI] bundle deploy diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index f4b7ae58a0..c519108c73 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -37,7 +37,7 @@ Deployment complete! >>> update_file.py databricks.yml myschema mynewschema >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged recreate volumes.volume1 >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index bca6db6b6d..fb084ba93c 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged create schemas.myschema create volumes.volume1 diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index efa6c95de2..5dbc345b79 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -9,6 +9,7 @@ import ( "github.com/databricks/cli/bundle/phases" "github.com/databricks/cli/cmd/bundle/utils" "github.com/databricks/cli/cmd/root" + "github.com/databricks/cli/libs/dyn" "github.com/databricks/cli/libs/logdiag" "github.com/spf13/cobra" ) @@ -72,17 +73,21 @@ func newPlanCommand() *cobra.Command { } changes := phases.Diff(ctx, b) + if logdiag.HasError(ctx) { + return root.ErrAlreadyPrinted + } // Count actions by type and collect formatted actions createCount := 0 updateCount := 0 deleteCount := 0 var actions []string + changed := make(map[string]bool) for _, change := range changes { actionItem := fmt.Sprintf(" %s %s.%s", change.ActionType, change.Group, change.Key) actions = append(actions, actionItem) - + changed[change.Group+"."+change.Key] = true switch change.ActionType.String() { case "create": createCount++ @@ -97,17 +102,32 @@ func newPlanCommand() *cobra.Command { } } + // Calculate number of all unchanged resources + unchanged := 0 + rv := b.Config.Value().Get("resources") + if rv.Kind() != dyn.KindInvalid && rv.Kind() != dyn.KindNil { + _, err := dyn.MapByPattern(rv, dyn.NewPattern(dyn.AnyKey(), dyn.AnyKey()), func(p dyn.Path, v dyn.Value) (dyn.Value, error) { + if _, ok := changed[p[0].Key()+"."+p[1].Key()]; !ok { + unchanged++ + } + return v, nil + }) + if err != nil { + return root.ErrAlreadyPrinted + } + } + // Print summary line and actions to stdout totalChanges := createCount + updateCount + deleteCount if totalChanges > 0 { - fmt.Printf("Plan: %d to add, %d to change, %d to delete\n", createCount, updateCount, deleteCount) + fmt.Printf("Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) // Print all actions in the order they were processed for _, action := range actions { - fmt.Println(action) + fmt.Fprintf(cmd.OutOrStdout(), "%s\n", action) } } else { - fmt.Println("No changes. Your infrastructure matches the configuration.") + fmt.Printf("Plan: 0 to add, 0 to change, 0 to delete, %d unchanged\n", unchanged) } if logdiag.HasError(ctx) { From c32e4a80cb284f6c79007ebdf195b95d9d908079 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Fri, 19 Sep 2025 12:14:24 +0200 Subject: [PATCH 4/8] update output --- acceptance/bundle/apps/app_yaml/output.txt | 4 +-- acceptance/bundle/bundle_tag/id/output.txt | 4 +-- acceptance/bundle/bundle_tag/url/output.txt | 4 +-- .../bundle_tag/url_ref/out.plan.terraform.txt | 6 ++-- .../bundle/deploy/jobs/task-source/output.txt | 4 +-- .../deploy/pipeline/auto-approve/output.txt | 4 +-- .../deploy/pipeline/recreate/output.txt | 6 ++-- .../deployment/bind/alert/out.test.toml | 2 +- .../prevent-destroy/out.direct-exp.txt | 4 +++ .../prevent-destroy/out.terraform.txt | 2 ++ .../lifecycle/prevent-destroy/output.txt | 1 + acceptance/bundle/plan/no_upload/output.txt | 4 +-- .../bad_syntax/out.plan.direct-exp.txt | 6 ++-- .../resource_deps/create_error/output.txt | 18 +++++------ .../bundle/resource_deps/id_chain/output.txt | 24 +++++++-------- .../bundle/resource_deps/job_id/output.txt | 6 ++-- .../resource_deps/jobs_update/output.txt | 10 +++---- .../out.plan.direct-exp.txt | 6 ++-- .../out.plan.terraform.txt | 6 ++-- .../pipelines_recreate/output.txt | 12 ++++---- .../out.plan.direct-exp.txt | 6 ++-- .../resource_deps/remote_app_url/output.txt | 1 + .../remote_field_storage_location/output.txt | 8 ++--- .../bundle/resources/apps/update/output.txt | 12 ++++---- .../bundle/resources/jobs/update/output.txt | 8 ++--- .../recreate/change-catalog/output.txt | 8 ++--- .../change-ingestion-definition/output.txt | 8 ++--- .../recreate/change-storage/output.txt | 8 ++--- .../resources/schemas/recreate/output.txt | 4 +-- .../resources/volumes/change-name/output.txt | 4 +-- .../volumes/change-schema-name/output.txt | 4 +-- .../volumes/set-storage-location/output.txt | 6 ++-- cmd/bundle/plan.go | 30 +++++++++---------- 33 files changed, 124 insertions(+), 116 deletions(-) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index b7f4444cea..540c4d85e8 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -9,8 +9,8 @@ Workspace: Validation OK! >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create apps.myapp +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create apps.myapp >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index 28e129a3c3..e9f0f6d4a8 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -30,8 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index 81b26c4fff..969f6ac5af 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -30,8 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index a7dc0a04ea..778fab225c 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.bar - create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create jobs.bar +create jobs.foo diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index 307aa25bc6..d936d94596 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -14,8 +14,8 @@ Deployment complete! >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | select(.body.name=="workspace_job") | .body out.requests.txt >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged - update jobs.git_job +Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged +update jobs.git_job >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/task-source/default/files... diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt index 0a1b7dd32e..93a7e079de 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt +++ b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt @@ -37,8 +37,8 @@ Deployment complete! >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged - delete jobs.foo - delete pipelines.bar +delete jobs.foo +delete pipelines.bar === Try to redeploy the bundle - should fail without --auto-approve >>> errcode [CLI] bundle deploy diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index ea8a6c8287..1db6c7b938 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -31,9 +31,9 @@ Deployment complete! } >>> [CLI] bundle plan --var=catalog=another_catalog -Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged - recreate pipelines.foo - recreate schemas.bar +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged +recreate pipelines.foo +recreate schemas.bar === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog >>> errcode [CLI] bundle deploy --force-lock --var=catalog=another_catalog diff --git a/acceptance/bundle/deployment/bind/alert/out.test.toml b/acceptance/bundle/deployment/bind/alert/out.test.toml index 90061dedb1..f9eb74f070 100644 --- a/acceptance/bundle/deployment/bind/alert/out.test.toml +++ b/acceptance/bundle/deployment/bind/alert/out.test.toml @@ -1,4 +1,4 @@ -Local = true +Local = false Cloud = false [EnvMatrix] diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt index 703c9f96c1..5ba53fb52a 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt @@ -7,6 +7,7 @@ resources.schemas.my_schema has lifecycle.prevent_destroy set, but the plan call Exit code (musterr): 1 >>> errcode [CLI] bundle plan +Plan: 1 to add, 0 to change, 1 to delete, 2 unchanged recreate pipelines.my_pipelines >>> musterr [CLI] bundle deploy @@ -17,6 +18,7 @@ Error: resources.pipelines.my_pipelines has lifecycle.prevent_destroy set, but t Exit code (musterr): 1 >>> errcode [CLI] bundle plan +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema @@ -29,6 +31,7 @@ resources.schemas.my_schema has lifecycle.prevent_destroy set, but the plan call Exit code (musterr): 1 >>> errcode [CLI] bundle plan +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema @@ -48,6 +51,7 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle plan +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete pipelines.my_pipelines delete schemas.my_schema diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt index 3c78d4985c..952b235570 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt @@ -117,6 +117,7 @@ the scope of the plan using the -target flag. Exit code (musterr): 1 >>> errcode [CLI] bundle plan +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema @@ -136,6 +137,7 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle plan +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete pipelines.my_pipelines delete schemas.my_schema diff --git a/acceptance/bundle/lifecycle/prevent-destroy/output.txt b/acceptance/bundle/lifecycle/prevent-destroy/output.txt index 33bdbbc346..6a0f626b37 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/output.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/output.txt @@ -15,3 +15,4 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle plan +Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index 7acd3ea657..78bc07553f 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.my_job +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create jobs.my_job >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index 8e1cb91bec..9b3496d06c 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create volumes.bar - create volumes.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create volumes.bar +create volumes.foo diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index d1a64fe75c..217ae7ad7b 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -1,10 +1,10 @@ >>> [CLI] bundle plan -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.bar - create jobs.baz - create jobs.foo - create jobs.independent +Plan: 4 to add, 0 to change, 0 to delete, 4 unchanged +create jobs.bar +create jobs.baz +create jobs.foo +create jobs.independent >>> print_sorted_requests { @@ -67,10 +67,10 @@ Resources: === Plan should still contain foo and bar >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete, 1 unchanged - create jobs.bar - create jobs.baz - create jobs.foo +Plan: 3 to add, 0 to change, 0 to delete, 4 unchanged +create jobs.bar +create jobs.baz +create jobs.foo === Expecting no difference in the output between first and second deploy >>> print_requests diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index 1fcefecd07..dde5765822 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -1,11 +1,11 @@ >>> [CLI] bundle plan -Plan: 5 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.a - create jobs.b - create jobs.c - create jobs.d - create jobs.e +Plan: 5 to add, 0 to change, 0 to delete, 5 unchanged +create jobs.a +create jobs.b +create jobs.c +create jobs.d +create jobs.e >>> print_requests @@ -27,12 +27,12 @@ Deployment complete! >>> update_file.py databricks.yml prefix new_prefix >>> [CLI] bundle plan -Plan: 0 to add, 5 to change, 0 to delete, 0 unchanged - update jobs.a - update jobs.b - update jobs.c - update jobs.d - update jobs.e +Plan: 0 to add, 5 to change, 0 to delete, 5 unchanged +update jobs.a +update jobs.b +update jobs.c +update jobs.d +update jobs.e >>> print_requests diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index 96b6c89b5d..640e604cbb 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.bar - create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create jobs.bar +create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index b3df85d0e9..8b6c21b707 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.bar - create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create jobs.bar +create jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -70,8 +70,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged - update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged +update jobs.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index a8b2b80288..860fc98652 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -2,6 +2,6 @@ Warning: expected a string value, found null at resources.pipelines.bar.catalog in databricks.yml:6:16 -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.bar - create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create pipelines.bar +create pipelines.foo diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index 5689d254a4..4f04a47b6b 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.bar - create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create pipelines.bar +create pipelines.foo diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index 588de396d8..c88ea1aef4 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.bar - create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create jobs.bar +create pipelines.foo >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -51,9 +51,9 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> update_file.py databricks.yml mycatalog mynewcatalog >>> [CLI] bundle plan -Plan: 1 to add, 1 to change, 1 to delete, 0 unchanged - update jobs.bar - recreate pipelines.foo +Plan: 1 to add, 1 to change, 1 to delete, 2 unchanged +update jobs.bar +recreate pipelines.foo >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index 5689d254a4..4f04a47b6b 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.bar - create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create pipelines.bar +create pipelines.foo diff --git a/acceptance/bundle/resource_deps/remote_app_url/output.txt b/acceptance/bundle/resource_deps/remote_app_url/output.txt index 4f5d31a65c..ff914437c0 100644 --- a/acceptance/bundle/resource_deps/remote_app_url/output.txt +++ b/acceptance/bundle/resource_deps/remote_app_url/output.txt @@ -9,6 +9,7 @@ Workspace: Validation OK! >>> [CLI] bundle plan +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create apps.myapp create pipelines.mypipeline diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 91c32e1f26..784f9d5689 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -25,10 +25,10 @@ } >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged - create schemas.my - create volumes.bar - create volumes.foo +Plan: 3 to add, 0 to change, 0 to delete, 3 unchanged +create schemas.my +create volumes.bar +create volumes.foo >>> print_requests diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index bc534816ce..2a3c439ff5 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create apps.mykey +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create apps.mykey >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -35,8 +35,8 @@ Resources: >>> update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged - update apps.mykey +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +update apps.mykey >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -70,8 +70,8 @@ Resources: >>> update_file.py databricks.yml myappname mynewappname >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate apps.mykey +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate apps.mykey >>> [CLI] bundle summary Name: test-bundle diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index 121dac75ed..c345029094 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create jobs.foo >>> [CLI] bundle plan -o json { @@ -66,8 +66,8 @@ jobs foo id='[JOB_ID]' name='foo' >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged - update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +update jobs.foo >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index 74973091ab..80b70da9a6 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create pipelines.my >>> [CLI] bundle plan -o json { @@ -59,8 +59,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog1 catalog2 >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate pipelines.my >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index 6b6b4c5376..bdb01f5b9b 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create pipelines.my >>> [CLI] bundle plan -o json { @@ -64,8 +64,8 @@ Deployment complete! >>> update_file.py databricks.yml my_connection my_new_connection >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate pipelines.my >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index 48d68b7476..bf17534b33 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged - create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +create pipelines.my >>> [CLI] bundle plan -o json { @@ -59,8 +59,8 @@ Deployment complete! >>> update_file.py databricks.yml pipelines/custom pipelines/newcustom >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate pipelines.my >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index 8f22771b7c..ecb76869fc 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -31,8 +31,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog_name: main catalog_name: newmain >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate schemas.schema1 +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate schemas.schema1 >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index a7b01fac23..ed3dd44910 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -37,8 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myvolume mynewvolume >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged - update volumes.volume1 +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +update volumes.volume1 >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index c519108c73..0cb4249732 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -37,8 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myschema mynewschema >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged - recreate volumes.volume1 +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +recreate volumes.volume1 >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index fb084ba93c..497da94716 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged - create schemas.myschema - create volumes.volume1 +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +create schemas.myschema +create volumes.volume1 >>> print_requests diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index 2b1064d2be..9d80c00743 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -87,8 +87,8 @@ func newPlanCommand() *cobra.Command { changed := make(map[string]bool) for _, change := range plan.GetActions() { - changed[change.Group+"."+change.Key] = true - switch change.ActionType.String() { + changed[change.ResourceKey] = true + switch change.ActionType.StringShort() { case "create": createCount++ case "update", "update_with_id": @@ -121,19 +121,19 @@ func newPlanCommand() *cobra.Command { switch root.OutputType(cmd) { case flags.OutputText: - // Print summary line and actions to stdout - totalChanges := createCount + updateCount + deleteCount - if totalChanges > 0 { - fmt.Fprintf(out, "Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) - - // Print all actions in the order they were processed - for _, action := range plan.GetActions() { - key := strings.TrimPrefix(action.ResourceKey, "resources.") - fmt.Fprintf(out, "%s %s\n", action.ActionType.StringShort(), key) - } - } else { - fmt.Fprintf(out, "Plan: 0 to add, 0 to change, 0 to delete, %d unchanged\n", unchanged) - } + // Print summary line and actions to stdout + totalChanges := createCount + updateCount + deleteCount + if totalChanges > 0 { + fmt.Fprintf(out, "Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) + + // Print all actions in the order they were processed + for _, action := range plan.GetActions() { + key := strings.TrimPrefix(action.ResourceKey, "resources.") + fmt.Fprintf(out, "%s %s\n", action.ActionType.StringShort(), key) + } + } else { + fmt.Fprintf(out, "Plan: 0 to add, 0 to change, 0 to delete, %d unchanged\n", unchanged) + } case flags.OutputJSON: buf, err := json.MarshalIndent(plan, "", " ") if err != nil { From bcb4da721e825e15579901bc258a25da879556d9 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Tue, 23 Sep 2025 15:42:52 +0200 Subject: [PATCH 5/8] fixes --- acceptance/bundle/apps/app_yaml/output.txt | 2 +- acceptance/bundle/bundle_tag/id/output.txt | 2 +- acceptance/bundle/bundle_tag/url/output.txt | 2 +- .../bundle_tag/url_ref/out.plan.terraform.txt | 2 +- .../bundle/deploy/jobs/task-source/output.txt | 2 +- .../deploy/pipeline/auto-approve/output.txt | 2 +- .../bundle/deploy/pipeline/recreate/output.txt | 2 +- .../prevent-destroy/out.direct-exp.txt | 8 ++++---- .../lifecycle/prevent-destroy/out.terraform.txt | 4 ++-- acceptance/bundle/plan/no_upload/output.txt | 2 +- .../bad_syntax/out.plan.direct-exp.txt | 2 +- .../resource_deps/create_error/output.txt | 4 ++-- .../bundle/resource_deps/id_chain/output.txt | 4 ++-- .../bundle/resource_deps/job_id/output.txt | 2 +- .../bundle/resource_deps/jobs_update/output.txt | 4 ++-- .../out.plan.direct-exp.txt | 2 +- .../missing_string_field/out.plan.terraform.txt | 2 +- .../resource_deps/pipelines_recreate/output.txt | 4 ++-- .../out.plan.direct-exp.txt | 2 +- .../resource_deps/remote_app_url/output.txt | 2 +- .../remote_field_storage_location/output.txt | 2 +- .../bundle/resources/apps/update/output.txt | 6 +++--- .../bundle/resources/jobs/update/output.txt | 4 ++-- .../recreate/change-catalog/output.txt | 4 ++-- .../change-ingestion-definition/output.txt | 4 ++-- .../recreate/change-storage/output.txt | 4 ++-- .../resources/schemas/recreate/output.txt | 2 +- .../resources/volumes/change-name/output.txt | 2 +- .../volumes/change-schema-name/output.txt | 2 +- .../volumes/set-storage-location/output.txt | 2 +- cmd/bundle/plan.go | 17 ++++------------- 31 files changed, 48 insertions(+), 57 deletions(-) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index 540c4d85e8..8ca833ad1a 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -9,8 +9,8 @@ Workspace: Validation OK! >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create apps.myapp +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index e9f0f6d4a8..6e3f50e0c1 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -30,8 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index 969f6ac5af..9dec1e0f2c 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -30,8 +30,8 @@ Validation OK! } >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index 778fab225c..c2f770acb2 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create jobs.bar create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index d936d94596..149d9da50c 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -14,8 +14,8 @@ Deployment complete! >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | select(.body.name=="workspace_job") | .body out.requests.txt >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged update jobs.git_job +Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/task-source/default/files... diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt index 93a7e079de..b7df2cfcf0 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt +++ b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt @@ -36,9 +36,9 @@ Deployment complete! >>> rm resources.yml >>> [CLI] bundle plan -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete jobs.foo delete pipelines.bar +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged === Try to redeploy the bundle - should fail without --auto-approve >>> errcode [CLI] bundle deploy diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index 1db6c7b938..4d3cb5862a 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -31,9 +31,9 @@ Deployment complete! } >>> [CLI] bundle plan --var=catalog=another_catalog -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.foo recreate schemas.bar +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog >>> errcode [CLI] bundle deploy --force-lock --var=catalog=another_catalog diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt index 5ba53fb52a..71fa7e2bff 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt @@ -7,8 +7,8 @@ resources.schemas.my_schema has lifecycle.prevent_destroy set, but the plan call Exit code (musterr): 1 >>> errcode [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 2 unchanged recreate pipelines.my_pipelines +Plan: 1 to add, 0 to change, 1 to delete, 2 unchanged >>> musterr [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -18,9 +18,9 @@ Error: resources.pipelines.my_pipelines has lifecycle.prevent_destroy set, but t Exit code (musterr): 1 >>> errcode [CLI] bundle plan -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged >>> musterr [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -31,9 +31,9 @@ resources.schemas.my_schema has lifecycle.prevent_destroy set, but the plan call Exit code (musterr): 1 >>> errcode [CLI] bundle plan -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -51,9 +51,9 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle plan -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete pipelines.my_pipelines delete schemas.my_schema +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt index 952b235570..8d3fe84f6d 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt @@ -117,9 +117,9 @@ the scope of the plan using the -target flag. Exit code (musterr): 1 >>> errcode [CLI] bundle plan -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged recreate pipelines.my_pipelines recreate schemas.my_schema +Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -137,9 +137,9 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle plan -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged delete pipelines.my_pipelines delete schemas.my_schema +Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index 78bc07553f..a5b910977b 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create jobs.my_job +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index 9b3496d06c..52075196a7 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create volumes.bar create volumes.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index 217ae7ad7b..2c9bf01567 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -1,10 +1,10 @@ >>> [CLI] bundle plan -Plan: 4 to add, 0 to change, 0 to delete, 4 unchanged create jobs.bar create jobs.baz create jobs.foo create jobs.independent +Plan: 4 to add, 0 to change, 0 to delete, 4 unchanged >>> print_sorted_requests { @@ -67,10 +67,10 @@ Resources: === Plan should still contain foo and bar >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete, 4 unchanged create jobs.bar create jobs.baz create jobs.foo +Plan: 3 to add, 0 to change, 0 to delete, 4 unchanged === Expecting no difference in the output between first and second deploy >>> print_requests diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index dde5765822..4e50fb734d 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -1,11 +1,11 @@ >>> [CLI] bundle plan -Plan: 5 to add, 0 to change, 0 to delete, 5 unchanged create jobs.a create jobs.b create jobs.c create jobs.d create jobs.e +Plan: 5 to add, 0 to change, 0 to delete, 5 unchanged >>> print_requests @@ -27,12 +27,12 @@ Deployment complete! >>> update_file.py databricks.yml prefix new_prefix >>> [CLI] bundle plan -Plan: 0 to add, 5 to change, 0 to delete, 5 unchanged update jobs.a update jobs.b update jobs.c update jobs.d update jobs.e +Plan: 0 to add, 5 to change, 0 to delete, 5 unchanged >>> print_requests diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index 640e604cbb..1b37551e2d 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create jobs.bar create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index 8b6c21b707..d94ef19d37 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create jobs.bar create jobs.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -70,8 +70,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index 860fc98652..7389c21bd7 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -2,6 +2,6 @@ Warning: expected a string value, found null at resources.pipelines.bar.catalog in databricks.yml:6:16 -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create pipelines.bar create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index 4f04a47b6b..74c5636efc 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create pipelines.bar create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index c88ea1aef4..adb77e57aa 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create jobs.bar create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -51,9 +51,9 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> update_file.py databricks.yml mycatalog mynewcatalog >>> [CLI] bundle plan -Plan: 1 to add, 1 to change, 1 to delete, 2 unchanged update jobs.bar recreate pipelines.foo +Plan: 1 to add, 1 to change, 1 to delete, 2 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index 4f04a47b6b..74c5636efc 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create pipelines.bar create pipelines.foo +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resource_deps/remote_app_url/output.txt b/acceptance/bundle/resource_deps/remote_app_url/output.txt index ff914437c0..ff7005adff 100644 --- a/acceptance/bundle/resource_deps/remote_app_url/output.txt +++ b/acceptance/bundle/resource_deps/remote_app_url/output.txt @@ -9,9 +9,9 @@ Workspace: Validation OK! >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create apps.myapp create pipelines.mypipeline +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged >>> print_requests { diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 784f9d5689..6268e81bd2 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -25,10 +25,10 @@ } >>> [CLI] bundle plan -Plan: 3 to add, 0 to change, 0 to delete, 3 unchanged create schemas.my create volumes.bar create volumes.foo +Plan: 3 to add, 0 to change, 0 to delete, 3 unchanged >>> print_requests diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index 2a3c439ff5..1a8ee23252 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create apps.mykey +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -35,8 +35,8 @@ Resources: >>> update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged update apps.mykey +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -70,8 +70,8 @@ Resources: >>> update_file.py databricks.yml myappname mynewappname >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate apps.mykey +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle summary Name: test-bundle diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index c345029094..6ec884c8d4 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create jobs.foo +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json { @@ -66,8 +66,8 @@ jobs foo id='[JOB_ID]' name='foo' >>> update_file.py databricks.yml DAYS HOURS >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged update jobs.foo +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index 80b70da9a6..e863fc2def 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json { @@ -59,8 +59,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog1 catalog2 >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index bdb01f5b9b..2137952f1a 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json { @@ -64,8 +64,8 @@ Deployment complete! >>> update_file.py databricks.yml my_connection my_new_connection >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index bf17534b33..0abf5c0152 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -15,8 +15,8 @@ resources: path: "./foo.py" >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged create pipelines.my +Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json { @@ -59,8 +59,8 @@ Deployment complete! >>> update_file.py databricks.yml pipelines/custom pipelines/newcustom >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate pipelines.my +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index ecb76869fc..d2a70befe7 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -31,8 +31,8 @@ Deployment complete! >>> update_file.py databricks.yml catalog_name: main catalog_name: newmain >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate schemas.schema1 +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index ed3dd44910..31ebf94374 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -37,8 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myvolume mynewvolume >>> [CLI] bundle plan -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged update volumes.volume1 +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index 0cb4249732..4b0ac41259 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -37,8 +37,8 @@ Deployment complete! >>> update_file.py databricks.yml myschema mynewschema >>> [CLI] bundle plan -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged recreate volumes.volume1 +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index 497da94716..251868feea 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -1,8 +1,8 @@ >>> [CLI] bundle plan -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged create schemas.myschema create volumes.volume1 +Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged >>> print_requests diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index 9d80c00743..ae5069c726 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -11,7 +11,6 @@ import ( "github.com/databricks/cli/bundle/phases" "github.com/databricks/cli/cmd/bundle/utils" "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/dyn" "github.com/databricks/cli/libs/flags" "github.com/databricks/cli/libs/logdiag" "github.com/spf13/cobra" @@ -104,16 +103,11 @@ func newPlanCommand() *cobra.Command { // Calculate number of all unchanged resources unchanged := 0 - rv := b.Config.Value().Get("resources") - if rv.Kind() != dyn.KindInvalid && rv.Kind() != dyn.KindNil { - _, err := dyn.MapByPattern(rv, dyn.NewPattern(dyn.AnyKey(), dyn.AnyKey()), func(p dyn.Path, v dyn.Value) (dyn.Value, error) { - if _, ok := changed[p[0].Key()+"."+p[1].Key()]; !ok { + for _, resource := range b.Config.Resources.AllResources() { + for _, resource := range resource.Resources { + if _, ok := changed[resource.GetName()]; !ok { unchanged++ } - return v, nil - }) - if err != nil { - return root.ErrAlreadyPrinted } } @@ -124,16 +118,13 @@ func newPlanCommand() *cobra.Command { // Print summary line and actions to stdout totalChanges := createCount + updateCount + deleteCount if totalChanges > 0 { - fmt.Fprintf(out, "Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) - // Print all actions in the order they were processed for _, action := range plan.GetActions() { key := strings.TrimPrefix(action.ResourceKey, "resources.") fmt.Fprintf(out, "%s %s\n", action.ActionType.StringShort(), key) } - } else { - fmt.Fprintf(out, "Plan: 0 to add, 0 to change, 0 to delete, %d unchanged\n", unchanged) } + fmt.Fprintf(out, "Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) case flags.OutputJSON: buf, err := json.MarshalIndent(plan, "", " ") if err != nil { From b96241fa3d8e12ecb6531980d893e401a0969b0b Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Tue, 23 Sep 2025 16:16:25 +0200 Subject: [PATCH 6/8] fix unchanged cout --- acceptance/bundle/apps/app_yaml/output.txt | 2 +- acceptance/bundle/bundle_tag/id/output.txt | 2 +- acceptance/bundle/bundle_tag/url/output.txt | 2 +- .../bundle/bundle_tag/url_ref/out.plan.terraform.txt | 2 +- acceptance/bundle/deploy/jobs/task-source/output.txt | 2 +- acceptance/bundle/deploy/pipeline/recreate/output.txt | 2 +- .../bundle/lifecycle/prevent-destroy/out.direct-exp.txt | 6 +++--- .../bundle/lifecycle/prevent-destroy/out.terraform.txt | 2 +- acceptance/bundle/plan/no_upload/output.txt | 2 +- .../resource_deps/bad_syntax/out.plan.direct-exp.txt | 2 +- acceptance/bundle/resource_deps/create_error/output.txt | 4 ++-- acceptance/bundle/resource_deps/id_chain/output.txt | 4 ++-- acceptance/bundle/resource_deps/job_id/output.txt | 2 +- acceptance/bundle/resource_deps/jobs_update/output.txt | 4 ++-- .../missing_string_field/out.plan.direct-exp.txt | 2 +- .../missing_string_field/out.plan.terraform.txt | 2 +- .../bundle/resource_deps/pipelines_recreate/output.txt | 4 ++-- .../present_ingestion_definition/out.plan.direct-exp.txt | 2 +- .../bundle/resource_deps/remote_app_url/output.txt | 2 +- .../remote_field_storage_location/output.txt | 2 +- acceptance/bundle/resources/apps/update/output.txt | 6 +++--- acceptance/bundle/resources/jobs/update/output.txt | 4 ++-- .../pipelines/recreate/change-catalog/output.txt | 4 ++-- .../recreate/change-ingestion-definition/output.txt | 4 ++-- .../pipelines/recreate/change-storage/output.txt | 4 ++-- acceptance/bundle/resources/schemas/recreate/output.txt | 2 +- .../bundle/resources/volumes/change-name/output.txt | 2 +- .../resources/volumes/change-schema-name/output.txt | 2 +- .../resources/volumes/set-storage-location/output.txt | 2 +- cmd/bundle/plan.go | 9 +++++---- 30 files changed, 46 insertions(+), 45 deletions(-) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index 8ca833ad1a..db3bb8fbcd 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -10,7 +10,7 @@ Validation OK! >>> [CLI] bundle plan create apps.myapp -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index 6e3f50e0c1..0733cdb956 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -31,7 +31,7 @@ Validation OK! >>> [CLI] bundle plan create jobs.foo -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index 9dec1e0f2c..55e1b76a28 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -31,7 +31,7 @@ Validation OK! >>> [CLI] bundle plan create jobs.foo -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index c2f770acb2..66a54f0b60 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,3 +1,3 @@ create jobs.bar create jobs.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index 149d9da50c..08158abd25 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -15,7 +15,7 @@ Deployment complete! >>> [CLI] bundle plan update jobs.git_job -Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/task-source/default/files... diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index 4d3cb5862a..65b4cc3d7c 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -33,7 +33,7 @@ Deployment complete! >>> [CLI] bundle plan --var=catalog=another_catalog recreate pipelines.foo recreate schemas.bar -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog >>> errcode [CLI] bundle deploy --force-lock --var=catalog=another_catalog diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt index 71fa7e2bff..c150b34baf 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt @@ -8,7 +8,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines -Plan: 1 to add, 0 to change, 1 to delete, 2 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> musterr [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -20,7 +20,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> musterr [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... @@ -33,7 +33,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt index 8d3fe84f6d..7ce6c5d0e5 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt @@ -119,7 +119,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema -Plan: 2 to add, 0 to change, 2 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/prevent-destroy/default/files... diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index a5b910977b..2cbedf33e8 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle plan create jobs.my_job -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index 52075196a7..4cb8256303 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ create volumes.bar create volumes.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index 2c9bf01567..adadd7ed2f 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -4,7 +4,7 @@ create jobs.bar create jobs.baz create jobs.foo create jobs.independent -Plan: 4 to add, 0 to change, 0 to delete, 4 unchanged +Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged >>> print_sorted_requests { @@ -70,7 +70,7 @@ Resources: create jobs.bar create jobs.baz create jobs.foo -Plan: 3 to add, 0 to change, 0 to delete, 4 unchanged +Plan: 3 to add, 0 to change, 0 to delete, 1 unchanged === Expecting no difference in the output between first and second deploy >>> print_requests diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index 4e50fb734d..e03c27f17c 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -5,7 +5,7 @@ create jobs.b create jobs.c create jobs.d create jobs.e -Plan: 5 to add, 0 to change, 0 to delete, 5 unchanged +Plan: 5 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests @@ -32,7 +32,7 @@ update jobs.b update jobs.c update jobs.d update jobs.e -Plan: 0 to add, 5 to change, 0 to delete, 5 unchanged +Plan: 0 to add, 5 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index 1b37551e2d..e522680c0f 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -2,7 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create jobs.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index d94ef19d37..235ee337e5 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -2,7 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create jobs.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -71,7 +71,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle plan update jobs.foo -Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged +Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index 7389c21bd7..a2c579072f 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -4,4 +4,4 @@ Warning: expected a string value, found null create pipelines.bar create pipelines.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index 74c5636efc..b191fd2674 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,3 +1,3 @@ create pipelines.bar create pipelines.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index adb77e57aa..3ddcf88359 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -2,7 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create pipelines.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -53,7 +53,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle plan update jobs.bar recreate pipelines.foo -Plan: 1 to add, 1 to change, 1 to delete, 2 unchanged +Plan: 1 to add, 1 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index 74c5636efc..b191fd2674 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,3 +1,3 @@ create pipelines.bar create pipelines.foo -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/remote_app_url/output.txt b/acceptance/bundle/resource_deps/remote_app_url/output.txt index ff7005adff..1a85a10ca3 100644 --- a/acceptance/bundle/resource_deps/remote_app_url/output.txt +++ b/acceptance/bundle/resource_deps/remote_app_url/output.txt @@ -11,7 +11,7 @@ Validation OK! >>> [CLI] bundle plan create apps.myapp create pipelines.mypipeline -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests { diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 6268e81bd2..6d836d9cab 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -28,7 +28,7 @@ create schemas.my create volumes.bar create volumes.foo -Plan: 3 to add, 0 to change, 0 to delete, 3 unchanged +Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index 1a8ee23252..e5571593ce 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan create apps.mykey -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -36,7 +36,7 @@ Resources: >>> [CLI] bundle plan update apps.mykey -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... @@ -71,7 +71,7 @@ Resources: >>> [CLI] bundle plan recreate apps.mykey -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle summary Name: test-bundle diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index 6ec884c8d4..77225cce0e 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle plan create jobs.foo -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json { @@ -67,7 +67,7 @@ jobs foo id='[JOB_ID]' name='foo' >>> [CLI] bundle plan update jobs.foo -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index e863fc2def..e05332f07b 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -16,7 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json { @@ -60,7 +60,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index 2137952f1a..d6d7bef72c 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -16,7 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json { @@ -65,7 +65,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index 0abf5c0152..74f08f6573 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -16,7 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my -Plan: 1 to add, 0 to change, 0 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json { @@ -60,7 +60,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json { diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index d2a70befe7..5a230f6ade 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -32,7 +32,7 @@ Deployment complete! >>> [CLI] bundle plan recreate schemas.schema1 -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index 31ebf94374..b26acdf1e6 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -38,7 +38,7 @@ Deployment complete! >>> [CLI] bundle plan update volumes.volume1 -Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index 4b0ac41259..503f6a2fa1 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -38,7 +38,7 @@ Deployment complete! >>> [CLI] bundle plan recreate volumes.volume1 -Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged +Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index 251868feea..e5e5f85f2e 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -2,7 +2,7 @@ >>> [CLI] bundle plan create schemas.myschema create volumes.volume1 -Plan: 2 to add, 0 to change, 0 to delete, 2 unchanged +Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index ae5069c726..234e728973 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -90,7 +90,7 @@ func newPlanCommand() *cobra.Command { switch change.ActionType.StringShort() { case "create": createCount++ - case "update", "update_with_id": + case "update": updateCount++ case "delete": deleteCount++ @@ -103,9 +103,10 @@ func newPlanCommand() *cobra.Command { // Calculate number of all unchanged resources unchanged := 0 - for _, resource := range b.Config.Resources.AllResources() { - for _, resource := range resource.Resources { - if _, ok := changed[resource.GetName()]; !ok { + for _, group := range b.Config.Resources.AllResources() { + for rKey := range group.Resources { + resourceKey := "resources." + group.Description.PluralName + "." + rKey + if _, ok := changed[resourceKey]; !ok { unchanged++ } } From 9bfc2eb8846dbe7e3ede5f93f3a293af769f6193 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Tue, 23 Sep 2025 16:28:16 +0200 Subject: [PATCH 7/8] explicit switch --- cmd/bundle/plan.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index 234e728973..f9f4230f5d 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -8,6 +8,7 @@ import ( "github.com/databricks/cli/bundle" "github.com/databricks/cli/bundle/config/validate" + "github.com/databricks/cli/bundle/deployplan" "github.com/databricks/cli/bundle/phases" "github.com/databricks/cli/cmd/bundle/utils" "github.com/databricks/cli/cmd/root" @@ -87,17 +88,19 @@ func newPlanCommand() *cobra.Command { for _, change := range plan.GetActions() { changed[change.ResourceKey] = true - switch change.ActionType.StringShort() { - case "create": + switch change.ActionType { + case deployplan.ActionTypeCreate: createCount++ - case "update": + case deployplan.ActionTypeUpdate, deployplan.ActionTypeUpdateWithID: updateCount++ - case "delete": + case deployplan.ActionTypeDelete: deleteCount++ - case "recreate": + case deployplan.ActionTypeRecreate, deployplan.ActionTypeResize: // A recreate counts as both a delete and a create deleteCount++ createCount++ + case deployplan.ActionTypeNoop, deployplan.ActionTypeUnset: + // Noop } } From 5fc9ac66d4e472af104bdf04a58f0e73f573db58 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 24 Sep 2025 11:01:57 +0200 Subject: [PATCH 8/8] added new line --- acceptance/bundle/apps/app_yaml/output.txt | 1 + acceptance/bundle/bundle_tag/id/output.txt | 1 + acceptance/bundle/bundle_tag/url/output.txt | 1 + acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt | 1 + acceptance/bundle/deploy/jobs/task-source/output.txt | 1 + acceptance/bundle/deploy/pipeline/auto-approve/output.txt | 1 + acceptance/bundle/deploy/pipeline/recreate/output.txt | 1 + .../bundle/lifecycle/prevent-destroy/out.direct-exp.txt | 4 ++++ acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt | 2 ++ acceptance/bundle/plan/no_upload/output.txt | 1 + .../bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt | 1 + acceptance/bundle/resource_deps/create_error/output.txt | 2 ++ acceptance/bundle/resource_deps/id_chain/output.txt | 2 ++ acceptance/bundle/resource_deps/job_id/output.txt | 1 + acceptance/bundle/resource_deps/jobs_update/output.txt | 2 ++ .../missing_string_field/out.plan.direct-exp.txt | 1 + .../resource_deps/missing_string_field/out.plan.terraform.txt | 1 + acceptance/bundle/resource_deps/pipelines_recreate/output.txt | 2 ++ .../present_ingestion_definition/out.plan.direct-exp.txt | 1 + acceptance/bundle/resource_deps/remote_app_url/output.txt | 1 + .../resource_deps/remote_field_storage_location/output.txt | 1 + acceptance/bundle/resources/apps/update/output.txt | 3 +++ acceptance/bundle/resources/jobs/update/output.txt | 2 ++ .../resources/pipelines/recreate/change-catalog/output.txt | 2 ++ .../pipelines/recreate/change-ingestion-definition/output.txt | 2 ++ .../resources/pipelines/recreate/change-storage/output.txt | 2 ++ acceptance/bundle/resources/schemas/recreate/output.txt | 1 + acceptance/bundle/resources/volumes/change-name/output.txt | 1 + .../bundle/resources/volumes/change-schema-name/output.txt | 1 + .../bundle/resources/volumes/set-storage-location/output.txt | 1 + cmd/bundle/plan.go | 1 + 31 files changed, 45 insertions(+) diff --git a/acceptance/bundle/apps/app_yaml/output.txt b/acceptance/bundle/apps/app_yaml/output.txt index db3bb8fbcd..5033a5c50d 100644 --- a/acceptance/bundle/apps/app_yaml/output.txt +++ b/acceptance/bundle/apps/app_yaml/output.txt @@ -10,6 +10,7 @@ Validation OK! >>> [CLI] bundle plan create apps.myapp + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/id/output.txt b/acceptance/bundle/bundle_tag/id/output.txt index 0733cdb956..ec9b87eeb3 100644 --- a/acceptance/bundle/bundle_tag/id/output.txt +++ b/acceptance/bundle/bundle_tag/id/output.txt @@ -31,6 +31,7 @@ Validation OK! >>> [CLI] bundle plan create jobs.foo + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/url/output.txt b/acceptance/bundle/bundle_tag/url/output.txt index 55e1b76a28..1c6cbf615b 100644 --- a/acceptance/bundle/bundle_tag/url/output.txt +++ b/acceptance/bundle/bundle_tag/url/output.txt @@ -31,6 +31,7 @@ Validation OK! >>> [CLI] bundle plan create jobs.foo + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt index 66a54f0b60..aca4ae9fb6 100644 --- a/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt +++ b/acceptance/bundle/bundle_tag/url_ref/out.plan.terraform.txt @@ -1,3 +1,4 @@ create jobs.bar create jobs.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/deploy/jobs/task-source/output.txt b/acceptance/bundle/deploy/jobs/task-source/output.txt index 08158abd25..1815edbc0e 100644 --- a/acceptance/bundle/deploy/jobs/task-source/output.txt +++ b/acceptance/bundle/deploy/jobs/task-source/output.txt @@ -15,6 +15,7 @@ Deployment complete! >>> [CLI] bundle plan update jobs.git_job + Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt index b7df2cfcf0..7676de41db 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/output.txt +++ b/acceptance/bundle/deploy/pipeline/auto-approve/output.txt @@ -38,6 +38,7 @@ Deployment complete! >>> [CLI] bundle plan delete jobs.foo delete pipelines.bar + Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged === Try to redeploy the bundle - should fail without --auto-approve diff --git a/acceptance/bundle/deploy/pipeline/recreate/output.txt b/acceptance/bundle/deploy/pipeline/recreate/output.txt index 65b4cc3d7c..c3aadfe9d7 100644 --- a/acceptance/bundle/deploy/pipeline/recreate/output.txt +++ b/acceptance/bundle/deploy/pipeline/recreate/output.txt @@ -33,6 +33,7 @@ Deployment complete! >>> [CLI] bundle plan --var=catalog=another_catalog recreate pipelines.foo recreate schemas.bar + Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged === Try to redeploy the bundle, pointing the DLT pipeline to a different UC catalog diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt index c150b34baf..6ae4382e19 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.direct-exp.txt @@ -8,6 +8,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines + Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> musterr [CLI] bundle deploy @@ -20,6 +21,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema + Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> musterr [CLI] bundle deploy @@ -33,6 +35,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema + Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve @@ -53,6 +56,7 @@ Deployment complete! >>> errcode [CLI] bundle plan delete pipelines.my_pipelines delete schemas.my_schema + Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt index 7ce6c5d0e5..aafd8e14c7 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt @@ -119,6 +119,7 @@ Exit code (musterr): 1 >>> errcode [CLI] bundle plan recreate pipelines.my_pipelines recreate schemas.my_schema + Plan: 2 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve @@ -139,6 +140,7 @@ Deployment complete! >>> errcode [CLI] bundle plan delete pipelines.my_pipelines delete schemas.my_schema + Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/plan/no_upload/output.txt b/acceptance/bundle/plan/no_upload/output.txt index 2cbedf33e8..e6cc86840a 100644 --- a/acceptance/bundle/plan/no_upload/output.txt +++ b/acceptance/bundle/plan/no_upload/output.txt @@ -1,6 +1,7 @@ >>> [CLI] bundle plan create jobs.my_job + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> jq -s .[] | select(.method != "GET") out.requests.txt diff --git a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt index 4cb8256303..1a40fdbaa3 100644 --- a/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/bad_syntax/out.plan.direct-exp.txt @@ -1,3 +1,4 @@ create volumes.bar create volumes.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/create_error/output.txt b/acceptance/bundle/resource_deps/create_error/output.txt index adadd7ed2f..5c73d60474 100644 --- a/acceptance/bundle/resource_deps/create_error/output.txt +++ b/acceptance/bundle/resource_deps/create_error/output.txt @@ -4,6 +4,7 @@ create jobs.bar create jobs.baz create jobs.foo create jobs.independent + Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged >>> print_sorted_requests @@ -70,6 +71,7 @@ Resources: create jobs.bar create jobs.baz create jobs.foo + Plan: 3 to add, 0 to change, 0 to delete, 1 unchanged === Expecting no difference in the output between first and second deploy diff --git a/acceptance/bundle/resource_deps/id_chain/output.txt b/acceptance/bundle/resource_deps/id_chain/output.txt index e03c27f17c..7e6019b6ea 100644 --- a/acceptance/bundle/resource_deps/id_chain/output.txt +++ b/acceptance/bundle/resource_deps/id_chain/output.txt @@ -5,6 +5,7 @@ create jobs.b create jobs.c create jobs.d create jobs.e + Plan: 5 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests @@ -32,6 +33,7 @@ update jobs.b update jobs.c update jobs.d update jobs.e + Plan: 0 to add, 5 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/acceptance/bundle/resource_deps/job_id/output.txt b/acceptance/bundle/resource_deps/job_id/output.txt index e522680c0f..6917dcb74b 100644 --- a/acceptance/bundle/resource_deps/job_id/output.txt +++ b/acceptance/bundle/resource_deps/job_id/output.txt @@ -2,6 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create jobs.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/resource_deps/jobs_update/output.txt b/acceptance/bundle/resource_deps/jobs_update/output.txt index 235ee337e5..e0eb8796e7 100644 --- a/acceptance/bundle/resource_deps/jobs_update/output.txt +++ b/acceptance/bundle/resource_deps/jobs_update/output.txt @@ -2,6 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create jobs.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy @@ -71,6 +72,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle plan update jobs.foo + Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt index a2c579072f..35e13365cd 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.direct-exp.txt @@ -4,4 +4,5 @@ Warning: expected a string value, found null create pipelines.bar create pipelines.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt index b191fd2674..11226504b4 100644 --- a/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt +++ b/acceptance/bundle/resource_deps/missing_string_field/out.plan.terraform.txt @@ -1,3 +1,4 @@ create pipelines.bar create pipelines.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index 3ddcf88359..5467feef48 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -2,6 +2,7 @@ >>> [CLI] bundle plan create jobs.bar create pipelines.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy @@ -53,6 +54,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged >>> [CLI] bundle plan update jobs.bar recreate pipelines.foo + Plan: 1 to add, 1 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt index b191fd2674..11226504b4 100644 --- a/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt +++ b/acceptance/bundle/resource_deps/present_ingestion_definition/out.plan.direct-exp.txt @@ -1,3 +1,4 @@ create pipelines.bar create pipelines.foo + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resource_deps/remote_app_url/output.txt b/acceptance/bundle/resource_deps/remote_app_url/output.txt index 1a85a10ca3..9722df4eb6 100644 --- a/acceptance/bundle/resource_deps/remote_app_url/output.txt +++ b/acceptance/bundle/resource_deps/remote_app_url/output.txt @@ -11,6 +11,7 @@ Validation OK! >>> [CLI] bundle plan create apps.myapp create pipelines.mypipeline + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt index 6d836d9cab..c37590cfb3 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/output.txt @@ -28,6 +28,7 @@ create schemas.my create volumes.bar create volumes.foo + Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/acceptance/bundle/resources/apps/update/output.txt b/acceptance/bundle/resources/apps/update/output.txt index e5571593ce..72bf6b0ec8 100644 --- a/acceptance/bundle/resources/apps/update/output.txt +++ b/acceptance/bundle/resources/apps/update/output.txt @@ -1,6 +1,7 @@ >>> [CLI] bundle plan create apps.mykey + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy @@ -36,6 +37,7 @@ Resources: >>> [CLI] bundle plan update apps.mykey + Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy @@ -71,6 +73,7 @@ Resources: >>> [CLI] bundle plan recreate apps.mykey + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle summary diff --git a/acceptance/bundle/resources/jobs/update/output.txt b/acceptance/bundle/resources/jobs/update/output.txt index 77225cce0e..6898f3a33e 100644 --- a/acceptance/bundle/resources/jobs/update/output.txt +++ b/acceptance/bundle/resources/jobs/update/output.txt @@ -1,6 +1,7 @@ >>> [CLI] bundle plan create jobs.foo + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -67,6 +68,7 @@ jobs foo id='[JOB_ID]' name='foo' >>> [CLI] bundle plan update jobs.foo + Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt index e05332f07b..3cb16c0493 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-catalog/output.txt @@ -16,6 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -60,6 +61,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt index d6d7bef72c..9d7a603af6 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-ingestion-definition/output.txt @@ -16,6 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -65,6 +66,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt index 74f08f6573..3102603566 100644 --- a/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/change-storage/output.txt @@ -16,6 +16,7 @@ resources: >>> [CLI] bundle plan create pipelines.my + Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -60,6 +61,7 @@ Deployment complete! >>> [CLI] bundle plan recreate pipelines.my + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index 5a230f6ade..94a306b337 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -32,6 +32,7 @@ Deployment complete! >>> [CLI] bundle plan recreate schemas.schema1 + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/volumes/change-name/output.txt b/acceptance/bundle/resources/volumes/change-name/output.txt index b26acdf1e6..bd1f98c058 100644 --- a/acceptance/bundle/resources/volumes/change-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-name/output.txt @@ -38,6 +38,7 @@ Deployment complete! >>> [CLI] bundle plan update volumes.volume1 + Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index 503f6a2fa1..d43924e700 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -38,6 +38,7 @@ Deployment complete! >>> [CLI] bundle plan recreate volumes.volume1 + Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> [CLI] bundle deploy --auto-approve diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index e5e5f85f2e..f8b7493908 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -2,6 +2,7 @@ >>> [CLI] bundle plan create schemas.myschema create volumes.volume1 + Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> print_requests diff --git a/cmd/bundle/plan.go b/cmd/bundle/plan.go index f9f4230f5d..a2d91d8491 100644 --- a/cmd/bundle/plan.go +++ b/cmd/bundle/plan.go @@ -127,6 +127,7 @@ func newPlanCommand() *cobra.Command { key := strings.TrimPrefix(action.ResourceKey, "resources.") fmt.Fprintf(out, "%s %s\n", action.ActionType.StringShort(), key) } + fmt.Fprintln(out) } fmt.Fprintf(out, "Plan: %d to add, %d to change, %d to delete, %d unchanged\n", createCount, updateCount, deleteCount, unchanged) case flags.OutputJSON: