diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ee3900509b..c0a731b356 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -422,7 +422,7 @@ jobs: # Use Checks API (not Statuses API) to match the required "Integration Tests" check. - name: Skip integration tests (pull request) if: ${{ github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') && !contains(fromJSON(needs.testmask.outputs.targets), 'test-exp-ssh') }} - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ steps.generate-check-token.outputs.token }} script: | @@ -443,7 +443,7 @@ jobs: # Use Checks API (not Statuses API) to match the required "Integration Tests" check. - name: Auto-approve for merge group if: ${{ github.event_name == 'merge_group' }} - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ steps.generate-check-token.outputs.token }} script: | @@ -487,7 +487,7 @@ jobs: steps: - name: Skip integration tests - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: |- await github.rest.checks.create({ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86724b7e70..b425fa546a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,7 +115,7 @@ jobs: AZURE_CLIENT_SECRET: ${{ secrets.DECO_SIGN_AZURE_CLIENT_SECRET }} - name: Upload Windows artifacts to GitHub Actions - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: windows-artifacts path: | @@ -135,7 +135,7 @@ jobs: steps: - name: Download Windows artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: windows-artifacts path: dist diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml index 39e95993e4..04f0565a94 100644 --- a/.github/workflows/tagging.yml +++ b/.github/workflows/tagging.yml @@ -34,13 +34,13 @@ jobs: steps: - name: Generate GitHub App Token id: generate-token - uses: actions/create-github-app-token@v3 + uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 with: app-id: ${{ secrets.DECO_SDK_TAGGING_APP_ID }} private-key: ${{ secrets.DECO_SDK_TAGGING_PRIVATE_KEY }} - name: Checkout repository - uses: actions/checkout@v6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 token: ${{ steps.generate-token.outputs.token }} diff --git a/acceptance/bundle/config-remote-sync/cli_defaults/output.txt b/acceptance/bundle/config-remote-sync/cli_defaults/output.txt index 307a945ea9..a62292a78b 100644 --- a/acceptance/bundle/config-remote-sync/cli_defaults/output.txt +++ b/acceptance/bundle/config-remote-sync/cli_defaults/output.txt @@ -56,8 +56,8 @@ The following resources will be deleted: delete resources.jobs.job2 delete resources.pipelines.pipeline1 -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.pipeline1 All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/config-remote-sync/job_pipeline_task/output.txt b/acceptance/bundle/config-remote-sync/job_pipeline_task/output.txt index 625902a6e7..c97d86b515 100644 --- a/acceptance/bundle/config-remote-sync/job_pipeline_task/output.txt +++ b/acceptance/bundle/config-remote-sync/job_pipeline_task/output.txt @@ -39,8 +39,8 @@ The following resources will be deleted: delete resources.jobs.my_job delete resources.pipelines.my_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/config-remote-sync/multiple_resources/output.txt b/acceptance/bundle/config-remote-sync/multiple_resources/output.txt index d7d8709ffd..fb06db8f2f 100644 --- a/acceptance/bundle/config-remote-sync/multiple_resources/output.txt +++ b/acceptance/bundle/config-remote-sync/multiple_resources/output.txt @@ -57,10 +57,14 @@ The following resources will be deleted: delete resources.sql_warehouses.test_warehouse delete resources.volumes.test_volume -This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: + +This action will result in the deletion or recreation of the following MLflow experiments along with all their runs, metrics, and artifacts: + delete resources.experiments.test_experiment + +This action will result in the deletion or recreation of the following registered models along with all their versions: + delete resources.registered_models.test_model + +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: delete resources.volumes.test_volume All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/config-remote-sync/pipeline_fields/output.txt b/acceptance/bundle/config-remote-sync/pipeline_fields/output.txt index ea2c6a557b..d7043cc616 100644 --- a/acceptance/bundle/config-remote-sync/pipeline_fields/output.txt +++ b/acceptance/bundle/config-remote-sync/pipeline_fields/output.txt @@ -55,8 +55,8 @@ Resource: resources.pipelines.my_pipeline The following resources will be deleted: delete resources.pipelines.my_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/config-remote-sync/validation_errors/output.txt b/acceptance/bundle/config-remote-sync/validation_errors/output.txt index c4ce29efa0..6285a4a9bc 100644 --- a/acceptance/bundle/config-remote-sync/validation_errors/output.txt +++ b/acceptance/bundle/config-remote-sync/validation_errors/output.txt @@ -50,8 +50,8 @@ The following resources will be deleted: delete resources.jobs.my_job delete resources.pipelines.my_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/deploy/snapshot-comparison/output.txt b/acceptance/bundle/deploy/snapshot-comparison/output.txt index 1db9fa5024..38a8a8c04e 100644 --- a/acceptance/bundle/deploy/snapshot-comparison/output.txt +++ b/acceptance/bundle/deploy/snapshot-comparison/output.txt @@ -44,8 +44,8 @@ The following resources will be deleted: delete resources.jobs.test_job delete resources.pipelines.test_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.test_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/snapshot-test-1-[UNIQUE_NAME]/default @@ -59,8 +59,8 @@ The following resources will be deleted: delete resources.jobs.test_job delete resources.pipelines.test_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.test_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/snapshot-test-2-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/deployment/bind/dashboard/recreation/output.txt b/acceptance/bundle/deployment/bind/dashboard/recreation/output.txt index 99c26a8ccc..cd605ee9ef 100644 --- a/acceptance/bundle/deployment/bind/dashboard/recreation/output.txt +++ b/acceptance/bundle/deployment/bind/dashboard/recreation/output.txt @@ -15,8 +15,7 @@ Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> errcode [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following dashboards. -This will result in changed IDs and permanent URLs of the dashboards that will be recreated: +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: recreate resources.dashboards.dashboard1 Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed diff --git a/acceptance/bundle/deployment/bind/pipelines/recreate/output.txt b/acceptance/bundle/deployment/bind/pipelines/recreate/output.txt index af42322dee..24dadbd1f7 100644 --- a/acceptance/bundle/deployment/bind/pipelines/recreate/output.txt +++ b/acceptance/bundle/deployment/bind/pipelines/recreate/output.txt @@ -11,10 +11,7 @@ Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged >>> musterr [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-recreate-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.foo Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed @@ -22,10 +19,7 @@ Error: the deployment requires destructive actions, but current console does not >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-recreate-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.foo Deploying resources... Updating deployment state... diff --git a/acceptance/bundle/deployment/bind/secret-scope/out.deploy.direct.txt b/acceptance/bundle/deployment/bind/secret-scope/out.deploy.direct.txt new file mode 100644 index 0000000000..7a793cef47 --- /dev/null +++ b/acceptance/bundle/deployment/bind/secret-scope/out.deploy.direct.txt @@ -0,0 +1,9 @@ + +>>> [CLI] bundle deploy --auto-approve +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/bind-secret-scope-test-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + recreate resources.secret_scopes.secret_scope1 +Deploying resources... +Updating deployment state... +Deployment complete! diff --git a/acceptance/bundle/deployment/bind/secret-scope/out.deploy.terraform.txt b/acceptance/bundle/deployment/bind/secret-scope/out.deploy.terraform.txt new file mode 100644 index 0000000000..6720c9777f --- /dev/null +++ b/acceptance/bundle/deployment/bind/secret-scope/out.deploy.terraform.txt @@ -0,0 +1,6 @@ + +>>> [CLI] bundle deploy --auto-approve +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/bind-secret-scope-test-[UNIQUE_NAME]/default/files... +Deploying resources... +Updating deployment state... +Deployment complete! diff --git a/acceptance/bundle/deployment/bind/secret-scope/output.txt b/acceptance/bundle/deployment/bind/secret-scope/output.txt index fb0f3ac11f..583f231657 100644 --- a/acceptance/bundle/deployment/bind/secret-scope/output.txt +++ b/acceptance/bundle/deployment/bind/secret-scope/output.txt @@ -6,12 +6,6 @@ Updating deployment state... Successfully bound secret_scope with an id 'test-secret-scope-[UNIQUE_NAME]' Run 'bundle deploy' to deploy changes to your workspace ->>> [CLI] bundle deploy -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/bind-secret-scope-test-[UNIQUE_NAME]/default/files... -Deploying resources... -Updating deployment state... -Deployment complete! - >>> [CLI] secrets list-scopes -o json { "backend_type": "DATABRICKS", diff --git a/acceptance/bundle/deployment/bind/secret-scope/script b/acceptance/bundle/deployment/bind/secret-scope/script index c4e80009e6..9a0ddde3d8 100644 --- a/acceptance/bundle/deployment/bind/secret-scope/script +++ b/acceptance/bundle/deployment/bind/secret-scope/script @@ -12,7 +12,7 @@ trap cleanup EXIT trace $CLI bundle deployment bind secret_scope1 "${SECRET_SCOPE_NAME}" --auto-approve -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt trace $CLI secrets list-scopes -o json | jq --arg value ${SECRET_SCOPE_NAME} '.[] | select(.name == $value)' diff --git a/acceptance/bundle/deployment/unbind/grants/output.txt b/acceptance/bundle/deployment/unbind/grants/output.txt index 073bad2581..c379eb076c 100644 --- a/acceptance/bundle/deployment/unbind/grants/output.txt +++ b/acceptance/bundle/deployment/unbind/grants/output.txt @@ -37,7 +37,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.schema_1 -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.schema_1 All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/destroy/all-resources/output.txt b/acceptance/bundle/destroy/all-resources/output.txt index 5fd8d432a8..ce7b58ccac 100644 --- a/acceptance/bundle/destroy/all-resources/output.txt +++ b/acceptance/bundle/destroy/all-resources/output.txt @@ -10,13 +10,13 @@ The following resources will be deleted: delete resources.pipelines.my_pipeline delete resources.schemas.my_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.my_schema -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.my_schema + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.direct.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.direct.txt index a100c8774f..80c466fd93 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.direct.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.direct.txt @@ -35,14 +35,11 @@ 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... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: - recreate resources.schemas.my_schema - -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.my_pipelines + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + recreate resources.schemas.my_schema Deploying resources... Updating deployment state... Deployment complete! @@ -56,14 +53,11 @@ 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... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.my_schema - -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipelines + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.my_schema Deploying resources... Updating deployment state... Deployment complete! diff --git a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt index f36fe5c8f3..77580c0274 100644 --- a/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt +++ b/acceptance/bundle/lifecycle/prevent-destroy/out.terraform.txt @@ -119,14 +119,11 @@ 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... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: - recreate resources.schemas.my_schema - -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.my_pipelines + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + recreate resources.schemas.my_schema Deploying resources... Updating deployment state... Deployment complete! @@ -140,14 +137,11 @@ 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... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.my_schema - -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipelines + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.my_schema Deploying resources... Updating deployment state... Deployment complete! diff --git a/acceptance/bundle/migrate/runas/output.txt b/acceptance/bundle/migrate/runas/output.txt index 74b9a0217f..53db06ae86 100644 --- a/acceptance/bundle/migrate/runas/output.txt +++ b/acceptance/bundle/migrate/runas/output.txt @@ -151,8 +151,8 @@ See https://docs.databricks.com/dev-tools/bundles/permissions.html to learn more The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/dabs_revenue-[UNIQUE_NAME]/production diff --git a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt index 7a8592a7cc..58d50457eb 100644 --- a/acceptance/bundle/resource_deps/pipelines_recreate/output.txt +++ b/acceptance/bundle/resource_deps/pipelines_recreate/output.txt @@ -28,10 +28,7 @@ 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... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.foo Deploying resources... Updating deployment state... @@ -107,8 +104,8 @@ The following resources will be deleted: delete resources.jobs.bar delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resource_deps/remote_app_url/output.txt b/acceptance/bundle/resource_deps/remote_app_url/output.txt index 81b300ab11..c0f806a48f 100644 --- a/acceptance/bundle/resource_deps/remote_app_url/output.txt +++ b/acceptance/bundle/resource_deps/remote_app_url/output.txt @@ -82,8 +82,8 @@ The following resources will be deleted: delete resources.apps.myapp delete resources.pipelines.mypipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.mypipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.direct.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.direct.txt index b4d427d485..1471877012 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.direct.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.direct.txt @@ -3,13 +3,11 @@ The following resources will be deleted: delete resources.volumes.bar delete resources.volumes.foo -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.my -This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: delete resources.volumes.bar delete resources.volumes.foo diff --git a/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.terraform.txt b/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.terraform.txt index 8f89cda64c..9b72534496 100644 --- a/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.terraform.txt +++ b/acceptance/bundle/resource_deps/remote_field_storage_location/out.destroy.terraform.txt @@ -2,13 +2,11 @@ The following resources will be deleted: delete resources.schemas.my delete resources.volumes.bar -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.my -This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: delete resources.volumes.bar All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/alerts/basic/output.txt b/acceptance/bundle/resources/alerts/basic/output.txt index 3a0c3cb7e3..2eb8e2485a 100644 --- a/acceptance/bundle/resources/alerts/basic/output.txt +++ b/acceptance/bundle/resources/alerts/basic/output.txt @@ -56,6 +56,10 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged The following resources will be deleted: delete resources.alerts.myalert + +This action will result in the deletion or recreation of the following alerts. Evaluation and notification history will be permanently lost: + delete resources.alerts.myalert + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/alerts-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/catalogs/auto-approve/output.txt b/acceptance/bundle/resources/catalogs/auto-approve/output.txt index e0576f1b9e..e3e33a7a3f 100644 --- a/acceptance/bundle/resources/catalogs/auto-approve/output.txt +++ b/acceptance/bundle/resources/catalogs/auto-approve/output.txt @@ -48,7 +48,11 @@ The following resources will be deleted: delete resources.catalogs.bar delete resources.schemas.foo -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC catalogs along with all the schemas, tables, and views they contain: + delete resources.catalogs.bar + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/resources/catalogs/basic/output.txt b/acceptance/bundle/resources/catalogs/basic/output.txt index 1e70309242..f274b49dc2 100644 --- a/acceptance/bundle/resources/catalogs/basic/output.txt +++ b/acceptance/bundle/resources/catalogs/basic/output.txt @@ -36,6 +36,10 @@ Deployment complete! The following resources will be deleted: delete resources.catalogs.test_catalog + +This action will result in the deletion or recreation of the following UC catalogs along with all the schemas, tables, and views they contain: + delete resources.catalogs.test_catalog + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] Deleting files... diff --git a/acceptance/bundle/resources/catalogs/with-schemas/output.txt b/acceptance/bundle/resources/catalogs/with-schemas/output.txt index 8034f5eb2f..0a1c657598 100644 --- a/acceptance/bundle/resources/catalogs/with-schemas/output.txt +++ b/acceptance/bundle/resources/catalogs/with-schemas/output.txt @@ -52,7 +52,11 @@ The following resources will be deleted: delete resources.catalogs.test_catalog delete resources.schemas.test_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC catalogs along with all the schemas, tables, and views they contain: + delete resources.catalogs.test_catalog + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.test_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/resources/dashboards/change-embed-credentials/output.txt b/acceptance/bundle/resources/dashboards/change-embed-credentials/output.txt index 8b5d7dd6bf..11a33a1cb0 100644 --- a/acceptance/bundle/resources/dashboards/change-embed-credentials/output.txt +++ b/acceptance/bundle/resources/dashboards/change-embed-credentials/output.txt @@ -57,6 +57,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.my_dashboard + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.my_dashboard + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/change-embed-credentials-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/change-name/output.txt b/acceptance/bundle/resources/dashboards/change-name/output.txt index e2c01c3274..c59f627b42 100644 --- a/acceptance/bundle/resources/dashboards/change-name/output.txt +++ b/acceptance/bundle/resources/dashboards/change-name/output.txt @@ -45,6 +45,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.my_dashboard + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.my_dashboard + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/change-name-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/change-parent-path/output.txt b/acceptance/bundle/resources/dashboards/change-parent-path/output.txt index a7b26e91c5..8725664ba2 100644 --- a/acceptance/bundle/resources/dashboards/change-parent-path/output.txt +++ b/acceptance/bundle/resources/dashboards/change-parent-path/output.txt @@ -28,8 +28,7 @@ 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/change-parent-path-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following dashboards. -This will result in changed IDs and permanent URLs of the dashboards that will be recreated: +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: recreate resources.dashboards.my_dashboard Deploying resources... Updating deployment state... @@ -49,6 +48,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.my_dashboard + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.my_dashboard + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/change-parent-path-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/change-serialized-dashboard/output.txt b/acceptance/bundle/resources/dashboards/change-serialized-dashboard/output.txt index 6b4f7051dc..d6ec8e70b6 100644 --- a/acceptance/bundle/resources/dashboards/change-serialized-dashboard/output.txt +++ b/acceptance/bundle/resources/dashboards/change-serialized-dashboard/output.txt @@ -57,6 +57,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.my_dashboard + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.my_dashboard + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/change-serialized-dashboard-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/dataset-catalog-schema/output.txt b/acceptance/bundle/resources/dashboards/dataset-catalog-schema/output.txt index 4c7aa9d490..82e292dcb2 100644 --- a/acceptance/bundle/resources/dashboards/dataset-catalog-schema/output.txt +++ b/acceptance/bundle/resources/dashboards/dataset-catalog-schema/output.txt @@ -24,6 +24,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-dataset-test-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/destroy/output.txt b/acceptance/bundle/resources/dashboards/destroy/output.txt index 8a8d8889a9..bc2acf607d 100644 --- a/acceptance/bundle/resources/dashboards/destroy/output.txt +++ b/acceptance/bundle/resources/dashboards/destroy/output.txt @@ -15,6 +15,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/destroy-dashboard-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/detect-change/output.txt b/acceptance/bundle/resources/dashboards/detect-change/output.txt index 53179be516..7fbd7f333d 100644 --- a/acceptance/bundle/resources/dashboards/detect-change/output.txt +++ b/acceptance/bundle/resources/dashboards/detect-change/output.txt @@ -107,6 +107,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.file_reference + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.file_reference + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] Deleting files... diff --git a/acceptance/bundle/resources/dashboards/nested-folders/output.txt b/acceptance/bundle/resources/dashboards/nested-folders/output.txt index c1c2a79eb0..35fa319e10 100644 --- a/acceptance/bundle/resources/dashboards/nested-folders/output.txt +++ b/acceptance/bundle/resources/dashboards/nested-folders/output.txt @@ -25,6 +25,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-nested-folders-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/simple/output.txt b/acceptance/bundle/resources/dashboards/simple/output.txt index 7464a2e50f..73451f5e64 100644 --- a/acceptance/bundle/resources/dashboards/simple/output.txt +++ b/acceptance/bundle/resources/dashboards/simple/output.txt @@ -19,6 +19,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-test-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/simple_outside_bundle_root/output.txt b/acceptance/bundle/resources/dashboards/simple_outside_bundle_root/output.txt index 6e16fb6ef0..bab591ca96 100644 --- a/acceptance/bundle/resources/dashboards/simple_outside_bundle_root/output.txt +++ b/acceptance/bundle/resources/dashboards/simple_outside_bundle_root/output.txt @@ -17,6 +17,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-outside-bundle-root-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/dashboards/simple_syncroot/output.txt b/acceptance/bundle/resources/dashboards/simple_syncroot/output.txt index 8bb6baeca5..d42c79cea3 100644 --- a/acceptance/bundle/resources/dashboards/simple_syncroot/output.txt +++ b/acceptance/bundle/resources/dashboards/simple_syncroot/output.txt @@ -17,6 +17,10 @@ Deployment complete! The following resources will be deleted: delete resources.dashboards.dashboard1 + +This action will result in the deletion or recreation of the following dashboards. Recreated dashboards will have new IDs and permanent URLs: + delete resources.dashboards.dashboard1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-dashboard-test-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/database_catalogs/basic/output.txt b/acceptance/bundle/resources/database_catalogs/basic/output.txt index 46105a3e8c..7160c4d687 100644 --- a/acceptance/bundle/resources/database_catalogs/basic/output.txt +++ b/acceptance/bundle/resources/database_catalogs/basic/output.txt @@ -47,6 +47,13 @@ The following resources will be deleted: delete resources.database_catalogs.my_catalog delete resources.database_instances.my_instance + +This action will result in the deletion or recreation of the following database catalogs. All data stored in them will be permanently lost: + delete resources.database_catalogs.my_catalog + +This action will result in the deletion or recreation of the following database instances. All data stored in them will be permanently lost: + delete resources.database_instances.my_instance + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-catalog-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/database_instances/single-instance/output.txt b/acceptance/bundle/resources/database_instances/single-instance/output.txt index 8a08317172..e80d6e822b 100644 --- a/acceptance/bundle/resources/database_instances/single-instance/output.txt +++ b/acceptance/bundle/resources/database_instances/single-instance/output.txt @@ -59,6 +59,10 @@ Resources: The following resources will be deleted: delete resources.database_instances.my_database + +This action will result in the deletion or recreation of the following database instances. All data stored in them will be permanently lost: + delete resources.database_instances.my_database + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-single-instance-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/experiments/basic/output.txt b/acceptance/bundle/resources/experiments/basic/output.txt index 4b5fd591df..50822939ff 100644 --- a/acceptance/bundle/resources/experiments/basic/output.txt +++ b/acceptance/bundle/resources/experiments/basic/output.txt @@ -107,8 +107,11 @@ recreate experiments.my_experiment Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/experiment-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following MLflow experiments along with all their runs, metrics, and artifacts: + recreate resources.experiments.my_experiment Deploying resources... Updating deployment state... Deployment complete! @@ -192,6 +195,10 @@ Deployment complete! The following resources will be deleted: delete resources.experiments.my_experiment + +This action will result in the deletion or recreation of the following MLflow experiments along with all their runs, metrics, and artifacts: + delete resources.experiments.my_experiment + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/experiment-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/experiments/basic/script b/acceptance/bundle/resources/experiments/basic/script index 6bb96db86d..a963e183d9 100755 --- a/acceptance/bundle/resources/experiments/basic/script +++ b/acceptance/bundle/resources/experiments/basic/script @@ -25,7 +25,7 @@ title "updating the artifact location should cause a recreation" trace export EXPERIMENT_ARTIFACT_LOCATION="s3://new-${UNIQUE_NAME}" trace envsubst < templates/one_tag.tmpl > databricks.yml trace $CLI bundle plan -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve experiment_id=$($CLI bundle summary --output json | jq -r '.resources.experiments.my_experiment.id') trace $CLI experiments get-experiment $experiment_id | jq '.experiment | {name, artifact_location, tags}' diff --git a/acceptance/bundle/resources/external_locations/output.txt b/acceptance/bundle/resources/external_locations/output.txt index c69c74e2c7..84ba27a8ac 100644 --- a/acceptance/bundle/resources/external_locations/output.txt +++ b/acceptance/bundle/resources/external_locations/output.txt @@ -105,6 +105,10 @@ The following resources will be deleted: delete resources.catalogs.test_catalog delete resources.external_locations.test_location + +This action will result in the deletion or recreation of the following UC catalogs along with all the schemas, tables, and views they contain: + delete resources.catalogs.test_catalog + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] Deleting files... diff --git a/acceptance/bundle/resources/grants/catalogs/output.txt b/acceptance/bundle/resources/grants/catalogs/output.txt index 067bd10a70..2a72ee39df 100644 --- a/acceptance/bundle/resources/grants/catalogs/output.txt +++ b/acceptance/bundle/resources/grants/catalogs/output.txt @@ -74,6 +74,10 @@ Deployment complete! The following resources will be deleted: delete resources.catalogs.grants_catalog + +This action will result in the deletion or recreation of the following UC catalogs along with all the schemas, tables, and views they contain: + delete resources.catalogs.grants_catalog + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/catalog-grants-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/grants/registered_models/output.txt b/acceptance/bundle/resources/grants/registered_models/output.txt index cac10d7691..38dcdd2ed7 100644 --- a/acceptance/bundle/resources/grants/registered_models/output.txt +++ b/acceptance/bundle/resources/grants/registered_models/output.txt @@ -28,7 +28,11 @@ The following resources will be deleted: delete resources.registered_models.my_registered_model delete resources.schemas.my_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following registered models along with all their versions: + delete resources.registered_models.my_registered_model + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.my_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt b/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt index e88c30715f..306f3585ee 100644 --- a/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt +++ b/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt @@ -7,7 +7,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.apps_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.apps_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt b/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt index eb8ee21d64..0290aa5a5b 100644 --- a/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt +++ b/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt @@ -74,7 +74,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.grants_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.grants_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-grants-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt b/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt index 3b1393adf5..60fab857bc 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt +++ b/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt @@ -11,7 +11,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.apps_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.apps_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt b/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt index a537487dbd..6310afa7d2 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt +++ b/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt @@ -9,7 +9,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.apps_schema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.apps_schema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/grants/volumes/output.txt b/acceptance/bundle/resources/grants/volumes/output.txt index 4cd3f2f749..de0a1f17ae 100644 --- a/acceptance/bundle/resources/grants/volumes/output.txt +++ b/acceptance/bundle/resources/grants/volumes/output.txt @@ -50,13 +50,11 @@ The following resources will be deleted: delete resources.schemas.grants_schema delete resources.volumes.grants_volume -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.grants_schema -This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: delete resources.volumes.grants_volume All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-grants-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/models/basic/output.txt b/acceptance/bundle/resources/models/basic/output.txt index 929a8a4cdf..e51e8d8958 100644 --- a/acceptance/bundle/resources/models/basic/output.txt +++ b/acceptance/bundle/resources/models/basic/output.txt @@ -61,8 +61,11 @@ recreate models.my_model Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-models-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following MLflow models along with all their versions and artifacts: + recreate resources.models.my_model Deploying resources... Updating deployment state... Deployment complete! @@ -104,6 +107,10 @@ Deployment complete! The following resources will be deleted: delete resources.models.my_model + +This action will result in the deletion or recreation of the following MLflow models along with all their versions and artifacts: + delete resources.models.my_model + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-models-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/models/basic/script b/acceptance/bundle/resources/models/basic/script index 175f546340..e504fde9da 100644 --- a/acceptance/bundle/resources/models/basic/script +++ b/acceptance/bundle/resources/models/basic/script @@ -22,7 +22,7 @@ trace export MODEL_NAME=new-name-$UNIQUE_NAME envsubst < templates/one_tag.tmpl > databricks.yml title "update the name, this should recreate the model with the new name" trace $CLI bundle plan -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}' title "add a new tag, this should be a no-op; terraform does make an update request but since update request has no tags in it, it does nothing; direct skips request completely" diff --git a/acceptance/bundle/resources/permissions/database_instances/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/database_instances/current_can_manage/output.txt index 092bc944ed..cd6ed18a1c 100644 --- a/acceptance/bundle/resources/permissions/database_instances/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/database_instances/current_can_manage/output.txt @@ -61,6 +61,10 @@ Warning: unknown field: instance_profile_arn The following resources will be deleted: delete resources.database_instances.foo + +This action will result in the deletion or recreation of the following database instances. All data stored in them will be permanently lost: + delete resources.database_instances.foo + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt index 02c1a3930f..456c56ea69 100644 --- a/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt @@ -29,6 +29,10 @@ Deployment complete! The following resources will be deleted: delete resources.experiments.foo + +This action will result in the deletion or recreation of the following MLflow experiments along with all their runs, metrics, and artifacts: + delete resources.experiments.foo + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/resources/permissions/models/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/models/current_can_manage/output.txt index fc2daa5fa4..645815bc5c 100644 --- a/acceptance/bundle/resources/permissions/models/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/models/current_can_manage/output.txt @@ -23,6 +23,10 @@ The following resources will be deleted: delete resources.models.foo + +This action will result in the deletion or recreation of the following MLflow models along with all their versions and artifacts: + delete resources.models.foo + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt index 2e15e6e410..9ba2d33573 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt @@ -29,8 +29,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt b/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt index 89f7921475..b8eae437d5 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt @@ -17,8 +17,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/permissions/pipelines/empty_list/output.txt b/acceptance/bundle/resources/permissions/pipelines/empty_list/output.txt index 2f3ce99457..fafbfa5c57 100644 --- a/acceptance/bundle/resources/permissions/pipelines/empty_list/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/empty_list/output.txt @@ -12,8 +12,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt b/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt index 2e15e6e410..9ba2d33573 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt @@ -29,8 +29,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt b/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt index 3b82b04aa9..3b8f46a688 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt @@ -21,8 +21,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/output.txt index 10e8ce61d5..6665fef06b 100644 --- a/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/output.txt @@ -29,6 +29,10 @@ Deployment complete! The following resources will be deleted: delete resources.postgres_projects.foo + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.foo + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/resources/pipelines/allow-duplicate-names/output.txt b/acceptance/bundle/resources/pipelines/allow-duplicate-names/output.txt index 278c60dabb..33822d6c90 100644 --- a/acceptance/bundle/resources/pipelines/allow-duplicate-names/output.txt +++ b/acceptance/bundle/resources/pipelines/allow-duplicate-names/output.txt @@ -46,8 +46,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.pipeline_one -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.pipeline_one All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/pipelines/auto-approve/output.txt b/acceptance/bundle/resources/pipelines/auto-approve/output.txt index 5154a1206a..0bda6ff689 100644 --- a/acceptance/bundle/resources/pipelines/auto-approve/output.txt +++ b/acceptance/bundle/resources/pipelines/auto-approve/output.txt @@ -45,10 +45,7 @@ Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged >>> errcode [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.bar Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed @@ -60,8 +57,8 @@ The following resources will be deleted: delete resources.jobs.foo delete resources.pipelines.bar -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.bar All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/resources/pipelines/lakeflow-pipeline/output.txt b/acceptance/bundle/resources/pipelines/lakeflow-pipeline/output.txt index 04129e78ce..b12980c632 100644 --- a/acceptance/bundle/resources/pipelines/lakeflow-pipeline/output.txt +++ b/acceptance/bundle/resources/pipelines/lakeflow-pipeline/output.txt @@ -42,8 +42,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/pipelines/recreate-keys/change-ingestion-definition/output.txt b/acceptance/bundle/resources/pipelines/recreate-keys/change-ingestion-definition/output.txt index 5951bbfc01..8a334544d2 100644 --- a/acceptance/bundle/resources/pipelines/recreate-keys/change-ingestion-definition/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate-keys/change-ingestion-definition/output.txt @@ -63,10 +63,7 @@ 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/acc-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.my Deploying resources... Updating deployment state... @@ -149,8 +146,8 @@ Error: The specified pipeline [MY_ID] was not found. The following resources will be deleted: delete resources.pipelines.my -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/pipelines/recreate-keys/change-storage/output.txt b/acceptance/bundle/resources/pipelines/recreate-keys/change-storage/output.txt index 58e58039eb..3bdc039eeb 100644 --- a/acceptance/bundle/resources/pipelines/recreate-keys/change-storage/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate-keys/change-storage/output.txt @@ -58,10 +58,7 @@ 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/acc-[UNIQUE_NAME]/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.my Deploying resources... Updating deployment state... @@ -133,8 +130,8 @@ Error: The specified pipeline [MY_ID] was not found. The following resources will be deleted: delete resources.pipelines.my -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/pipelines/recreate/output.txt b/acceptance/bundle/resources/pipelines/recreate/output.txt index 8550395ff2..a1f1bb5ee9 100644 --- a/acceptance/bundle/resources/pipelines/recreate/output.txt +++ b/acceptance/bundle/resources/pipelines/recreate/output.txt @@ -44,10 +44,7 @@ Plan: 1 to add, 0 to change, 1 to delete, 1 unchanged >>> errcode [CLI] bundle deploy --force-lock Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: recreate resources.pipelines.foo Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed @@ -59,13 +56,13 @@ The following resources will be deleted: delete resources.pipelines.foo delete resources.schemas.bar -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.bar -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.bar + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] Deleting files... diff --git a/acceptance/bundle/resources/pipelines/update/output.txt b/acceptance/bundle/resources/pipelines/update/output.txt index e34efaf84e..08961411b4 100644 --- a/acceptance/bundle/resources/pipelines/update/output.txt +++ b/acceptance/bundle/resources/pipelines/update/output.txt @@ -71,8 +71,8 @@ Deployment complete! The following resources will be deleted: delete resources.pipelines.my -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/resources/postgres_branches/basic/output.txt b/acceptance/bundle/resources/postgres_branches/basic/output.txt index ae9053d377..b678738431 100644 --- a/acceptance/bundle/resources/postgres_branches/basic/output.txt +++ b/acceptance/bundle/resources/postgres_branches/basic/output.txt @@ -69,6 +69,13 @@ The following resources will be deleted: delete resources.postgres_branches.main delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.main + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_branches/recreate/output.txt b/acceptance/bundle/resources/postgres_branches/recreate/output.txt index fa92953259..66afc1f338 100644 --- a/acceptance/bundle/resources/postgres_branches/recreate/output.txt +++ b/acceptance/bundle/resources/postgres_branches/recreate/output.txt @@ -64,6 +64,9 @@ resources: >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-recreate-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + recreate resources.postgres_branches.main Deploying resources... Updating deployment state... Deployment complete! @@ -75,6 +78,13 @@ The following resources will be deleted: delete resources.postgres_branches.main delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.main + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-branch-recreate-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/output.txt b/acceptance/bundle/resources/postgres_branches/update_protected/output.txt index b32d48a909..fb722eb435 100644 --- a/acceptance/bundle/resources/postgres_branches/update_protected/output.txt +++ b/acceptance/bundle/resources/postgres_branches/update_protected/output.txt @@ -154,6 +154,13 @@ The following resources will be deleted: delete resources.postgres_branches.dev_branch delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.dev_branch + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-branch-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_endpoints/basic/output.txt b/acceptance/bundle/resources/postgres_endpoints/basic/output.txt index 53de63481d..0f3c8d16cf 100644 --- a/acceptance/bundle/resources/postgres_endpoints/basic/output.txt +++ b/acceptance/bundle/resources/postgres_endpoints/basic/output.txt @@ -87,6 +87,13 @@ The following resources will be deleted: delete resources.postgres_endpoints.custom delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.main + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-endpoint-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_endpoints/recreate/output.txt b/acceptance/bundle/resources/postgres_endpoints/recreate/output.txt index 9f9bb4faa8..296ea07a29 100644 --- a/acceptance/bundle/resources/postgres_endpoints/recreate/output.txt +++ b/acceptance/bundle/resources/postgres_endpoints/recreate/output.txt @@ -147,6 +147,13 @@ The following resources will be deleted: delete resources.postgres_endpoints.my_endpoint delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.main + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-endpoint-recreate-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_endpoints/update_autoscaling/output.txt b/acceptance/bundle/resources/postgres_endpoints/update_autoscaling/output.txt index a53bd84053..6049c2fa7f 100644 --- a/acceptance/bundle/resources/postgres_endpoints/update_autoscaling/output.txt +++ b/acceptance/bundle/resources/postgres_endpoints/update_autoscaling/output.txt @@ -187,6 +187,13 @@ The following resources will be deleted: delete resources.postgres_endpoints.my_endpoint delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres branches along with all data they contain: + delete resources.postgres_branches.main + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-endpoint-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_projects/basic/output.txt b/acceptance/bundle/resources/postgres_projects/basic/output.txt index 8c1288cb08..d7768c7177 100644 --- a/acceptance/bundle/resources/postgres_projects/basic/output.txt +++ b/acceptance/bundle/resources/postgres_projects/basic/output.txt @@ -64,6 +64,10 @@ Resources: The following resources will be deleted: delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-single-project-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_projects/recreate/output.txt b/acceptance/bundle/resources/postgres_projects/recreate/output.txt index 950ef936b9..05b03fe5f0 100644 --- a/acceptance/bundle/resources/postgres_projects/recreate/output.txt +++ b/acceptance/bundle/resources/postgres_projects/recreate/output.txt @@ -51,6 +51,9 @@ resources: >>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-recreate-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + recreate resources.postgres_projects.my_project Deploying resources... Updating deployment state... Deployment complete! @@ -61,6 +64,10 @@ Deployment complete! The following resources will be deleted: delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-recreate-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/postgres_projects/update_display_name/output.txt b/acceptance/bundle/resources/postgres_projects/update_display_name/output.txt index 61829ead70..c569675c08 100644 --- a/acceptance/bundle/resources/postgres_projects/update_display_name/output.txt +++ b/acceptance/bundle/resources/postgres_projects/update_display_name/output.txt @@ -157,6 +157,10 @@ Deployment complete! The following resources will be deleted: delete resources.postgres_projects.my_project + +This action will result in the deletion or recreation of the following Postgres projects along with all their branches, databases, and endpoints: + delete resources.postgres_projects.my_project + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-postgres-project-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.direct.txt b/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.direct.txt index 1268e736e1..33601b8b6d 100644 --- a/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.direct.txt +++ b/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.direct.txt @@ -1,6 +1,9 @@ ->>> errcode [CLI] bundle deploy +>>> errcode [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + recreate resources.quality_monitors.monitor1 Deploying resources... Updating deployment state... Deployment complete! diff --git a/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.terraform.txt b/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.terraform.txt index 99c0d7d2d8..7b9b613806 100644 --- a/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.terraform.txt +++ b/acceptance/bundle/resources/quality_monitors/change_assets_dir/out.deploy.terraform.txt @@ -1,5 +1,5 @@ ->>> errcode [CLI] bundle deploy +>>> errcode [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default/files... Deploying resources... Error: terraform apply: exit status 1 diff --git a/acceptance/bundle/resources/quality_monitors/change_assets_dir/output.txt b/acceptance/bundle/resources/quality_monitors/change_assets_dir/output.txt index 08f6c53ae1..4d9e6e471d 100644 --- a/acceptance/bundle/resources/quality_monitors/change_assets_dir/output.txt +++ b/acceptance/bundle/resources/quality_monitors/change_assets_dir/output.txt @@ -29,6 +29,10 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged The following resources will be deleted: delete resources.quality_monitors.monitor1 + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + delete resources.quality_monitors.monitor1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/quality_monitors/change_assets_dir/script b/acceptance/bundle/resources/quality_monitors/change_assets_dir/script index 6caf49a7f4..7a281ab6f3 100644 --- a/acceptance/bundle/resources/quality_monitors/change_assets_dir/script +++ b/acceptance/bundle/resources/quality_monitors/change_assets_dir/script @@ -25,6 +25,6 @@ trace errcode $CLI bundle plan &> out.plan.$DATABRICKS_BUNDLE_ENGINE.txt trace errcode $CLI bundle plan -o json &> out.plan.$DATABRICKS_BUNDLE_ENGINE.json rm out.requests.txt -trace errcode $CLI bundle deploy &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt +trace errcode $CLI bundle deploy --auto-approve &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt trace print_requests.py '^//import-file/' '^//workspace/' '^//telemetry-ext' > out.deploy.requests.$DATABRICKS_BUNDLE_ENGINE.json trace errcode $CLI bundle plan &> out.plan_after_deploy.$DATABRICKS_BUNDLE_ENGINE.txt diff --git a/acceptance/bundle/resources/quality_monitors/change_output_schema_name/output.txt b/acceptance/bundle/resources/quality_monitors/change_output_schema_name/output.txt index d67ee41975..dfd6622c0f 100644 --- a/acceptance/bundle/resources/quality_monitors/change_output_schema_name/output.txt +++ b/acceptance/bundle/resources/quality_monitors/change_output_schema_name/output.txt @@ -45,6 +45,10 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged The following resources will be deleted: delete resources.quality_monitors.monitor1 + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + delete resources.quality_monitors.monitor1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/quality_monitors/change_table_name/out.deploy.direct.txt b/acceptance/bundle/resources/quality_monitors/change_table_name/out.deploy.direct.txt index 1268e736e1..33601b8b6d 100644 --- a/acceptance/bundle/resources/quality_monitors/change_table_name/out.deploy.direct.txt +++ b/acceptance/bundle/resources/quality_monitors/change_table_name/out.deploy.direct.txt @@ -1,6 +1,9 @@ ->>> errcode [CLI] bundle deploy +>>> errcode [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + recreate resources.quality_monitors.monitor1 Deploying resources... Updating deployment state... Deployment complete! diff --git a/acceptance/bundle/resources/quality_monitors/change_table_name/output.txt b/acceptance/bundle/resources/quality_monitors/change_table_name/output.txt index 879222aa8a..9484f06e52 100644 --- a/acceptance/bundle/resources/quality_monitors/change_table_name/output.txt +++ b/acceptance/bundle/resources/quality_monitors/change_table_name/output.txt @@ -29,6 +29,10 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged The following resources will be deleted: delete resources.quality_monitors.monitor1 + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + delete resources.quality_monitors.monitor1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/quality_monitors/change_table_name/script b/acceptance/bundle/resources/quality_monitors/change_table_name/script index 891aece1c1..1d62da21fd 100644 --- a/acceptance/bundle/resources/quality_monitors/change_table_name/script +++ b/acceptance/bundle/resources/quality_monitors/change_table_name/script @@ -25,7 +25,7 @@ trace errcode $CLI bundle plan &> out.plan.$DATABRICKS_BUNDLE_ENGINE.txt trace errcode $CLI bundle plan -o json &> out.plan.$DATABRICKS_BUNDLE_ENGINE.json rm out.requests.txt -trace errcode $CLI bundle deploy &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt +trace errcode $CLI bundle deploy --auto-approve &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt trace print_requests.py '^//import-file/' '^//workspace/' '^//telemetry-ext' > out.deploy.requests.$DATABRICKS_BUNDLE_ENGINE.json trace errcode $CLI bundle plan &> out.plan_after_deploy.$DATABRICKS_BUNDLE_ENGINE.txt diff --git a/acceptance/bundle/resources/quality_monitors/create/output.txt b/acceptance/bundle/resources/quality_monitors/create/output.txt index 8037d5ec9c..6cd5f95c77 100644 --- a/acceptance/bundle/resources/quality_monitors/create/output.txt +++ b/acceptance/bundle/resources/quality_monitors/create/output.txt @@ -24,6 +24,10 @@ Table main.qm_test_[UNIQUE_NAME].test_table is now visible (catalog_name=main) The following resources will be deleted: delete resources.quality_monitors.monitor1 + +This action will result in the deletion or recreation of the following quality monitors. Associated metric tables may be lost or orphaned: + delete resources.quality_monitors.monitor1 + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/quality-monitor-update-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/registered_models/basic/output.txt b/acceptance/bundle/resources/registered_models/basic/output.txt index 8ba7d5758b..0e159faabe 100644 --- a/acceptance/bundle/resources/registered_models/basic/output.txt +++ b/acceptance/bundle/resources/registered_models/basic/output.txt @@ -24,7 +24,7 @@ create registered_models.my_registered_model Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... Deploying resources... Updating deployment state... @@ -44,7 +44,7 @@ update registered_models.my_registered_model Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... Deploying resources... Updating deployment state... @@ -64,8 +64,11 @@ recreate registered_models.my_registered_model Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following registered models along with all their versions: + recreate resources.registered_models.my_registered_model Deploying resources... Updating deployment state... Deployment complete! @@ -84,8 +87,11 @@ recreate registered_models.my_registered_model Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following registered models along with all their versions: + recreate resources.registered_models.my_registered_model Deploying resources... Updating deployment state... Deployment complete! @@ -104,8 +110,11 @@ recreate registered_models.my_registered_model Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following registered models along with all their versions: + recreate resources.registered_models.my_registered_model Deploying resources... Updating deployment state... Deployment complete! @@ -122,6 +131,10 @@ Deployment complete! The following resources will be deleted: delete resources.registered_models.my_registered_model + +This action will result in the deletion or recreation of the following registered models along with all their versions: + delete resources.registered_models.my_registered_model + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/registered_models/basic/script b/acceptance/bundle/resources/registered_models/basic/script index 42313057e0..a69c5f62f3 100644 --- a/acceptance/bundle/resources/registered_models/basic/script +++ b/acceptance/bundle/resources/registered_models/basic/script @@ -19,7 +19,7 @@ trap cleanup EXIT deploy_registered_model() { trace $CLI bundle plan - trace $CLI bundle deploy + trace $CLI bundle deploy --auto-approve registered_model_id=$($CLI bundle summary --output json | jq -r '.resources.registered_models.my_registered_model.id') trace $CLI registered-models get "${registered_model_id}" | jq '{name, comment, catalog_name, schema_name}' } diff --git a/acceptance/bundle/resources/schemas/auto-approve/output.txt b/acceptance/bundle/resources/schemas/auto-approve/output.txt index 6a773f60ca..3062388892 100644 --- a/acceptance/bundle/resources/schemas/auto-approve/output.txt +++ b/acceptance/bundle/resources/schemas/auto-approve/output.txt @@ -55,7 +55,7 @@ test-file-[UNIQUE_NAME].txt -> dbfs:/Volumes/main/test-schema-[UNIQUE_NAME]/test >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.bar Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed @@ -66,13 +66,13 @@ The following resources will be deleted: delete resources.pipelines.foo delete resources.schemas.bar -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.bar -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.bar + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] Deleting files... diff --git a/acceptance/bundle/resources/schemas/recreate/output.txt b/acceptance/bundle/resources/schemas/recreate/output.txt index 571d750e4a..75d80242a2 100644 --- a/acceptance/bundle/resources/schemas/recreate/output.txt +++ b/acceptance/bundle/resources/schemas/recreate/output.txt @@ -38,7 +38,7 @@ 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... -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost: +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: recreate resources.schemas.schema1 Deploying resources... Updating deployment state... diff --git a/acceptance/bundle/resources/secret_scopes/basic/output.txt b/acceptance/bundle/resources/secret_scopes/basic/output.txt index 5788225a45..07eeaf8a62 100644 --- a/acceptance/bundle/resources/secret_scopes/basic/output.txt +++ b/acceptance/bundle/resources/secret_scopes/basic/output.txt @@ -58,8 +58,11 @@ Deployment complete! === update the name of the scope (should recreate) >>> [CLI] bundle plan -o json ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/secret-scope-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + recreate resources.secret_scopes.my_scope Deploying resources... Updating deployment state... Deployment complete! @@ -103,6 +106,10 @@ Deployment complete! The following resources will be deleted: delete resources.secret_scopes.my_scope + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + delete resources.secret_scopes.my_scope + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/secret-scope-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/secret_scopes/basic/script b/acceptance/bundle/resources/secret_scopes/basic/script index d0f3adeced..bad9d19310 100755 --- a/acceptance/bundle/resources/secret_scopes/basic/script +++ b/acceptance/bundle/resources/secret_scopes/basic/script @@ -27,7 +27,7 @@ export SECRET_SCOPE_NAME="test-scope-$UNIQUE_NAME-2" envsubst < databricks.yml.tmpl > databricks.yml trace $CLI bundle plan -o json | sort_acls_json.py > out.plan2.$DATABRICKS_BUNDLE_ENGINE.json -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve # Capture API requests for verification. Terraform cleans up ACLs before deleting the scope, but direct does not, hence the difference in requests. trace print_requests.py //secrets > out.recreate-requests.$DATABRICKS_BUNDLE_ENGINE.txt diff --git a/acceptance/bundle/resources/secret_scopes/delete_scope/output.txt b/acceptance/bundle/resources/secret_scopes/delete_scope/output.txt index 18025f0a0f..9563af2c4f 100644 --- a/acceptance/bundle/resources/secret_scopes/delete_scope/output.txt +++ b/acceptance/bundle/resources/secret_scopes/delete_scope/output.txt @@ -6,8 +6,11 @@ Deploying resources... Updating deployment state... Deployment complete! ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/secret-scope-basic-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + delete resources.secret_scopes.second Deploying resources... Updating deployment state... Deployment complete! @@ -16,6 +19,10 @@ Deployment complete! The following resources will be deleted: delete resources.secret_scopes.first + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + delete resources.secret_scopes.first + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/secret-scope-basic-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/secret_scopes/delete_scope/script b/acceptance/bundle/resources/secret_scopes/delete_scope/script index b12e98775a..4f8dd28b9e 100755 --- a/acceptance/bundle/resources/secret_scopes/delete_scope/script +++ b/acceptance/bundle/resources/secret_scopes/delete_scope/script @@ -14,5 +14,5 @@ grep -v DELETE < databricks.yml > databricks.yml.tmp && mv databricks.yml.tmp da trace $CLI bundle plan &> out.plan.$DATABRICKS_BUNDLE_ENGINE.txt rm out.requests.txt -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve trace print_requests.py '^//import-file/' '^//workspace/' '^//telemetry-ext' &> out.deploy.requests.txt diff --git a/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt b/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt index b487f27076..87e4a16b15 100644 --- a/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt +++ b/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt @@ -24,6 +24,10 @@ Deployment complete! The following resources will be deleted: delete resources.secret_scopes.my_scope + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + delete resources.secret_scopes.my_scope + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/secret-scope-collapse-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/secret_scopes/permissions/output.txt b/acceptance/bundle/resources/secret_scopes/permissions/output.txt index 8ea0a7cfe8..1cdbf17ba3 100644 --- a/acceptance/bundle/resources/secret_scopes/permissions/output.txt +++ b/acceptance/bundle/resources/secret_scopes/permissions/output.txt @@ -40,8 +40,11 @@ Deployment complete! === change scope name (should recreate scope and update permissions) >>> [CLI] bundle plan ->>> [CLI] bundle deploy +>>> [CLI] bundle deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/secret-scope-permissions-[UNIQUE_NAME]/default/files... + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + recreate resources.secret_scopes.my_scope Deploying resources... Updating deployment state... Deployment complete! @@ -61,6 +64,10 @@ Deployment complete! The following resources will be deleted: delete resources.secret_scopes.my_scope + +This action will result in the deletion or recreation of the following secret scopes. All secrets stored in them will be permanently lost: + delete resources.secret_scopes.my_scope + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/secret-scope-permissions-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/secret_scopes/permissions/script b/acceptance/bundle/resources/secret_scopes/permissions/script index 7c261749a1..216b5a6bfe 100755 --- a/acceptance/bundle/resources/secret_scopes/permissions/script +++ b/acceptance/bundle/resources/secret_scopes/permissions/script @@ -68,7 +68,7 @@ title "change scope name (should recreate scope and update permissions)" export SECRET_SCOPE_NAME="test-scope-permissions-$UNIQUE_NAME-2" envsubst < databricks.yml.tmpl > databricks.yml trace $CLI bundle plan > out.plan.recreate.$DATABRICKS_BUNDLE_ENGINE.txt -trace $CLI bundle deploy +trace $CLI bundle deploy --auto-approve scope_name=$($CLI bundle summary --output json | jq -r '.resources.secret_scopes.my_scope.name') trace $CLI secrets list-scopes -o json | jq ".[] | select(.name == \"$scope_name\")" trace $CLI secrets list-acls $scope_name | jq -c '.[]' | sort diff --git a/acceptance/bundle/resources/synced_database_tables/basic/output.txt b/acceptance/bundle/resources/synced_database_tables/basic/output.txt index 7e8871433f..00f77145e1 100644 --- a/acceptance/bundle/resources/synced_database_tables/basic/output.txt +++ b/acceptance/bundle/resources/synced_database_tables/basic/output.txt @@ -50,6 +50,13 @@ The following resources will be deleted: delete resources.database_instances.my_instance delete resources.synced_database_tables.my_synced_table + +This action will result in the deletion or recreation of the following database catalogs. All data stored in them will be permanently lost: + delete resources.database_catalogs.my_catalog + +This action will result in the deletion or recreation of the following database instances. All data stored in them will be permanently lost: + delete resources.database_instances.my_instance + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-lakebase-synced-table-[UNIQUE_NAME]/default Deleting files... diff --git a/acceptance/bundle/resources/volumes/change-comment/output.txt b/acceptance/bundle/resources/volumes/change-comment/output.txt index e68c981548..b716e74a8f 100644 --- a/acceptance/bundle/resources/volumes/change-comment/output.txt +++ b/acceptance/bundle/resources/volumes/change-comment/output.txt @@ -91,10 +91,8 @@ Deployment complete! The following resources will be deleted: delete resources.volumes.volume1 -This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: + +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: delete resources.volumes.volume1 All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/resources/volumes/change-schema-name/output.txt b/acceptance/bundle/resources/volumes/change-schema-name/output.txt index 4d5145da9e..060a9ee92a 100644 --- a/acceptance/bundle/resources/volumes/change-schema-name/output.txt +++ b/acceptance/bundle/resources/volumes/change-schema-name/output.txt @@ -44,10 +44,7 @@ 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... -This action will result in the deletion or recreation of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted: +This action will result in the deletion or recreation of the following volumes. For managed volumes, the files stored in the volume are also deleted from your cloud tenant within 30 days. For external volumes, the metadata about the volume is removed from the catalog, but the underlying files are not deleted: recreate resources.volumes.volume1 Deploying resources... Updating deployment state... diff --git a/acceptance/bundle/resources/volumes/set-storage-location/output.txt b/acceptance/bundle/resources/volumes/set-storage-location/output.txt index 7a463920be..c7a68e9f69 100644 --- a/acceptance/bundle/resources/volumes/set-storage-location/output.txt +++ b/acceptance/bundle/resources/volumes/set-storage-location/output.txt @@ -33,7 +33,8 @@ Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged The following resources will be deleted: delete resources.schemas.myschema -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.myschema All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default diff --git a/acceptance/bundle/state/state_present/output.txt b/acceptance/bundle/state/state_present/output.txt index 224c543d3b..e56c86b16f 100644 --- a/acceptance/bundle/state/state_present/output.txt +++ b/acceptance/bundle/state/state_present/output.txt @@ -51,7 +51,8 @@ Deployment complete! The following resources will be deleted: delete resources.schemas.foo -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/bundle/summary/modified_status/output.txt b/acceptance/bundle/summary/modified_status/output.txt index 82bc66bf9f..7d92dd8259 100644 --- a/acceptance/bundle/summary/modified_status/output.txt +++ b/acceptance/bundle/summary/modified_status/output.txt @@ -185,13 +185,16 @@ The following resources will be deleted: delete resources.schemas.my_schema delete resources.sql_warehouses.my_sql_warehouse -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: - delete resources.schemas.my_schema -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: +This action will result in the deletion or recreation of the following alerts. Evaluation and notification history will be permanently lost: + delete resources.alerts.my_alert + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: + delete resources.schemas.my_schema + All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default Deleting files... diff --git a/acceptance/bundle/templates/default-python/integration_classic/output.txt b/acceptance/bundle/templates/default-python/integration_classic/output.txt index 2206b10cd2..0a83e4fe4c 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/output.txt +++ b/acceptance/bundle/templates/default-python/integration_classic/output.txt @@ -92,8 +92,8 @@ The following resources will be deleted: delete resources.jobs.sample_job delete resources.pipelines.project_name_[UNIQUE_NAME]_etl -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.project_name_[UNIQUE_NAME]_etl All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev @@ -490,8 +490,8 @@ The following resources will be deleted: delete resources.jobs.sample_job delete resources.pipelines.project_name_[UNIQUE_NAME]_etl -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.project_name_[UNIQUE_NAME]_etl All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod diff --git a/acceptance/bundle/user_agent/simple/output.txt b/acceptance/bundle/user_agent/simple/output.txt index 493c4f9f8f..0958d44524 100644 --- a/acceptance/bundle/user_agent/simple/output.txt +++ b/acceptance/bundle/user_agent/simple/output.txt @@ -53,7 +53,8 @@ Error: resource with key "foo" not found The following resources will be deleted: delete resources.schemas.foo -This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + +This action will result in the deletion or recreation of the following UC schemas along with all the tables and views they contain: delete resources.schemas.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default diff --git a/acceptance/cmd/workspace/apps/run-local-node/output.txt b/acceptance/cmd/workspace/apps/run-local-node/output.txt index 0185dbe523..4de672232f 100644 --- a/acceptance/cmd/workspace/apps/run-local-node/output.txt +++ b/acceptance/cmd/workspace/apps/run-local-node/output.txt @@ -1,12 +1,2 @@ -Running command: node -e console.log('Hello, world') -Hello, world -=== Starting the app in background... -=== Waiting -=== Checking app is running... ->>> curl -s -o - http://127.0.0.1:$(port) -{"message":"Hello From App","timestamp":"[TIMESTAMP]","status":"running"} - -=== Sending shutdown request... ->>> curl -s -o /dev/null http://127.0.0.1:$(port)/shutdown -Process terminated +Exit code: 1 diff --git a/acceptance/pipelines/deploy/auto-approve/output.txt b/acceptance/pipelines/deploy/auto-approve/output.txt index ff5ac099bf..e03dfe518e 100644 --- a/acceptance/pipelines/deploy/auto-approve/output.txt +++ b/acceptance/pipelines/deploy/auto-approve/output.txt @@ -13,10 +13,7 @@ View your pipeline foo here: [DATABRICKS_URL]/pipelines/[UUID]?o=[NUMID] >>> errcode [CLI] pipelines deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-auto-approve/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed @@ -27,10 +24,7 @@ Exit code: 1 >>> [CLI] pipelines deploy --auto-approve Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-auto-approve/default/files... -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed: +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo Deploying resources... Updating deployment state... diff --git a/acceptance/pipelines/destroy/auto-approve/output.txt b/acceptance/pipelines/destroy/auto-approve/output.txt index 17aecc2059..6e533f52f3 100644 --- a/acceptance/pipelines/destroy/auto-approve/output.txt +++ b/acceptance/pipelines/destroy/auto-approve/output.txt @@ -16,8 +16,8 @@ Exit code: 1 The following resources will be deleted: delete resources.pipelines.my_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy/default diff --git a/acceptance/pipelines/destroy/destroy-pipeline/output.txt b/acceptance/pipelines/destroy/destroy-pipeline/output.txt index d06ff16cfc..8e6558def4 100644 --- a/acceptance/pipelines/destroy/destroy-pipeline/output.txt +++ b/acceptance/pipelines/destroy/destroy-pipeline/output.txt @@ -11,8 +11,8 @@ View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?o=[NUMID] The following resources will be deleted: delete resources.pipelines.my_pipeline -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.my_pipeline All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy/default diff --git a/acceptance/pipelines/destroy/force-lock/output.txt b/acceptance/pipelines/destroy/force-lock/output.txt index 5b6449f732..e3d4d3f645 100644 --- a/acceptance/pipelines/destroy/force-lock/output.txt +++ b/acceptance/pipelines/destroy/force-lock/output.txt @@ -22,8 +22,8 @@ Exit code: 1 The following resources will be deleted: delete resources.pipelines.foo -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.foo All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-force-lock/default diff --git a/acceptance/pipelines/e2e/output.txt b/acceptance/pipelines/e2e/output.txt index a964b394da..5bcfe0c7cd 100644 --- a/acceptance/pipelines/e2e/output.txt +++ b/acceptance/pipelines/e2e/output.txt @@ -105,8 +105,8 @@ The following resources will be deleted: delete resources.pipelines.lakeflow_project_etl delete resources.pipelines.lakeflow_project_etl_2 -This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them: + +This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them: delete resources.pipelines.lakeflow_project_etl delete resources.pipelines.lakeflow_project_etl_2 diff --git a/bundle/phases/deploy.go b/bundle/phases/deploy.go index 4613a7a211..8594c6f744 100644 --- a/bundle/phases/deploy.go +++ b/bundle/phases/deploy.go @@ -3,6 +3,7 @@ package phases import ( "context" "errors" + "strings" "github.com/databricks/cli/bundle" "github.com/databricks/cli/bundle/artifacts" @@ -26,6 +27,17 @@ import ( "github.com/databricks/cli/libs/sync" ) +// resourceDestroyWarning returns the warning message for a given resource type, +// or an empty string if the resource is safe to delete/recreate. +// For child resources (e.g. permissions, grants), the parent type is used. +func resourceDestroyWarning(action deployplan.Action) string { + resourceType := config.GetResourceTypeFromKey(action.ResourceKey) + if base, _, ok := strings.Cut(resourceType, "."); ok { + resourceType = base + } + return resourceDestroyMessage[resourceType] +} + func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan) (bool, error) { actions := plan.GetActions() @@ -34,51 +46,14 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.P return false, err } - types := []deployplan.ActionType{deployplan.Recreate, deployplan.Delete} - schemaActions := filterGroup(actions, "schemas", types...) - dltActions := filterGroup(actions, "pipelines", types...) - volumeActions := filterGroup(actions, "volumes", types...) - dashboardActions := filterGroup(actions, "dashboards", types...) + destructiveActions := collectDestructiveActions(actions) // We don't need to display any prompts in this case. - if len(schemaActions) == 0 && len(dltActions) == 0 && len(volumeActions) == 0 && len(dashboardActions) == 0 { + if len(destructiveActions) == 0 { return true, nil } - // One or more UC schema resources will be deleted or recreated. - if len(schemaActions) != 0 { - cmdio.LogString(ctx, deleteOrRecreateSchemaMessage) - for _, action := range schemaActions { - if action.IsChildResource() { - continue - } - cmdio.Log(ctx, action) - } - } - - // One or more DLT pipelines is being recreated. - if len(dltActions) != 0 { - cmdio.LogString(ctx, deleteOrRecreatePipelineMessage) - for _, action := range dltActions { - cmdio.Log(ctx, action) - } - } - - // One or more volumes is being recreated. - if len(volumeActions) != 0 { - cmdio.LogString(ctx, deleteOrRecreateVolumeMessage) - for _, action := range volumeActions { - cmdio.Log(ctx, action) - } - } - - // One or more dashboards is being recreated. - if len(dashboardActions) != 0 { - cmdio.LogString(ctx, deleteOrRecreateDashboardMessage) - for _, action := range dashboardActions { - cmdio.Log(ctx, action) - } - } + logDestructiveActions(ctx, destructiveActions) if b.AutoApprove { return true, nil @@ -97,6 +72,48 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle, plan *deployplan.P return approved, nil } +// collectDestructiveActions returns delete/recreate actions for resource types +// that are not safe to destroy. Child resources (permissions, grants) are excluded. +func collectDestructiveActions(actions []deployplan.Action) []deployplan.Action { + var result []deployplan.Action + for _, action := range actions { + if action.IsChildResource() { + continue + } + if action.ActionType != deployplan.Recreate && action.ActionType != deployplan.Delete { + continue + } + if resourceDestroyWarning(action) == "" { + continue + } + result = append(result, action) + } + return result +} + +// logDestructiveActions prints grouped warning messages for destructive actions. +// Actions are grouped by their warning message so that each unique message is +// printed once, followed by the affected resources. +func logDestructiveActions(ctx context.Context, actions []deployplan.Action) { + // Use a slice to preserve insertion order of messages. + var messages []string + groups := map[string][]deployplan.Action{} + for _, action := range actions { + msg := resourceDestroyWarning(action) + if _, seen := groups[msg]; !seen { + messages = append(messages, msg) + } + groups[msg] = append(groups[msg], action) + } + + for _, msg := range messages { + cmdio.LogString(ctx, "\n"+msg) + for _, action := range groups[msg] { + cmdio.Log(ctx, action) + } + } +} + func deployCore(ctx context.Context, b *bundle.Bundle, plan *deployplan.Plan, targetEngine engine.EngineType) { // Core mutators that CRUD resources and modify deployment state. These // mutators need informed consent if they are potentially destructive. diff --git a/bundle/phases/deploy_test.go b/bundle/phases/deploy_test.go new file mode 100644 index 0000000000..f1545e371f --- /dev/null +++ b/bundle/phases/deploy_test.go @@ -0,0 +1,22 @@ +package phases + +import ( + "testing" + + "github.com/databricks/cli/bundle/config" + "github.com/stretchr/testify/assert" +) + +func TestResourceDestroyMessageIsComplete(t *testing.T) { + supported := config.SupportedResources() + + for resourceType := range supported { + _, ok := resourceDestroyMessage[resourceType] + assert.True(t, ok, "resourceDestroyMessage is missing entry for %q", resourceType) + } + + for resourceType := range resourceDestroyMessage { + _, ok := supported[resourceType] + assert.True(t, ok, "resourceDestroyMessage has entry for %q which is not a supported resource type", resourceType) + } +} diff --git a/bundle/phases/destroy.go b/bundle/phases/destroy.go index e6be00b579..4b4685e91d 100644 --- a/bundle/phases/destroy.go +++ b/bundle/phases/destroy.go @@ -51,31 +51,9 @@ func approvalForDestroy(ctx context.Context, b *bundle.Bundle, plan *deployplan. cmdio.LogString(ctx, "") } - schemaActions := filterGroup(deleteActions, "schemas", deployplan.Delete) - dltActions := filterGroup(deleteActions, "pipelines", deployplan.Delete) - volumeActions := filterGroup(deleteActions, "volumes", deployplan.Delete) - - if len(schemaActions) > 0 { - cmdio.LogString(ctx, deleteSchemaMessage) - for _, a := range schemaActions { - cmdio.Log(ctx, a) - } - cmdio.LogString(ctx, "") - } - - if len(dltActions) > 0 { - cmdio.LogString(ctx, deletePipelineMessage) - for _, a := range dltActions { - cmdio.Log(ctx, a) - } - cmdio.LogString(ctx, "") - } - - if len(volumeActions) > 0 { - cmdio.LogString(ctx, deleteVolumeMessage) - for _, a := range volumeActions { - cmdio.Log(ctx, a) - } + dataLossActions := collectDestructiveActions(deleteActions) + if len(dataLossActions) > 0 { + logDestructiveActions(ctx, dataLossActions) cmdio.LogString(ctx, "") } diff --git a/bundle/phases/messages.go b/bundle/phases/messages.go index 625373dd8b..976ce10e19 100644 --- a/bundle/phases/messages.go +++ b/bundle/phases/messages.go @@ -1,36 +1,82 @@ package phases -// Messages for bundle deploy. -const ( - deleteOrRecreateSchemaMessage = ` -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:` - - deleteOrRecreatePipelineMessage = ` -This action will result in the deletion or recreation of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the pipelines will -restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline -properties such as the 'catalog' or 'storage' are changed:` - - deleteOrRecreateVolumeMessage = ` -This action will result in the deletion or recreation of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted:` - - deleteOrRecreateDashboardMessage = ` -This action will result in the deletion or recreation of the following dashboards. -This will result in changed IDs and permanent URLs of the dashboards that will be recreated:` -) - -// Messages for bundle destroy. -const ( - deleteSchemaMessage = `This action will result in the deletion of the following UC schemas. Any underlying data may be lost:` - - deletePipelineMessage = `This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the -Streaming Tables (STs) and Materialized Views (MVs) managed by them:` - - deleteVolumeMessage = `This action will result in the deletion of the following volumes. -For managed volumes, the files stored in the volume are also deleted from your -cloud tenant within 30 days. For external volumes, the metadata about the volume -is removed from the catalog, but the underlying files are not deleted:` -) +// resourceDestroyMessage maps each resource type to a warning message displayed +// when the resource is deleted or recreated. An empty string means the resource +// is safe to delete/recreate without a warning. +// +// Rubric: a resource needs a warning if its deletion may cause non-recoverable +// data loss. A resource is safe if it holds only ephemeral state or configuration +// that is fully recoverable by redeploying the bundle. +// +// Every resource type returned by [config.SupportedResources] must have an entry. +// This is enforced by TestResourceDestroyMessageIsComplete. +var resourceDestroyMessage = map[string]string{ + // Safe resources (no warning): + + // Jobs: run history persists independently of the job definition. + "jobs": "", + // Model serving endpoints: stateless config; inference tables live in UC independently. + "model_serving_endpoints": "", + // Clusters: pure ephemeral compute; all config is in the bundle. + "clusters": "", + // Apps: stateless; all config and code deployed from bundle. + "apps": "", + // SQL warehouses: compute endpoint; query history stored separately. + "sql_warehouses": "", + // External locations: metadata pointer only; underlying cloud storage is not deleted. + "external_locations": "", + // Synced database tables: PurgeData=false preserves synced data; source always preserved. + "synced_database_tables": "", + // Postgres endpoints: stateless connection config; data lives in branch/project. + "postgres_endpoints": "", + + // Unsafe resources (warning required): + + "schemas": "This action will result in the deletion or recreation of the following " + + "UC schemas along with all the tables and views they contain:", + + "volumes": "This action will result in the deletion or recreation of the following volumes. " + + "For managed volumes, the files stored in the volume are also deleted from your " + + "cloud tenant within 30 days. For external volumes, the metadata about the volume " + + "is removed from the catalog, but the underlying files are not deleted:", + + "pipelines": "This action will result in the deletion or recreation of the following " + + "Lakeflow Spark Declarative Pipelines along with the Streaming Tables (STs) and " + + "Materialized Views (MVs) managed by them:", + + "dashboards": "This action will result in the deletion or recreation of the following " + + "dashboards. Recreated dashboards will have new IDs and permanent URLs:", + + "catalogs": "This action will result in the deletion or recreation of the following " + + "UC catalogs along with all the schemas, tables, and views they contain:", + + "secret_scopes": "This action will result in the deletion or recreation of the following " + + "secret scopes. All secrets stored in them will be permanently lost:", + + "database_instances": "This action will result in the deletion or recreation of the following " + + "database instances. All data stored in them will be permanently lost:", + + "database_catalogs": "This action will result in the deletion or recreation of the following " + + "database catalogs. All data stored in them will be permanently lost:", + + "postgres_projects": "This action will result in the deletion or recreation of the following " + + "Postgres projects along with all their branches, databases, and endpoints:", + + "postgres_branches": "This action will result in the deletion or recreation of the following " + + "Postgres branches along with all data they contain:", + + "models": "This action will result in the deletion or recreation of the following " + + "MLflow models along with all their versions and artifacts:", + + "registered_models": "This action will result in the deletion or recreation of the following " + + "registered models along with all their versions:", + + "experiments": "This action will result in the deletion or recreation of the following " + + "MLflow experiments along with all their runs, metrics, and artifacts:", + + "quality_monitors": "This action will result in the deletion or recreation of the following " + + "quality monitors. Associated metric tables may be lost or orphaned:", + + "alerts": "This action will result in the deletion or recreation of the following " + + "alerts. Evaluation and notification history will be permanently lost:", +} diff --git a/bundle/phases/util.go b/bundle/phases/util.go deleted file mode 100644 index 4df40f8add..0000000000 --- a/bundle/phases/util.go +++ /dev/null @@ -1,25 +0,0 @@ -package phases - -import ( - "github.com/databricks/cli/bundle/config" - "github.com/databricks/cli/bundle/deployplan" -) - -// filterGroup returns actions that match the specified group and any of the specified action types -func filterGroup(changes []deployplan.Action, group string, actionTypes ...deployplan.ActionType) []deployplan.Action { - var result []deployplan.Action - - // Create a set of action types for efficient lookup - actionTypeSet := make(map[deployplan.ActionType]bool) - for _, actionType := range actionTypes { - actionTypeSet[actionType] = true - } - - for _, action := range changes { - actionGroup := config.GetResourceTypeFromKey(action.ResourceKey) - if actionGroup == group && actionTypeSet[action.ActionType] { - result = append(result, action) - } - } - return result -}