From 518ac4222a758e30947402375c106e680e7d8bf7 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 19:57:57 +0000 Subject: [PATCH 1/7] Make resource creation optional for grants and permissions --- .nextchanges/bundles/optional-create.md | 1 + .../update-without-create/databricks.yml.tmpl | 21 +++ .../deploy/update-without-create/hello.py | 2 + .../update-without-create/out.actions.json | 14 ++ .../update-without-create/out.test.toml | 3 + .../deploy/update-without-create/output.txt | 148 ++++++++++++++++++ .../deploy/update-without-create/script | 32 ++++ .../deploy/update-without-create/test.toml | 8 + .../resources/grants/catalogs/out.plan1.json | 2 +- .../resources/grants/catalogs/output.txt | 8 +- .../grants/mcp_services/out.plan1.json | 2 +- .../resources/grants/mcp_services/output.txt | 4 +- .../model_provider_services/out.plan1.json | 2 +- .../grants/model_provider_services/output.txt | 4 +- .../grants/model_services/out.plan1.json | 2 +- .../grants/model_services/output.txt | 4 +- .../grants/registered_models/out.plan1.json | 2 +- .../grants/registered_models/output.txt | 4 +- .../grants/schemas/all_privileges/output.txt | 4 +- .../schemas/all_privileges_coexist/output.txt | 4 +- .../schemas/all_privileges_manage/output.txt | 4 +- .../grants/schemas/change_name/output.txt | 4 +- .../schemas/change_privilege/out.plan1.json | 2 +- .../schemas/change_privilege/output.txt | 8 +- .../schemas/duplicate_principals/output.txt | 4 +- .../schemas/duplicate_privileges/output.txt | 4 +- .../grants/schemas/import_errors/output.txt | 4 +- .../grants/schemas/import_errors/script | 2 +- .../schemas/manage_out_of_band/output.txt | 4 +- .../schemas/out_of_band_principal/output.txt | 4 +- .../grants/schemas/remove_all/output.txt | 4 +- .../schemas/remove_principal/output.txt | 4 +- .../remove_principal_manage/output.txt | 4 +- .../grants/volume_change_name/output.txt | 4 +- .../resources/grants/volumes/out.plan1.json | 2 +- .../resources/grants/volumes/output.txt | 4 +- .../apps/current_can_manage/out.plan.json | 2 +- .../apps/current_can_manage/output.txt | 4 +- .../apps/other_can_manage/out.plan.json | 2 +- .../apps/other_can_manage/output.txt | 4 +- .../clusters/current_can_manage/out.plan.json | 2 +- .../clusters/current_can_manage/output.txt | 4 +- .../permissions/clusters/target/output.txt | 4 +- .../dashboards/create/out.plan.json | 2 +- .../permissions/dashboards/create/output.txt | 4 +- .../current_can_manage/out.plan.json | 2 +- .../current_can_manage/output.txt | 4 +- .../current_can_manage/out.plan.json | 2 +- .../experiments/current_can_manage/output.txt | 4 +- .../current_can_manage/out.plan.json | 2 +- .../current_can_manage/output.txt | 4 +- .../out_of_band_deletion/output.txt | 4 +- .../jobs/added_remotely/output.txt | 8 +- .../jobs/current_can_manage/out.plan.json | 2 +- .../jobs/current_can_manage/output.txt | 4 +- .../jobs/current_can_manage_run/output.txt | 4 +- .../jobs/current_is_owner/out.plan.json | 2 +- .../jobs/current_is_owner/output.txt | 4 +- .../jobs/delete_one/out.plan_create.json | 2 +- .../permissions/jobs/delete_one/output.txt | 4 +- .../deleted_remotely/out.plan_create.json | 2 +- .../jobs/deleted_remotely/output.txt | 4 +- .../with_permissions/output.txt | 4 +- .../jobs/other_can_manage/out.plan.json | 2 +- .../jobs/other_can_manage/output.txt | 4 +- .../jobs/other_can_manage_run/output.txt | 4 +- .../jobs/other_is_owner/out.plan.json | 2 +- .../jobs/other_is_owner/output.txt | 4 +- .../jobs/reorder_locally/output.txt | 4 +- .../jobs/reorder_remotely/output.txt | 4 +- .../jobs/update/out.plan_create.json | 2 +- .../jobs/update/out.plan_restore.json | 32 +++- .../permissions/jobs/update/output.txt | 12 +- .../permissions/jobs/viewers/out.plan.json | 2 +- .../permissions/jobs/viewers/output.txt | 4 +- .../models/current_can_manage/out.deploy.txt | 4 +- .../models/current_can_manage/out.plan.json | 2 +- .../pipelines/504/create/output.txt | 4 +- .../permissions/pipelines/504/create/script | 2 +- .../permissions/pipelines/504/plan/output.txt | 4 +- .../pipelines/504/update/output.txt | 4 +- .../current_can_manage/out.plan.json | 2 +- .../pipelines/current_can_manage/output.txt | 4 +- .../pipelines/current_is_owner/out.plan.json | 2 +- .../pipelines/current_is_owner/output.txt | 4 +- .../pipelines/other_can_manage/out.plan.json | 2 +- .../pipelines/other_can_manage/output.txt | 4 +- .../pipelines/other_is_owner/out.plan.json | 2 +- .../pipelines/other_is_owner/output.txt | 4 +- .../permissions/pipelines/recreate/output.txt | 4 +- .../pipelines/update/out.plan_create.json | 2 +- .../pipelines/update/out.plan_restore.json | 32 +++- .../permissions/pipelines/update/output.txt | 8 +- .../current_can_manage/out.plan.json | 30 +++- .../current_can_manage/output.txt | 4 +- .../current_can_manage/out.plan.json | 2 +- .../current_can_manage/output.txt | 4 +- .../target_permissions/out.plan.json | 2 +- .../permissions/target_permissions/output.txt | 8 +- .../current_can_manage/out.plan.json | 2 +- .../current_can_manage/output.txt | 4 +- .../secret_scopes/basic/out.plan1.txt | 2 +- .../secret_scopes/deleted_remotely/output.txt | 4 +- .../permissions-collapse/out.plan.txt | 4 +- .../permissions-collapse/output.txt | 4 +- .../permissions/out.plan.create.txt | 4 +- bundle/direct/apply.go | 9 ++ bundle/direct/bundle_plan.go | 24 ++- bundle/direct/bundle_plan_test.go | 17 ++ bundle/direct/dresources/README.md | 15 +- bundle/direct/dresources/adapter.go | 30 ++-- bundle/direct/dresources/adapter_test.go | 38 +++++ bundle/direct/dresources/all_test.go | 17 +- bundle/direct/dresources/config.go | 5 - bundle/direct/dresources/config_test.go | 6 - bundle/direct/dresources/configs/grants.yml | 2 - bundle/direct/dresources/grants.go | 10 -- bundle/direct/dresources/grants_test.go | 7 - bundle/direct/dresources/permissions.go | 12 +- bundle/direct/dresources/secret_scope_acls.go | 8 +- 120 files changed, 620 insertions(+), 243 deletions(-) create mode 100644 .nextchanges/bundles/optional-create.md create mode 100644 acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl create mode 100644 acceptance/bundle/deploy/update-without-create/hello.py create mode 100644 acceptance/bundle/deploy/update-without-create/out.actions.json create mode 100644 acceptance/bundle/deploy/update-without-create/out.test.toml create mode 100644 acceptance/bundle/deploy/update-without-create/output.txt create mode 100644 acceptance/bundle/deploy/update-without-create/script create mode 100644 acceptance/bundle/deploy/update-without-create/test.toml create mode 100644 bundle/direct/dresources/adapter_test.go diff --git a/.nextchanges/bundles/optional-create.md b/.nextchanges/bundles/optional-create.md new file mode 100644 index 00000000000..60497e77ca4 --- /dev/null +++ b/.nextchanges/bundles/optional-create.md @@ -0,0 +1 @@ +* Report grants and permissions as updates when their parent resources are first deployed. diff --git a/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl b/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl new file mode 100644 index 00000000000..43d2c07cb8b --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl @@ -0,0 +1,21 @@ +bundle: + name: update-without-create-$UNIQUE_NAME + +resources: + schemas: + schema: + catalog_name: main + name: schema_$UNIQUE_NAME + grants: + - principal: ${workspace.current_user.userName} + privileges: [USE_SCHEMA] + jobs: + job: + name: job_$UNIQUE_NAME + tasks: + - task_key: main + notebook_task: + notebook_path: ./hello.py + permissions: + - user_name: ${workspace.current_user.userName} + level: IS_OWNER diff --git a/acceptance/bundle/deploy/update-without-create/hello.py b/acceptance/bundle/deploy/update-without-create/hello.py new file mode 100644 index 00000000000..4914a7436d9 --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/hello.py @@ -0,0 +1,2 @@ +# Databricks notebook source +print("hello") diff --git a/acceptance/bundle/deploy/update-without-create/out.actions.json b/acceptance/bundle/deploy/update-without-create/out.actions.json new file mode 100644 index 00000000000..0c81cfd751f --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/out.actions.json @@ -0,0 +1,14 @@ +{ + "resources.jobs.job": { + "action": "create" + }, + "resources.jobs.job.permissions": { + "action": "update" + }, + "resources.schemas.schema": { + "action": "create" + }, + "resources.schemas.schema.grants": { + "action": "update" + } +} diff --git a/acceptance/bundle/deploy/update-without-create/out.test.toml b/acceptance/bundle/deploy/update-without-create/out.test.toml new file mode 100644 index 00000000000..7a62f726f25 --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/out.test.toml @@ -0,0 +1,3 @@ +Cloud = true +EnvMatrix.DMS = ["", "true"] +EnvMatrix.READPLAN = ["", "1"] diff --git a/acceptance/bundle/deploy/update-without-create/output.txt b/acceptance/bundle/deploy/update-without-create/output.txt new file mode 100644 index 00000000000..77224d80323 --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/output.txt @@ -0,0 +1,148 @@ + +=== Plan updates for grants and permissions before their parents exist +>>> [CLI] bundle plan +create jobs.job +update jobs.job.permissions +create schemas.schema +update schemas.schema.grants + +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged + +>>> [CLI] bundle plan -o json + +>>> print_state.py + +=== Create the parents and apply their dependent updates +>>> [CLI] bundle deploy +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/update-without-create-[UNIQUE_NAME]/default/files... +Created jobs.job +Created schemas.schema +Updated jobs.job.permissions +Updated schemas.schema.grants +Files: 5 uploaded, 0 deleted +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged + +>>> print_requests.py //api/2.0/permissions/jobs //unity-catalog/permissions --sort +{ + "method": "PATCH", + "path": "/api/2.1/unity-catalog/permissions/schema/[SCHEMA_ID]", + "body": { + "changes": [ + { + "add": [ + "USE_SCHEMA" + ], + "principal": "[USERNAME]", + "remove": [ + "ALL_PRIVILEGES" + ] + } + ] + } +} +{ + "method": "PUT", + "path": "/api/2.0/permissions/jobs/[JOB_ID]", + "body": { + "access_control_list": [ + { + "permission_level": "IS_OWNER", + "user_name": "[USERNAME]" + } + ] + } +} + +>>> print_state.py +{ + "resources.jobs.job.permissions": { + "__id__": "/jobs/[JOB_ID]", + "state": { + "object_id": "/jobs/[JOB_ID]", + "__embed__": [ + { + "level": "IS_OWNER", + "user_name": "[USERNAME]" + } + ] + }, + "depends_on": [ + { + "node": "resources.jobs.job", + "label": "${resources.jobs.job.id}" + } + ] + }, + "resources.schemas.schema.grants": { + "__id__": "schema/[SCHEMA_ID]", + "state": { + "securable_type": "schema", + "full_name": "[SCHEMA_ID]", + "__embed__": [ + { + "principal": "[USERNAME]", + "privileges": [ + "USE_SCHEMA" + ] + } + ] + }, + "depends_on": [ + { + "node": "resources.schemas.schema", + "label": "${resources.schemas.schema.id}" + } + ] + } +} + +=== A second plan is unchanged +>>> [CLI] bundle plan +Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged + +=== Recreate a deleted parent and move its permissions to the new ID +>>> [CLI] jobs delete [JOB_ID] + +>>> [CLI] bundle plan +create jobs.job +update jobs.job.permissions + +Plan: 1 to add, 1 to change, 0 to delete, 2 unchanged + +>>> [CLI] bundle plan -o json + +>>> [CLI] bundle deploy +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/update-without-create-[UNIQUE_NAME]/default/files... +Created jobs.job +Updated jobs.job.permissions +Files: 1 uploaded, 0 deleted +Resources: 1 created, 1 changed, 0 deleted, 2 unchanged + +>>> print_requests.py //api/2.0/permissions/jobs +{ + "method": "PUT", + "path": "/api/2.0/permissions/jobs/[JOB_ID_4]", + "body": { + "access_control_list": [ + { + "permission_level": "IS_OWNER", + "user_name": "[USERNAME]" + } + ] + } +} + +>>> [CLI] bundle plan +Plan: 0 to add, 0 to change, 0 to delete, 4 unchanged + +>>> errcode [CLI] bundle destroy --auto-approve +The following resources will be deleted: + delete resources.jobs.job + delete resources.schemas.schema + +This action will result in the deletion of the following UC schemas. Any underlying data may be lost: + delete resources.schemas.schema + +All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/update-without-create-[UNIQUE_NAME]/default + +Destroy: 2 deleted diff --git a/acceptance/bundle/deploy/update-without-create/script b/acceptance/bundle/deploy/update-without-create/script new file mode 100644 index 00000000000..609e184c5da --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/script @@ -0,0 +1,32 @@ +envsubst < databricks.yml.tmpl > databricks.yml + +cleanup() { + trace errcode $CLI bundle destroy --auto-approve + rm -f "$OUT_REQUESTS" +} +trap cleanup EXIT + +title "Plan updates for grants and permissions before their parents exist" +trace $CLI bundle plan +trace $CLI bundle plan -o json > plan.json +jq '.plan | with_entries(.value |= {action})' plan.json > out.actions.json +trace print_state.py + +title "Create the parents and apply their dependent updates" +trace $CLI bundle deploy $(readplanarg plan.json) +replace_ids.py +trace print_requests.py //api/2.0/permissions/jobs //unity-catalog/permissions --sort +trace print_state.py | jq '.state | with_entries(select(.key | endswith(".permissions") or endswith(".grants")))' + +title "A second plan is unchanged" +trace $CLI bundle plan + +title "Recreate a deleted parent and move its permissions to the new ID" +job_id="$(read_id.py job)" +trace $CLI jobs delete "$job_id" +trace $CLI bundle plan +trace $CLI bundle plan -o json > plan.json +trace $CLI bundle deploy $(readplanarg plan.json) +replace_ids.py +trace print_requests.py //api/2.0/permissions/jobs +trace $CLI bundle plan diff --git a/acceptance/bundle/deploy/update-without-create/test.toml b/acceptance/bundle/deploy/update-without-create/test.toml new file mode 100644 index 00000000000..0c063522813 --- /dev/null +++ b/acceptance/bundle/deploy/update-without-create/test.toml @@ -0,0 +1,8 @@ +Cloud = true +RecordRequests = true +EnvMatrix.READPLAN = ["", "1"] +Ignore = [".databricks", "databricks.yml", "plan.json"] + +[[Repls]] +Old = " --plan plan.json" +New = "" diff --git a/acceptance/bundle/resources/grants/catalogs/out.plan1.json b/acceptance/bundle/resources/grants/catalogs/out.plan1.json index 590ce37f61c..6d1c7ea3058 100644 --- a/acceptance/bundle/resources/grants/catalogs/out.plan1.json +++ b/acceptance/bundle/resources/grants/catalogs/out.plan1.json @@ -18,7 +18,7 @@ "label": "${resources.catalogs.grants_catalog.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "full_name": "", diff --git a/acceptance/bundle/resources/grants/catalogs/output.txt b/acceptance/bundle/resources/grants/catalogs/output.txt index c0cebc07c3e..14c89202b29 100644 --- a/acceptance/bundle/resources/grants/catalogs/output.txt +++ b/acceptance/bundle/resources/grants/catalogs/output.txt @@ -1,9 +1,9 @@ >>> [CLI] bundle plan create catalogs.grants_catalog -create catalogs.grants_catalog.grants +update catalogs.grants_catalog.grants -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -12,9 +12,9 @@ Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/catalog-grants-[UNIQUE_NAME]/default/files... Created catalogs.grants_catalog -Created catalogs.grants_catalog.grants +Updated catalogs.grants_catalog.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/mcp_services/out.plan1.json b/acceptance/bundle/resources/grants/mcp_services/out.plan1.json index 9150113092f..096a87bb94f 100644 --- a/acceptance/bundle/resources/grants/mcp_services/out.plan1.json +++ b/acceptance/bundle/resources/grants/mcp_services/out.plan1.json @@ -19,7 +19,7 @@ "label": "${resources.mcp_services.my_mcp_service.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "mcp_service", diff --git a/acceptance/bundle/resources/grants/mcp_services/output.txt b/acceptance/bundle/resources/grants/mcp_services/output.txt index 6a81a28bda8..72f4cd6ae71 100644 --- a/acceptance/bundle/resources/grants/mcp_services/output.txt +++ b/acceptance/bundle/resources/grants/mcp_services/output.txt @@ -6,9 +6,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-mcp-service-grants-[UNIQUE_NAME]/default/files... Created mcp_services.my_mcp_service -Created mcp_services.my_mcp_service.grants +Updated mcp_services.my_mcp_service.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/model_provider_services/out.plan1.json b/acceptance/bundle/resources/grants/model_provider_services/out.plan1.json index 9c7ead61585..17c467965fc 100644 --- a/acceptance/bundle/resources/grants/model_provider_services/out.plan1.json +++ b/acceptance/bundle/resources/grants/model_provider_services/out.plan1.json @@ -38,7 +38,7 @@ "label": "${resources.model_provider_services.my_model_provider_service.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "model_provider_service", diff --git a/acceptance/bundle/resources/grants/model_provider_services/output.txt b/acceptance/bundle/resources/grants/model_provider_services/output.txt index 686847fb1ac..a000755e314 100644 --- a/acceptance/bundle/resources/grants/model_provider_services/output.txt +++ b/acceptance/bundle/resources/grants/model_provider_services/output.txt @@ -6,9 +6,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-model-provider-service-grants-[UNIQUE_NAME]/default/files... Created model_provider_services.my_model_provider_service -Created model_provider_services.my_model_provider_service.grants +Updated model_provider_services.my_model_provider_service.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/model_services/out.plan1.json b/acceptance/bundle/resources/grants/model_services/out.plan1.json index 8fcd09fb0eb..ca1241a2acc 100644 --- a/acceptance/bundle/resources/grants/model_services/out.plan1.json +++ b/acceptance/bundle/resources/grants/model_services/out.plan1.json @@ -19,7 +19,7 @@ "label": "${resources.model_services.my_model_service.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "model_service", diff --git a/acceptance/bundle/resources/grants/model_services/output.txt b/acceptance/bundle/resources/grants/model_services/output.txt index 4161605ef23..ea697dcdaba 100644 --- a/acceptance/bundle/resources/grants/model_services/output.txt +++ b/acceptance/bundle/resources/grants/model_services/output.txt @@ -6,9 +6,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-model-service-grants-[UNIQUE_NAME]/default/files... Created model_services.my_model_service -Created model_services.my_model_service.grants +Updated model_services.my_model_service.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/registered_models/out.plan1.json b/acceptance/bundle/resources/grants/registered_models/out.plan1.json index 3212aa76ea6..c11fc344345 100644 --- a/acceptance/bundle/resources/grants/registered_models/out.plan1.json +++ b/acceptance/bundle/resources/grants/registered_models/out.plan1.json @@ -26,7 +26,7 @@ "label": "${resources.registered_models.my_registered_model.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "function", diff --git a/acceptance/bundle/resources/grants/registered_models/output.txt b/acceptance/bundle/resources/grants/registered_models/output.txt index 9c0adc9a866..fbb844a31f2 100644 --- a/acceptance/bundle/resources/grants/registered_models/output.txt +++ b/acceptance/bundle/resources/grants/registered_models/output.txt @@ -6,10 +6,10 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-registered-models-basic-[UNIQUE_NAME]/default/files... Created registered_models.my_registered_model -Created registered_models.my_registered_model.grants Created schemas.my_schema +Updated registered_models.my_registered_model.grants Files: 3 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt b/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt index 499dd38b143..7e180ddfceb 100644 --- a/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt +++ b/acceptance/bundle/resources/grants/schemas/all_privileges/output.txt @@ -1,8 +1,8 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default/files... Created schemas.apps_schema -Created schemas.apps_schema.grants +Updated schemas.apps_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/grants/schemas/all_privileges_coexist/output.txt b/acceptance/bundle/resources/grants/schemas/all_privileges_coexist/output.txt index cccd4d9a14c..9c99e34ec4c 100644 --- a/acceptance/bundle/resources/grants/schemas/all_privileges_coexist/output.txt +++ b/acceptance/bundle/resources/grants/schemas/all_privileges_coexist/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-all-privileges-coexist-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants update schema main.schema_all_priv_coexist_[UNIQUE_NAME] --json @update.resolved.json diff --git a/acceptance/bundle/resources/grants/schemas/all_privileges_manage/output.txt b/acceptance/bundle/resources/grants/schemas/all_privileges_manage/output.txt index d31b6a0422e..a3307fd41e0 100644 --- a/acceptance/bundle/resources/grants/schemas/all_privileges_manage/output.txt +++ b/acceptance/bundle/resources/grants/schemas/all_privileges_manage/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-all-privileges-manage-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py --method PATCH //permissions { diff --git a/acceptance/bundle/resources/grants/schemas/change_name/output.txt b/acceptance/bundle/resources/grants/schemas/change_name/output.txt index b7009427f4b..4d3e0d7f304 100644 --- a/acceptance/bundle/resources/grants/schemas/change_name/output.txt +++ b/acceptance/bundle/resources/grants/schemas/change_name/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created schemas.schema1 -Created schemas.schema1.grants +Updated schemas.schema1.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //unity-catalog { diff --git a/acceptance/bundle/resources/grants/schemas/change_privilege/out.plan1.json b/acceptance/bundle/resources/grants/schemas/change_privilege/out.plan1.json index 7008e57196e..5016e38d7ac 100644 --- a/acceptance/bundle/resources/grants/schemas/change_privilege/out.plan1.json +++ b/acceptance/bundle/resources/grants/schemas/change_privilege/out.plan1.json @@ -18,7 +18,7 @@ "label": "${resources.schemas.grants_schema.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "schema", diff --git a/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt b/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt index e74593e93bd..9e85d8e82c7 100644 --- a/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt +++ b/acceptance/bundle/resources/grants/schemas/change_privilege/output.txt @@ -1,9 +1,9 @@ >>> [CLI] bundle plan create schemas.grants_schema -create schemas.grants_schema.grants +update schemas.grants_schema.grants -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json @@ -12,9 +12,9 @@ Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt b/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt index cf6ec356138..3e228c8a6b3 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt +++ b/acceptance/bundle/resources/grants/schemas/duplicate_principals/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default/files... Created schemas.apps_schema -Created schemas.apps_schema.grants +Updated schemas.apps_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -o json diff --git a/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt b/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt index 85dfeaed4b4..6396a83af3b 100644 --- a/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt +++ b/acceptance/bundle/resources/grants/schemas/duplicate_privileges/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-dup-grants-[UNIQUE_NAME]/default/files... Created schemas.apps_schema -Created schemas.apps_schema.grants +Updated schemas.apps_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/grants/schemas/import_errors/output.txt b/acceptance/bundle/resources/grants/schemas/import_errors/output.txt index ce0776a5e3d..52f9599b4d4 100644 --- a/acceptance/bundle/resources/grants/schemas/import_errors/output.txt +++ b/acceptance/bundle/resources/grants/schemas/import_errors/output.txt @@ -33,10 +33,10 @@ Files: 1 uploaded, 0 deleted >>> print_state.py null -=== A missing remote resource still plans a create +=== A missing remote resource still plans an update >>> [CLI] bundle plan -o json { - "action": "create", + "action": "update", "id": null, "import": null } diff --git a/acceptance/bundle/resources/grants/schemas/import_errors/script b/acceptance/bundle/resources/grants/schemas/import_errors/script index d6b978d5e8e..79b7fd0de38 100644 --- a/acceptance/bundle/resources/grants/schemas/import_errors/script +++ b/acceptance/bundle/resources/grants/schemas/import_errors/script @@ -15,7 +15,7 @@ trace musterr $CLI bundle plan trace musterr $CLI bundle deploy trace print_state.py | jq '.state["resources.schemas.grants_schema.grants"]' -title "A missing remote resource still plans a create" +title "A missing remote resource still plans an update" fault.py 'GET /api/2.1/unity-catalog/permissions/**' 404 0 1 RESOURCE_DOES_NOT_EXIST trace $CLI bundle plan -o json | jq '.plan["resources.schemas.grants_schema.grants"] | {action, id, import}' diff --git a/acceptance/bundle/resources/grants/schemas/manage_out_of_band/output.txt b/acceptance/bundle/resources/grants/schemas/manage_out_of_band/output.txt index 5ad9c8e5c73..8388ab25350 100644 --- a/acceptance/bundle/resources/grants/schemas/manage_out_of_band/output.txt +++ b/acceptance/bundle/resources/grants/schemas/manage_out_of_band/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-manage-out-of-band-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants update schema main.schema_manage_oob_[UNIQUE_NAME] --json @update.resolved.json diff --git a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/output.txt b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/output.txt index eacdc186834..3b866bbd14f 100644 --- a/acceptance/bundle/resources/grants/schemas/out_of_band_principal/output.txt +++ b/acceptance/bundle/resources/grants/schemas/out_of_band_principal/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-out-of-band-principal-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants update schema main.schema_out_of_band_principal_[UNIQUE_NAME] --json @update.json diff --git a/acceptance/bundle/resources/grants/schemas/remove_all/output.txt b/acceptance/bundle/resources/grants/schemas/remove_all/output.txt index 2d6f7c22da1..74f721e4c29 100644 --- a/acceptance/bundle/resources/grants/schemas/remove_all/output.txt +++ b/acceptance/bundle/resources/grants/schemas/remove_all/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-remove-all-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants get schema main.schema_remove_all_[UNIQUE_NAME] json.privilege_assignments[].principal = "deco-test-user@databricks.com"; diff --git a/acceptance/bundle/resources/grants/schemas/remove_principal/output.txt b/acceptance/bundle/resources/grants/schemas/remove_principal/output.txt index 6b7d811d0e0..e5824e096cb 100644 --- a/acceptance/bundle/resources/grants/schemas/remove_principal/output.txt +++ b/acceptance/bundle/resources/grants/schemas/remove_principal/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-remove-principal-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants get schema main.schema_remove_principal_[UNIQUE_NAME] json.privilege_assignments[].principal = "[USERNAME]"; diff --git a/acceptance/bundle/resources/grants/schemas/remove_principal_manage/output.txt b/acceptance/bundle/resources/grants/schemas/remove_principal_manage/output.txt index ebf93390e02..78b426d4da1 100644 --- a/acceptance/bundle/resources/grants/schemas/remove_principal_manage/output.txt +++ b/acceptance/bundle/resources/grants/schemas/remove_principal_manage/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-remove-principal-manage-[UNIQUE_NAME]/default/files... Created schemas.grants_schema -Created schemas.grants_schema.grants +Updated schemas.grants_schema.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants get schema main.schema_remove_principal_manage_[UNIQUE_NAME] json.privilege_assignments[].principal = "[USERNAME]"; diff --git a/acceptance/bundle/resources/grants/volume_change_name/output.txt b/acceptance/bundle/resources/grants/volume_change_name/output.txt index ffe41036393..d0a284261f8 100644 --- a/acceptance/bundle/resources/grants/volume_change_name/output.txt +++ b/acceptance/bundle/resources/grants/volume_change_name/output.txt @@ -4,9 +4,9 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created schemas.schema1 Created volumes.volume1 -Created volumes.volume1.grants +Updated volumes.volume1.grants Files: 2 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //unity-catalog { diff --git a/acceptance/bundle/resources/grants/volumes/out.plan1.json b/acceptance/bundle/resources/grants/volumes/out.plan1.json index 0dffbf2c6bf..55bccc68508 100644 --- a/acceptance/bundle/resources/grants/volumes/out.plan1.json +++ b/acceptance/bundle/resources/grants/volumes/out.plan1.json @@ -35,7 +35,7 @@ "label": "${resources.volumes.grants_volume.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "volume", diff --git a/acceptance/bundle/resources/grants/volumes/output.txt b/acceptance/bundle/resources/grants/volumes/output.txt index 8f55736b569..b5a8a0747b3 100644 --- a/acceptance/bundle/resources/grants/volumes/output.txt +++ b/acceptance/bundle/resources/grants/volumes/output.txt @@ -5,9 +5,9 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/schema-grants-[UNIQUE_NAME]/default/files... Created schemas.grants_schema Created volumes.grants_volume -Created volumes.grants_volume.grants +Updated volumes.grants_volume.grants Files: 3 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions diff --git a/acceptance/bundle/resources/permissions/apps/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/apps/current_can_manage/out.plan.json index d7f485235ca..02b37aad3b1 100644 --- a/acceptance/bundle/resources/permissions/apps/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/apps/current_can_manage/out.plan.json @@ -19,7 +19,7 @@ "label": "${resources.apps.[FOO_ID].id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/apps/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/apps/current_can_manage/output.txt index 331a775ed9b..9883c8b42ae 100644 --- a/acceptance/bundle/resources/permissions/apps/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/apps/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created apps.[FOO_ID] -Created apps.[FOO_ID].permissions +Updated apps.[FOO_ID].permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/apps/other_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/apps/other_can_manage/out.plan.json index d7f485235ca..02b37aad3b1 100644 --- a/acceptance/bundle/resources/permissions/apps/other_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/apps/other_can_manage/out.plan.json @@ -19,7 +19,7 @@ "label": "${resources.apps.[FOO_ID].id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/apps/other_can_manage/output.txt b/acceptance/bundle/resources/permissions/apps/other_can_manage/output.txt index 331a775ed9b..9883c8b42ae 100644 --- a/acceptance/bundle/resources/permissions/apps/other_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/apps/other_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created apps.[FOO_ID] -Created apps.[FOO_ID].permissions +Updated apps.[FOO_ID].permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/clusters/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/clusters/current_can_manage/out.plan.json index 165cce27206..67117d69462 100644 --- a/acceptance/bundle/resources/permissions/clusters/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/clusters/current_can_manage/out.plan.json @@ -21,7 +21,7 @@ "label": "${resources.clusters.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/clusters/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/clusters/current_can_manage/output.txt index 095b730a976..f7cbdb00f78 100644 --- a/acceptance/bundle/resources/permissions/clusters/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/clusters/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created clusters.foo -Created clusters.foo.permissions +Updated clusters.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/clusters/target/output.txt b/acceptance/bundle/resources/permissions/clusters/target/output.txt index 68a49427c3e..2841d3fa9de 100644 --- a/acceptance/bundle/resources/permissions/clusters/target/output.txt +++ b/acceptance/bundle/resources/permissions/clusters/target/output.txt @@ -60,8 +60,8 @@ See https://docs.databricks.com/dev-tools/bundles/permissions.html to learn more Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/dev/files... Created clusters.cluster1 -Created clusters.cluster1.permissions +Updated clusters.cluster1.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //clusters diff --git a/acceptance/bundle/resources/permissions/dashboards/create/out.plan.json b/acceptance/bundle/resources/permissions/dashboards/create/out.plan.json index 0b4079b26f4..03b932bb308 100644 --- a/acceptance/bundle/resources/permissions/dashboards/create/out.plan.json +++ b/acceptance/bundle/resources/permissions/dashboards/create/out.plan.json @@ -22,7 +22,7 @@ "label": "${resources.dashboards.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/dashboards/create/output.txt b/acceptance/bundle/resources/permissions/dashboards/create/output.txt index 89ab7eb43b4..5a28c4da377 100644 --- a/acceptance/bundle/resources/permissions/dashboards/create/output.txt +++ b/acceptance/bundle/resources/permissions/dashboards/create/output.txt @@ -14,9 +14,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dashboard-perm-[UNIQUE_NAME]/default/files... Created dashboards.foo -Created dashboards.foo.permissions +Updated dashboards.foo.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/database_instances/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/database_instances/current_can_manage/out.plan.json index 4f3da16cef9..f3d9dbdcbb0 100644 --- a/acceptance/bundle/resources/permissions/database_instances/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/database_instances/current_can_manage/out.plan.json @@ -17,7 +17,7 @@ "label": "${resources.database_instances.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 cd5ba3c5c16..74dc66bdc70 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 @@ -46,9 +46,9 @@ Warning: unknown field: instance_profile_arn Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created database_instances.foo -Created database_instances.foo.permissions +Updated database_instances.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve Warning: unknown field: catalog_name diff --git a/acceptance/bundle/resources/permissions/experiments/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/experiments/current_can_manage/out.plan.json index 54f7ce446ee..0e68f0186e0 100644 --- a/acceptance/bundle/resources/permissions/experiments/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/experiments/current_can_manage/out.plan.json @@ -17,7 +17,7 @@ "label": "${resources.experiments.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 3653f707d35..22098b41a02 100644 --- a/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/experiments/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created experiments.foo -Created experiments.foo.permissions +Updated experiments.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/out.plan.json index f79599cba2d..6bfc529fcc0 100644 --- a/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/out.plan.json @@ -20,7 +20,7 @@ "label": "${resources.genie_spaces.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/output.txt index b662770eaca..22cb7164d53 100644 --- a/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/genie_spaces/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created genie_spaces.foo -Created genie_spaces.foo.permissions +Updated genie_spaces.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/genie_spaces/out_of_band_deletion/output.txt b/acceptance/bundle/resources/permissions/genie_spaces/out_of_band_deletion/output.txt index b7972be4f1b..484d4f05c01 100644 --- a/acceptance/bundle/resources/permissions/genie_spaces/out_of_band_deletion/output.txt +++ b/acceptance/bundle/resources/permissions/genie_spaces/out_of_band_deletion/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created genie_spaces.foo -Created genie_spaces.foo.permissions +Updated genie_spaces.foo.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Permissions are set on the live space >>> [CLI] api get /api/2.0/permissions/genie/[GENIE_SPACE_ID] diff --git a/acceptance/bundle/resources/permissions/jobs/added_remotely/output.txt b/acceptance/bundle/resources/permissions/jobs/added_remotely/output.txt index 81b09d6fcb2..f1d45d7349a 100644 --- a/acceptance/bundle/resources/permissions/jobs/added_remotely/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/added_remotely/output.txt @@ -1,16 +1,16 @@ >>> [CLI] bundle plan create jobs.job_with_permissions -create jobs.job_with_permissions.permissions +update jobs.job_with_permissions.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.job_with_permissions -Created jobs.job_with_permissions.permissions +Updated jobs.job_with_permissions.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resources/permissions/jobs/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/jobs/current_can_manage/out.plan.json index eb77fd33747..797b53c9060 100644 --- a/acceptance/bundle/resources/permissions/jobs/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/jobs/current_can_manage/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/jobs/current_can_manage/output.txt index 29265355cd1..3b09ffb3f40 100644 --- a/acceptance/bundle/resources/permissions/jobs/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/jobs/current_can_manage_run/output.txt b/acceptance/bundle/resources/permissions/jobs/current_can_manage_run/output.txt index bb9515d93a6..e4db704ea0d 100644 --- a/acceptance/bundle/resources/permissions/jobs/current_can_manage_run/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/current_can_manage_run/output.txt @@ -27,9 +27,9 @@ >>> errcode [CLI] bundle deploy -t green Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/green/files... Created jobs.interim_gold_layer_job -Created jobs.interim_gold_layer_job.permissions +Updated jobs.interim_gold_layer_job.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -o json -t green diff --git a/acceptance/bundle/resources/permissions/jobs/current_is_owner/out.plan.json b/acceptance/bundle/resources/permissions/jobs/current_is_owner/out.plan.json index f22b7405f0c..5f111735559 100644 --- a/acceptance/bundle/resources/permissions/jobs/current_is_owner/out.plan.json +++ b/acceptance/bundle/resources/permissions/jobs/current_is_owner/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/current_is_owner/output.txt b/acceptance/bundle/resources/permissions/jobs/current_is_owner/output.txt index a55aced6e70..077fe5e76cc 100644 --- a/acceptance/bundle/resources/permissions/jobs/current_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/current_is_owner/output.txt @@ -10,9 +10,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/jobs/delete_one/out.plan_create.json b/acceptance/bundle/resources/permissions/jobs/delete_one/out.plan_create.json index 49edcf2ea8a..8cd65cd8acd 100644 --- a/acceptance/bundle/resources/permissions/jobs/delete_one/out.plan_create.json +++ b/acceptance/bundle/resources/permissions/jobs/delete_one/out.plan_create.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.job_with_permissions.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/delete_one/output.txt b/acceptance/bundle/resources/permissions/jobs/delete_one/output.txt index 0f43c82ecbc..0c4ce239e93 100644 --- a/acceptance/bundle/resources/permissions/jobs/delete_one/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/delete_one/output.txt @@ -4,9 +4,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created jobs.job_with_permissions -Created jobs.job_with_permissions.permissions +Updated jobs.job_with_permissions.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resources/permissions/jobs/deleted_remotely/out.plan_create.json b/acceptance/bundle/resources/permissions/jobs/deleted_remotely/out.plan_create.json index daa21cd2213..4d4b9dd871d 100644 --- a/acceptance/bundle/resources/permissions/jobs/deleted_remotely/out.plan_create.json +++ b/acceptance/bundle/resources/permissions/jobs/deleted_remotely/out.plan_create.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.job_with_permissions.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/deleted_remotely/output.txt b/acceptance/bundle/resources/permissions/jobs/deleted_remotely/output.txt index 3dbeecb21c7..a5257e3dfeb 100644 --- a/acceptance/bundle/resources/permissions/jobs/deleted_remotely/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/deleted_remotely/output.txt @@ -4,9 +4,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/jobs-permissions-deleted-remotely/default/files... Created jobs.job_with_permissions -Created jobs.job_with_permissions.permissions +Updated jobs.job_with_permissions.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py --nostamp //jobs/ diff --git a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/output.txt b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/output.txt index f875db24c7a..7bbf1c1d73e 100644 --- a/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/output.txt @@ -13,9 +13,9 @@ No active deployment found to destroy! >>> as-test-sp [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[TEST_SP_APPLICATION_ID]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 4 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] permissions set jobs [FOO_ID] --json @take_ownership.json diff --git a/acceptance/bundle/resources/permissions/jobs/other_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/jobs/other_can_manage/out.plan.json index eb77fd33747..797b53c9060 100644 --- a/acceptance/bundle/resources/permissions/jobs/other_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/jobs/other_can_manage/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/other_can_manage/output.txt b/acceptance/bundle/resources/permissions/jobs/other_can_manage/output.txt index 29265355cd1..3b09ffb3f40 100644 --- a/acceptance/bundle/resources/permissions/jobs/other_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/other_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/jobs/other_can_manage_run/output.txt b/acceptance/bundle/resources/permissions/jobs/other_can_manage_run/output.txt index fc7743001ff..f59beda9dee 100644 --- a/acceptance/bundle/resources/permissions/jobs/other_can_manage_run/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/other_can_manage_run/output.txt @@ -31,9 +31,9 @@ >>> errcode [CLI] bundle deploy -t green Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/green/files... Created jobs.interim_gold_layer_job -Created jobs.interim_gold_layer_job.permissions +Updated jobs.interim_gold_layer_job.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> errcode [CLI] bundle destroy -t green --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/jobs/other_is_owner/out.plan.json b/acceptance/bundle/resources/permissions/jobs/other_is_owner/out.plan.json index a765ec398af..b8a4afd1be8 100644 --- a/acceptance/bundle/resources/permissions/jobs/other_is_owner/out.plan.json +++ b/acceptance/bundle/resources/permissions/jobs/other_is_owner/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/other_is_owner/output.txt b/acceptance/bundle/resources/permissions/jobs/other_is_owner/output.txt index 5b61e6a677b..56f1cfd48fa 100644 --- a/acceptance/bundle/resources/permissions/jobs/other_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/other_is_owner/output.txt @@ -14,9 +14,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/jobs/reorder_locally/output.txt b/acceptance/bundle/resources/permissions/jobs/reorder_locally/output.txt index 0eb87dc9eab..7f84b05eecc 100644 --- a/acceptance/bundle/resources/permissions/jobs/reorder_locally/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/reorder_locally/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resources/permissions/jobs/reorder_remotely/output.txt b/acceptance/bundle/resources/permissions/jobs/reorder_remotely/output.txt index faf5d38bdab..ce5878d2ce4 100644 --- a/acceptance/bundle/resources/permissions/jobs/reorder_remotely/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/reorder_remotely/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged diff --git a/acceptance/bundle/resources/permissions/jobs/update/out.plan_create.json b/acceptance/bundle/resources/permissions/jobs/update/out.plan_create.json index 66d93b9d2f2..d633ba42736 100644 --- a/acceptance/bundle/resources/permissions/jobs/update/out.plan_create.json +++ b/acceptance/bundle/resources/permissions/jobs/update/out.plan_create.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.job_with_permissions.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/update/out.plan_restore.json b/acceptance/bundle/resources/permissions/jobs/update/out.plan_restore.json index e62b14f7ce6..119b834e99a 100644 --- a/acceptance/bundle/resources/permissions/jobs/update/out.plan_restore.json +++ b/acceptance/bundle/resources/permissions/jobs/update/out.plan_restore.json @@ -72,13 +72,15 @@ } }, "resources.jobs.job_with_permissions.permissions": { + "id": "/jobs/[JOB_WITH_PERMISSIONS_ID]", "depends_on": [ { "node": "resources.jobs.job_with_permissions", "label": "${resources.jobs.job_with_permissions.id}" } ], - "action": "create", + "action": "update", + "import": true, "new_state": { "value": { "object_id": "/jobs/[JOB_WITH_PERMISSIONS_ID]", @@ -97,6 +99,34 @@ } ] } + }, + "remote_state": { + "object_id": "/jobs/[JOB_WITH_PERMISSIONS_ID]", + "__embed__": [ + { + "level": "CAN_MANAGE", + "user_name": "viewer@example.com" + }, + { + "level": "IS_OWNER", + "user_name": "[USERNAME]" + } + ] + }, + "changes": { + "[group_name='data-team']": { + "action": "update", + "new": { + "level": "CAN_MANAGE", + "group_name": "data-team" + } + }, + "[user_name='viewer@example.com'].level": { + "action": "update", + "old": "CAN_MANAGE", + "new": "CAN_VIEW", + "remote": "CAN_MANAGE" + } } } } diff --git a/acceptance/bundle/resources/permissions/jobs/update/output.txt b/acceptance/bundle/resources/permissions/jobs/update/output.txt index 1ed877b8f1a..67e0c820db8 100644 --- a/acceptance/bundle/resources/permissions/jobs/update/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/update/output.txt @@ -1,18 +1,18 @@ >>> [CLI] bundle plan create jobs.job_with_permissions -create jobs.job_with_permissions.permissions +update jobs.job_with_permissions.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/jobs-permissions-test/default/files... Created jobs.job_with_permissions -Created jobs.job_with_permissions.permissions +Updated jobs.job_with_permissions.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py --nostamp //jobs/ @@ -133,9 +133,9 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/jobs-permissions-test/default/files... -Created jobs.job_with_permissions.permissions +Updated jobs.job_with_permissions.permissions Files: 2 uploaded, 1 deleted -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged +Resources: 0 created, 1 changed, 0 deleted, 1 unchanged >>> print_requests.py --nostamp //jobs/ diff --git a/acceptance/bundle/resources/permissions/jobs/viewers/out.plan.json b/acceptance/bundle/resources/permissions/jobs/viewers/out.plan.json index 29dcba9ab29..1e461f58fd7 100644 --- a/acceptance/bundle/resources/permissions/jobs/viewers/out.plan.json +++ b/acceptance/bundle/resources/permissions/jobs/viewers/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/jobs/viewers/output.txt b/acceptance/bundle/resources/permissions/jobs/viewers/output.txt index 41d08a8ada1..0d9ad1d9bf5 100644 --- a/acceptance/bundle/resources/permissions/jobs/viewers/output.txt +++ b/acceptance/bundle/resources/permissions/jobs/viewers/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/models/current_can_manage/out.deploy.txt b/acceptance/bundle/resources/permissions/models/current_can_manage/out.deploy.txt index 42a0c73fc32..4b1bec5fe5a 100644 --- a/acceptance/bundle/resources/permissions/models/current_can_manage/out.deploy.txt +++ b/acceptance/bundle/resources/permissions/models/current_can_manage/out.deploy.txt @@ -2,6 +2,6 @@ >>> errcode [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created models.foo -Created models.foo.permissions +Updated models.foo.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/resources/permissions/models/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/models/current_can_manage/out.plan.json index b78fcdaa631..e60f74e47d3 100644 --- a/acceptance/bundle/resources/permissions/models/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/models/current_can_manage/out.plan.json @@ -17,7 +17,7 @@ "label": "${resources.models.foo.model_id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/pipelines/504/create/output.txt b/acceptance/bundle/resources/permissions/pipelines/504/create/output.txt index 731801f02ca..893e85b260e 100644 --- a/acceptance/bundle/resources/permissions/pipelines/504/create/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/504/create/output.txt @@ -1,9 +1,9 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo Warn: deploying resources.pipelines.foo.permissions: retrying after 504 Gateway Timeout from PUT /api/2.0/permissions/pipelines/[UUID] -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //api/2.0/permissions/pipelines "PUT /api/2.0/permissions/pipelines/[UUID]" diff --git a/acceptance/bundle/resources/permissions/pipelines/504/create/script b/acceptance/bundle/resources/permissions/pipelines/504/create/script index 616aaeb8034..21f268809e1 100644 --- a/acceptance/bundle/resources/permissions/pipelines/504/create/script +++ b/acceptance/bundle/resources/permissions/pipelines/504/create/script @@ -1,5 +1,5 @@ # Inject a single 504 on the first permissions PUT to simulate a transient error. -# Permissions Set is idempotent, so DoCreate opts in via retrySafe and the deploy succeeds. +# Permissions Set is idempotent, so the initial update is retried and the deploy succeeds. fault.py "PUT /api/2.0/permissions/pipelines/*" 504 0 1 $CLI bundle deploy diff --git a/acceptance/bundle/resources/permissions/pipelines/504/plan/output.txt b/acceptance/bundle/resources/permissions/pipelines/504/plan/output.txt index 3bfb86fdf75..a2b63f27fd5 100644 --- a/acceptance/bundle/resources/permissions/pipelines/504/plan/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/504/plan/output.txt @@ -1,8 +1,8 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Warn: planning resources.pipelines.foo.permissions: retrying after 504 Gateway Timeout from GET /api/2.0/permissions/pipelines/[UUID] diff --git a/acceptance/bundle/resources/permissions/pipelines/504/update/output.txt b/acceptance/bundle/resources/permissions/pipelines/504/update/output.txt index bc942a34a24..ba894817d50 100644 --- a/acceptance/bundle/resources/permissions/pipelines/504/update/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/504/update/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... diff --git a/acceptance/bundle/resources/permissions/pipelines/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/pipelines/current_can_manage/out.plan.json index 37b44208752..ff7747743f7 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/pipelines/current_can_manage/out.plan.json @@ -23,7 +23,7 @@ "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 bde655873be..ccb64ad80f0 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/pipelines/current_is_owner/out.plan.json b/acceptance/bundle/resources/permissions/pipelines/current_is_owner/out.plan.json index f70a476a37e..8b7b9d2ea3f 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_is_owner/out.plan.json +++ b/acceptance/bundle/resources/permissions/pipelines/current_is_owner/out.plan.json @@ -23,7 +23,7 @@ "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 2bc18b8ef40..4f9ed5f185c 100644 --- a/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/current_is_owner/output.txt @@ -10,9 +10,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/pipelines/other_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/pipelines/other_can_manage/out.plan.json index 37b44208752..ff7747743f7 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/pipelines/other_can_manage/out.plan.json @@ -23,7 +23,7 @@ "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 bde655873be..ccb64ad80f0 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/other_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/pipelines/other_is_owner/out.plan.json b/acceptance/bundle/resources/permissions/pipelines/other_is_owner/out.plan.json index 6de5577c476..15fed3208fd 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_is_owner/out.plan.json +++ b/acceptance/bundle/resources/permissions/pipelines/other_is_owner/out.plan.json @@ -23,7 +23,7 @@ "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", 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 b1bfa3af060..fe503443949 100644 --- a/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/other_is_owner/output.txt @@ -14,9 +14,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/pipelines/recreate/output.txt b/acceptance/bundle/resources/permissions/pipelines/recreate/output.txt index 09eb1af7f79..f5d523d25bf 100644 --- a/acceptance/bundle/resources/permissions/pipelines/recreate/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/recreate/output.txt @@ -3,10 +3,10 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created pipelines.foo -Created pipelines.foo.permissions Created schemas.bar +Updated pipelines.foo.permissions Files: 3 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions { diff --git a/acceptance/bundle/resources/permissions/pipelines/update/out.plan_create.json b/acceptance/bundle/resources/permissions/pipelines/update/out.plan_create.json index 791cee44006..e28c167b286 100644 --- a/acceptance/bundle/resources/permissions/pipelines/update/out.plan_create.json +++ b/acceptance/bundle/resources/permissions/pipelines/update/out.plan_create.json @@ -23,7 +23,7 @@ "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/pipelines/update/out.plan_restore.json b/acceptance/bundle/resources/permissions/pipelines/update/out.plan_restore.json index bd9341b8f18..f907eca5006 100644 --- a/acceptance/bundle/resources/permissions/pipelines/update/out.plan_restore.json +++ b/acceptance/bundle/resources/permissions/pipelines/update/out.plan_restore.json @@ -32,13 +32,15 @@ } }, "resources.pipelines.foo.permissions": { + "id": "/pipelines/[FOO_ID]", "depends_on": [ { "node": "resources.pipelines.foo", "label": "${resources.pipelines.foo.id}" } ], - "action": "create", + "action": "update", + "import": true, "new_state": { "value": { "object_id": "/pipelines/[FOO_ID]", @@ -57,6 +59,34 @@ } ] } + }, + "remote_state": { + "object_id": "/pipelines/[FOO_ID]", + "__embed__": [ + { + "level": "CAN_MANAGE", + "user_name": "viewer@example.com" + }, + { + "level": "IS_OWNER", + "user_name": "[USERNAME]" + } + ] + }, + "changes": { + "[group_name='data-team']": { + "action": "update", + "new": { + "level": "CAN_MANAGE", + "group_name": "data-team" + } + }, + "[user_name='viewer@example.com'].level": { + "action": "update", + "old": "CAN_MANAGE", + "new": "CAN_VIEW", + "remote": "CAN_MANAGE" + } } } } diff --git a/acceptance/bundle/resources/permissions/pipelines/update/output.txt b/acceptance/bundle/resources/permissions/pipelines/update/output.txt index b45ea26d4b5..3a3f445a527 100644 --- a/acceptance/bundle/resources/permissions/pipelines/update/output.txt +++ b/acceptance/bundle/resources/permissions/pipelines/update/output.txt @@ -4,9 +4,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/permissions-test/default/files... Created pipelines.foo -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py --nostamp //pipeline ^//api/2.0/bundle @@ -109,9 +109,9 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/permissions-test/default/files... -Created pipelines.foo.permissions +Updated pipelines.foo.permissions Files: 2 uploaded, 1 deleted -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged +Resources: 0 created, 1 changed, 0 deleted, 1 unchanged >>> print_requests.py --nostamp //pipeline ^//api/2.0/bundle diff --git a/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/out.plan.json index 3aa2eb78cf0..c993b286be1 100644 --- a/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/postgres_projects/current_can_manage/out.plan.json @@ -12,13 +12,15 @@ } }, "resources.postgres_projects.foo.permissions": { + "id": "/database-[FOO_ID]", "depends_on": [ { "node": "resources.postgres_projects.foo", "label": "${resources.postgres_projects.foo.project_id}" } ], - "action": "create", + "action": "update", + "import": true, "new_state": { "value": { "object_id": "/database-[FOO_ID]", @@ -41,6 +43,32 @@ } ] } + }, + "remote_state": { + "object_id": "/database-[FOO_ID]" + }, + "changes": { + "": { + "action": "update", + "new": [ + { + "level": "CAN_USE", + "user_name": "viewer@example.com" + }, + { + "level": "CAN_MANAGE", + "group_name": "data-team" + }, + { + "level": "CAN_MANAGE", + "service_principal_name": "[UUID]" + }, + { + "level": "CAN_MANAGE", + "user_name": "[USERNAME]" + } + ] + } } } } 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 f9dda135e95..debdb354529 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 @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created postgres_projects.foo -Created postgres_projects.foo.permissions +Updated postgres_projects.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/out.plan.json index 0510345c76f..0f78d93bf4a 100644 --- a/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/out.plan.json @@ -22,7 +22,7 @@ "label": "${resources.sql_warehouses.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/output.txt index c947301ae27..b9f63579add 100644 --- a/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/sql_warehouses/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created sql_warehouses.foo -Created sql_warehouses.foo.permissions +Updated sql_warehouses.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/target_permissions/out.plan.json b/acceptance/bundle/resources/permissions/target_permissions/out.plan.json index 62477c968a1..2e340f5d37f 100644 --- a/acceptance/bundle/resources/permissions/target_permissions/out.plan.json +++ b/acceptance/bundle/resources/permissions/target_permissions/out.plan.json @@ -36,7 +36,7 @@ "label": "${resources.jobs.foo.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/target_permissions/output.txt b/acceptance/bundle/resources/permissions/target_permissions/output.txt index f8a92d10d75..1daa8bb3a55 100644 --- a/acceptance/bundle/resources/permissions/target_permissions/output.txt +++ b/acceptance/bundle/resources/permissions/target_permissions/output.txt @@ -1,16 +1,16 @@ >>> [CLI] bundle plan create jobs.foo -create jobs.foo.permissions +update jobs.foo.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/test-bundle/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/out.plan.json b/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/out.plan.json index f24e8e5e618..32cda618d5c 100644 --- a/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/out.plan.json +++ b/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/out.plan.json @@ -18,7 +18,7 @@ "label": "${resources.vector_search_endpoints.foo.endpoint_uuid}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/output.txt b/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/output.txt index 2b5e380e368..3b4b8d9fe6f 100644 --- a/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/output.txt +++ b/acceptance/bundle/resources/permissions/vector_search_endpoints/current_can_manage/output.txt @@ -22,9 +22,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created vector_search_endpoints.foo -Created vector_search_endpoints.foo.permissions +Updated vector_search_endpoints.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/acceptance/bundle/resources/secret_scopes/basic/out.plan1.txt b/acceptance/bundle/resources/secret_scopes/basic/out.plan1.txt index 4b52a6b8140..8f9d2b29ed1 100644 --- a/acceptance/bundle/resources/secret_scopes/basic/out.plan1.txt +++ b/acceptance/bundle/resources/secret_scopes/basic/out.plan1.txt @@ -5,7 +5,7 @@ json.plan.resources.secret_scopes.my_scope.new_state.value.scope = "test-scope-[ json.plan.resources.secret_scopes.my_scope.new_state.value.scope_backend_type = "DATABRICKS"; json.plan.resources.secret_scopes.my_scope.permissions.depends_on[0].node = "resources.secret_scopes.my_scope"; json.plan.resources.secret_scopes.my_scope.permissions.depends_on[0].label = "${resources.secret_scopes.my_scope.name}"; -json.plan.resources.secret_scopes.my_scope.permissions.action = "create"; +json.plan.resources.secret_scopes.my_scope.permissions.action = "update"; json.plan.resources.secret_scopes.my_scope.permissions.new_state.value.scope_name = ""; json.plan.resources.secret_scopes.my_scope.permissions.new_state.value.acls[0].permission = "MANAGE"; json.plan.resources.secret_scopes.my_scope.permissions.new_state.value.acls[0].principal = "[USERNAME]"; diff --git a/acceptance/bundle/resources/secret_scopes/deleted_remotely/output.txt b/acceptance/bundle/resources/secret_scopes/deleted_remotely/output.txt index 07ff6eaf942..0d369c0ff57 100644 --- a/acceptance/bundle/resources/secret_scopes/deleted_remotely/output.txt +++ b/acceptance/bundle/resources/secret_scopes/deleted_remotely/output.txt @@ -7,9 +7,9 @@ === plan should recreate the scope >>> [CLI] bundle plan create secret_scopes.my_scope -create secret_scopes.my_scope.permissions +update secret_scopes.my_scope.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged === deploy should recreate the scope >>> [CLI] bundle deploy -qq diff --git a/acceptance/bundle/resources/secret_scopes/permissions-collapse/out.plan.txt b/acceptance/bundle/resources/secret_scopes/permissions-collapse/out.plan.txt index d76c15f89ce..c7f288eee09 100644 --- a/acceptance/bundle/resources/secret_scopes/permissions-collapse/out.plan.txt +++ b/acceptance/bundle/resources/secret_scopes/permissions-collapse/out.plan.txt @@ -1,4 +1,4 @@ create secret_scopes.my_scope -create secret_scopes.my_scope.permissions +update secret_scopes.my_scope.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged diff --git a/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt b/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt index a26b36f3e3d..4625f3b7a80 100644 --- a/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt +++ b/acceptance/bundle/resources/secret_scopes/permissions-collapse/output.txt @@ -5,9 +5,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/secret-scope-collapse-[UNIQUE_NAME]/default/files... Created secret_scopes.my_scope -Created secret_scopes.my_scope.permissions +Updated secret_scopes.my_scope.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] secrets list-scopes -o json { diff --git a/acceptance/bundle/resources/secret_scopes/permissions/out.plan.create.txt b/acceptance/bundle/resources/secret_scopes/permissions/out.plan.create.txt index d76c15f89ce..c7f288eee09 100644 --- a/acceptance/bundle/resources/secret_scopes/permissions/out.plan.create.txt +++ b/acceptance/bundle/resources/secret_scopes/permissions/out.plan.create.txt @@ -1,4 +1,4 @@ create secret_scopes.my_scope -create secret_scopes.my_scope.permissions +update secret_scopes.my_scope.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged diff --git a/bundle/direct/apply.go b/bundle/direct/apply.go index e2d8393869f..505781c4761 100644 --- a/bundle/direct/apply.go +++ b/bundle/direct/apply.go @@ -45,6 +45,15 @@ func (d *DeploymentUnit) Deploy(ctx context.Context, db *dstate.DeploymentState, // The plan found the resource through adoption or at its renamed ID. oldID = planEntry.ID } + if oldID == "" && !d.Adapter.HasDoCreate() { + // A new parent's ID becomes available only after its creation. The caller + // has now resolved the references in newState, so its dependent can update. + var err error + oldID, err = d.Adapter.IDFromState(newState) + if err != nil { + return err + } + } if oldID == "" { return errors.New("state entry not found") } diff --git a/bundle/direct/bundle_plan.go b/bundle/direct/bundle_plan.go index 90d1d7dcb92..093e3a2e40b 100644 --- a/bundle/direct/bundle_plan.go +++ b/bundle/direct/bundle_plan.go @@ -299,8 +299,12 @@ func (b *DeploymentBundle) CalculatePlan(ctx context.Context, client *databricks // state files may still carry a malformed entry). Treat as missing // and let the resource be re-created on this plan. if !hasEntry || dbentry.ID == "" { - entry.Action = deployplan.Create - if !adapter.ResourceConfig().ImportOnPlan || hasUnresolvedIDField(adapter, sv) { + if adapter.HasDoCreate() { + entry.Action = deployplan.Create + return true + } + entry.Action = deployplan.Update + if hasUnresolvedIDField(adapter, sv) { return true } id, err := adapter.IDFromState(sv.Value) @@ -416,9 +420,12 @@ func (b *DeploymentBundle) CalculatePlan(ctx context.Context, client *databricks } if remoteState == nil { - // Even if local action is "recreate" which is higher than "create", we should still pick "create" here - // because we know remote does not exist. - action = deployplan.Create + // A missing object is created again. Resources without creation update + // their parent instead, preserving any planned change to its ID. + action = deployplan.GetHigherAction(deployplan.Update, getMaxAction(entry.Changes)) + if adapter.HasDoCreate() { + action = deployplan.Create + } } else { action = getMaxAction(entry.Changes) } @@ -1379,6 +1386,13 @@ func (b *DeploymentBundle) LookupReferencePreDeploy(ctx context.Context, path *s } id := b.StateDB.GetResourceID(targetResourceKey) if id == "" { + adapter, err := b.getAdapterForKey(targetResourceKey) + if err != nil { + return nil, err + } + if !adapter.HasDoCreate() { + return nil, errDelayed + } return nil, errors.New("internal error: no db entry") } return id, nil diff --git a/bundle/direct/bundle_plan_test.go b/bundle/direct/bundle_plan_test.go index 887a046f167..7b27a5e6bca 100644 --- a/bundle/direct/bundle_plan_test.go +++ b/bundle/direct/bundle_plan_test.go @@ -543,6 +543,23 @@ func TestShouldSkipBackendDefault_MapDriftUsesBracketKeys(t *testing.T) { const jobRunKey = "resources.job_runs.my_run" +func TestLookupReferencePreDeployDelaysNewPermissionsID(t *testing.T) { + adapters, err := dresources.InitAll(nil) + require.NoError(t, err) + const resourceKey = "resources.jobs.job.permissions" + b := &DeploymentBundle{ + Adapters: adapters, + Plan: &deployplan.Plan{Plan: map[string]*deployplan.PlanEntry{ + resourceKey: {Action: deployplan.Update}, + }}, + } + b.StateDB.OpenWithData("state.json", dstate.NewDatabase("test", 0)) + + value, err := b.LookupReferencePreDeploy(t.Context(), structpath.MustParsePath(resourceKey+".id")) + assert.Nil(t, value) + assert.ErrorIs(t, err, errDelayed) +} + // The plan skips only a run that reached the required SUCCESS, so a reference // served from the remote state cache reads a finished run. func TestLookupReferencePreDeploy_FinishedJobRun(t *testing.T) { diff --git a/bundle/direct/dresources/README.md b/bundle/direct/dresources/README.md index db25183dd76..1862773c841 100644 --- a/bundle/direct/dresources/README.md +++ b/bundle/direct/dresources/README.md @@ -59,13 +59,16 @@ If a desired state describes no resource at all (e.g. an empty grants list), imp The planner only consults it for nodes without a state entry: once state exists the node stays in the plan, so emptying it still plans an update, and the update is what removes the entry. -## Adopting existing resources: import_on_plan +## Resources without creation: IDFromState and DoUpdate -Set `import_on_plan: true` in the resource's lifecycle config when the first -deployment should manage what already exists at its `IDFromState` ID (grants, -for example). The planner reads that ID only without a saved ID and after the -ID fields resolve. A missing remote resource plans a create. `IDFromState` -alone does not opt a resource into adoption. +Omit `DoCreate` for resources that update an existing object, such as grants and +permissions. Implement `IDFromState` and `DoUpdate` instead. The first deployment +plans an update, even when its parent must first be created. Apply derives the ID +after resolving those dependencies and records state after the update succeeds. + +When the ID fields resolve during planning, the planner reads the existing +resource and plans its actual differences. `IDFromState` on a resource that +implements `DoCreate` does not opt it into adoption. Planning only reads the resource. Apply persists the adopted state even when the remote already matches: a state-only update records it without a backend call, diff --git a/bundle/direct/dresources/adapter.go b/bundle/direct/dresources/adapter.go index 29aaeada5a8..a6640edd42b 100644 --- a/bundle/direct/dresources/adapter.go +++ b/bundle/direct/dresources/adapter.go @@ -73,7 +73,9 @@ type IResource interface { // [Optional] OverrideChangeDesc can implement custom logic to update a given ChangeDesc; it is run last after built-in classifiers and field triggers. OverrideChangeDesc(ctx context.Context, path *structpath.PathNode, changedesc *ChangeDesc, remoteState any) error - // DoCreate creates a new resource from the newState. Returns id of the resource and optionally remote state. + // [Optional] DoCreate creates a new resource from the newState. Returns id of the resource and optionally remote state. + // Without DoCreate, the resource must implement IDFromState and DoUpdate. Its first + // deployment updates the resource at that ID after resolving its dependencies. // If remote state is available as part of the operation, return it; otherwise return nil. // Example: func (r *ResourceVolume) DoCreate(ctx context.Context, newState *VolumeState) (string, *catalog.VolumeInfo, error) DoCreate(ctx context.Context, newState any) (id string, remoteState any, e error) @@ -257,7 +259,7 @@ func (a *Adapter) initMethods(resource any) error { return err } - a.doCreate, err = prepareCallRequired(resource, "DoCreate") + a.doCreate, err = calladapt.PrepareCall(resource, reflect.TypeFor[IResource](), "DoCreate") if err != nil { return err } @@ -373,7 +375,6 @@ func (a *Adapter) validate() error { validations := []any{ "PrepareState return", a.prepareState.OutTypes[0], stateType, - "DoCreate newState", a.doCreate.InTypes[1], stateType, } // DoDelete is optional; validate its state argument only when implemented. @@ -393,11 +394,18 @@ func (a *Adapter) validate() error { return fmt.Errorf("RemapState method not found and remote type %v must match state type %v", remoteType, stateType) } - // Validate DoCreate: must return (string, remoteType, error) - if len(a.doCreate.OutTypes) != 3 { - return fmt.Errorf("DoCreate must return (string, remoteType, error), got %d return values", len(a.doCreate.OutTypes)) + if a.doCreate != nil { + // DoCreate must return (string, remoteType, error). + if len(a.doCreate.OutTypes) != 3 { + return fmt.Errorf("DoCreate must return (string, remoteType, error), got %d return values", len(a.doCreate.OutTypes)) + } + validations = append(validations, + "DoCreate newState", a.doCreate.InTypes[1], stateType, + "DoCreate remoteState return", a.doCreate.OutTypes[1], remoteType, + ) + } else if a.idFromState == nil || a.doUpdate == nil { + return errors.New("resources without DoCreate require IDFromState and DoUpdate") } - validations = append(validations, "DoCreate remoteState return", a.doCreate.OutTypes[1], remoteType) if a.isEmptyState != nil { validations = append(validations, "IsEmptyState newState", a.isEmptyState.InTypes[0], stateType) @@ -423,9 +431,6 @@ func (a *Adapter) validate() error { if a.idFromState != nil { validations = append(validations, "IDFromState state", a.idFromState.InTypes[0], stateType) } - if a.resourceConfig.ImportOnPlan && a.idFromState == nil { - return errors.New("import_on_plan requires IDFromState") - } if a.resourceConfig != nil && a.resourceConfig.InternalIDField != "" { if a.idFromState == nil || a.doUpdateWithID == nil { @@ -617,6 +622,11 @@ func normalizeNilPointer(v any) any { return v } +// HasDoCreate reports whether the resource creates an object on its first deployment. +func (a *Adapter) HasDoCreate() bool { + return a.doCreate != nil +} + func (a *Adapter) DoCreate(ctx context.Context, newState any) (string, any, error) { outs, err := a.doCreate.Call(ctx, newState) if err != nil { diff --git a/bundle/direct/dresources/adapter_test.go b/bundle/direct/dresources/adapter_test.go new file mode 100644 index 00000000000..1a30c11e298 --- /dev/null +++ b/bundle/direct/dresources/adapter_test.go @@ -0,0 +1,38 @@ +package dresources + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestResourcesWithoutCreate(t *testing.T) { + for resourceType, resource := range SupportedResources { + adapter, err := NewAdapter(resource, resourceType, nil) + require.NoError(t, err) + noCreate := strings.HasSuffix(resourceType, ".grants") || strings.HasSuffix(resourceType, ".permissions") + assert.Equal(t, !noCreate, adapter.HasDoCreate(), resourceType) + if noCreate { + assert.True(t, adapter.HasIDFromState(), resourceType) + assert.True(t, adapter.HasDoUpdate(), resourceType) + } + } +} + +func TestResourcesWithoutCreateRequireIdentityAndUpdate(t *testing.T) { + for _, missing := range []string{"IDFromState", "DoUpdate"} { + t.Run(missing, func(t *testing.T) { + adapter, err := NewAdapter((*ResourceGrants)(nil), "schemas.grants", nil) + require.NoError(t, err) + switch missing { + case "IDFromState": + adapter.idFromState = nil + case "DoUpdate": + adapter.doUpdate = nil + } + assert.EqualError(t, adapter.validate(), "resources without DoCreate require IDFromState and DoUpdate") + }) + } +} diff --git a/bundle/direct/dresources/all_test.go b/bundle/direct/dresources/all_test.go index 605f530a94c..5936aa9c461 100644 --- a/bundle/direct/dresources/all_test.go +++ b/bundle/direct/dresources/all_test.go @@ -1182,9 +1182,20 @@ func testCRUD(t *testing.T, group string, adapter *Adapter, client *databricks.W require.Error(t, err) // TODO: if errors.Is(err, databricks.ErrResourceDoesNotExist) {... } - createdID, remoteStateFromCreate, err := adapter.DoCreate(ctx, newState) - require.NoError(t, err, "DoCreate failed state=%v", newState) - require.NotEmpty(t, createdID, "ID returned from DoCreate was empty") + var createdID string + var remoteStateFromCreate any + if adapter.HasDoCreate() { + createdID, remoteStateFromCreate, err = adapter.DoCreate(ctx, newState) + require.NoError(t, err, "DoCreate failed state=%v", newState) + } else { + createdID, err = adapter.IDFromState(newState) + require.NoError(t, err) + remote, err = adapter.DoRead(ctx, createdID) + require.NoError(t, err) + remoteStateFromCreate, err = adapter.DoUpdate(ctx, createdID, newState, &deployplan.PlanEntry{RemoteState: remote}) + require.NoError(t, err, "initial DoUpdate failed state=%v", newState) + } + require.NotEmpty(t, createdID) remote, err = adapter.DoRead(ctx, createdID) require.NoError(t, err) diff --git a/bundle/direct/dresources/config.go b/bundle/direct/dresources/config.go index 17952afe9d8..7adcc36086a 100644 --- a/bundle/direct/dresources/config.go +++ b/bundle/direct/dresources/config.go @@ -62,10 +62,6 @@ type RemoteAdditionRule struct { // ResourceLifecycleConfig defines lifecycle behavior for a resource type. type ResourceLifecycleConfig struct { - // ImportOnPlan adopts existing resources on the first deployment using IDFromState. - // Deriving an ID alone does not opt a resource into adoption. - ImportOnPlan bool `yaml:"import_on_plan,omitempty"` - // IgnoreRemoteChanges: field patterns where remote changes are ignored (output-only, policy-set). IgnoreRemoteChanges []FieldRule `yaml:"ignore_remote_changes,omitempty"` @@ -164,7 +160,6 @@ const ( ) var empty = ResourceLifecycleConfig{ - ImportOnPlan: false, IgnoreRemoteChanges: nil, IgnoreLocalChanges: nil, InternalIDField: "", diff --git a/bundle/direct/dresources/config_test.go b/bundle/direct/dresources/config_test.go index 997db5b3cfc..53279eed6c6 100644 --- a/bundle/direct/dresources/config_test.go +++ b/bundle/direct/dresources/config_test.go @@ -43,12 +43,6 @@ func TestGetResourceConfig(t *testing.T) { assert.Empty(t, GetResourceConfig("nonexistent").RecreateOnChanges) } -func TestImportOnPlanOptIn(t *testing.T) { - for resourceType := range SupportedResources { - assert.Equal(t, strings.HasSuffix(resourceType, ".grants"), GetResourceConfig(resourceType).ImportOnPlan, resourceType) - } -} - // TestSubResourceConfig checks that grants.yml and permissions.yml apply to the grants and // permissions of every parent, except where a parent has its own file. func TestSubResourceConfig(t *testing.T) { diff --git a/bundle/direct/dresources/configs/grants.yml b/bundle/direct/dresources/configs/grants.yml index 4365ba9638a..2a1f2bed107 100644 --- a/bundle/direct/dresources/configs/grants.yml +++ b/bundle/direct/dresources/configs/grants.yml @@ -1,5 +1,3 @@ -import_on_plan: true - updatable_id_fields: # The ID embeds the parent's full name, which changes when the parent is renamed or # recreated under a new name. UpdateWithID records the new ID, so DoRead does not keep diff --git a/bundle/direct/dresources/grants.go b/bundle/direct/dresources/grants.go index ef19cf14d1a..80260d0b7a4 100644 --- a/bundle/direct/dresources/grants.go +++ b/bundle/direct/dresources/grants.go @@ -125,16 +125,6 @@ func (r *ResourceGrants) DoRead(ctx context.Context, id string) (*GrantsState, e }, nil } -func (r *ResourceGrants) DoCreate(ctx context.Context, state *GrantsState) (string, *GrantsState, error) { - _, err := r.DoUpdate(ctx, "", state, nil) - if err != nil { - // Grants Update is idempotent (additive PATCH), so retrying on transient errors is safe. - return "", nil, retrySafe(err) - } - - return makeGrantsID(state), nil, nil -} - // DoUpdateWithID records the new ID when the parent's ID changes (a rename, or a recreate // under a new name). Otherwise DoRead keeps listing the grants of the old name and every // later plan reports an update. diff --git a/bundle/direct/dresources/grants_test.go b/bundle/direct/dresources/grants_test.go index aa1a30e7c7f..ae1a6d9f57d 100644 --- a/bundle/direct/dresources/grants_test.go +++ b/bundle/direct/dresources/grants_test.go @@ -204,13 +204,6 @@ func TestGrantsIDFromState(t *testing.T) { } } -func TestImportOnPlanRequiresIDFromState(t *testing.T) { - adapter, err := NewAdapter((*ResourceJob)(nil), "jobs", nil) - require.NoError(t, err) - adapter.resourceConfig = &ResourceLifecycleConfig{ImportOnPlan: true} - assert.EqualError(t, adapter.validate(), "import_on_plan requires IDFromState") -} - func TestNormalizeAssignments(t *testing.T) { tests := []struct { name string diff --git a/bundle/direct/dresources/permissions.go b/bundle/direct/dresources/permissions.go index 7f2eb0dbf04..c44953b9b67 100644 --- a/bundle/direct/dresources/permissions.go +++ b/bundle/direct/dresources/permissions.go @@ -225,16 +225,8 @@ func (r *ResourcePermissions) DoRead(ctx context.Context, id string) (*Permissio return &result, nil } -// DoCreate calls https://docs.databricks.com/api/workspace/jobs/setjobpermissions. -func (r *ResourcePermissions) DoCreate(ctx context.Context, newState *PermissionsState) (string, *PermissionsState, error) { - // should we remember the default here? - _, err := r.DoUpdate(ctx, newState.ObjectID, newState, nil) - if err != nil { - // Permissions Set is idempotent (PUT), so retrying on transient errors is safe. - return "", nil, retrySafe(err) - } - - return newState.ObjectID, nil, nil +func (*ResourcePermissions) IDFromState(state *PermissionsState) string { + return state.ObjectID } // DoUpdateWithID records the new ID when the parent is recreated under a new ID. Otherwise diff --git a/bundle/direct/dresources/secret_scope_acls.go b/bundle/direct/dresources/secret_scope_acls.go index 1de301bde2c..01f1f59cbc3 100644 --- a/bundle/direct/dresources/secret_scope_acls.go +++ b/bundle/direct/dresources/secret_scope_acls.go @@ -88,12 +88,8 @@ func (r *ResourceSecretScopeAcls) DoRead(ctx context.Context, id string) (*Secre }, nil } -func (r *ResourceSecretScopeAcls) DoCreate(ctx context.Context, state *SecretScopeAclsState) (string, *SecretScopeAclsState, error) { - err := r.setACLs(ctx, state.ScopeName, state.Acls) - if err != nil { - return "", nil, err - } - return state.ScopeName, nil, nil +func (*ResourceSecretScopeAcls) IDFromState(state *SecretScopeAclsState) string { + return state.ScopeName } // We implement DoUpdateWithId to ensure that the updated ID gets recorded in state. From dd098654801562b1427277469bd216d0d782068e Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 20:06:16 +0000 Subject: [PATCH 2/7] Update bundle expectations for dependent resource updates --- .../skip_permissions/output.txt | 4 +-- .../deploy/immutable/can-manage/output.txt | 4 +-- .../immutable/permissions-change/output.txt | 4 +-- .../bundle/deploy/mlops-stacks/output.txt | 10 +++--- .../grants-remove-principal/output.txt | 4 +-- .../deployment/unbind/grants/output.txt | 8 ++--- .../deployment/unbind/permissions/output.txt | 8 ++--- acceptance/bundle/dms/empty-grants/output.txt | 6 ++-- .../dms/failed-update-permissions/output.txt | 6 ++-- .../bundle/lifecycle/depends-on/output.txt | 6 ++-- .../mutator-permissions-owner-5682/output.txt | 4 +-- .../grant_ref/out.plan_create.json | 4 +-- .../bundle/resource_deps/grant_ref/output.txt | 12 +++---- .../permission_ref/out.plan_create.json | 4 +-- .../resource_deps/permission_ref/output.txt | 12 +++---- .../underscore_key_reference/output.txt | 4 +-- .../bundle/resources/alerts/basic/output.txt | 4 +-- .../permissions/levels/output.txt | 4 +-- .../out_of_band_deletion/output.txt | 4 +-- .../permissions/out_of_band_grant/output.txt | 4 +-- .../resources/external_locations/output.txt | 12 +++---- .../basic/out.first-plan.txt | 2 +- .../drift/recreated_same_name/output.txt | 4 +-- .../models/readplan-permissions/output.txt | 4 +-- .../update/target_qps/output.txt | 4 +-- .../grants/select/output.txt | 8 ++--- .../out.plan_t_service_principal_name.json | 2 +- ...an_t_service_principal_name_different.json | 2 +- .../regular_user/out.plan_t_user_name.json | 2 +- .../out.plan_t_user_name_different.json | 2 +- .../run_as/pipelines/regular_user/output.txt | 32 +++++++++---------- .../out.plan_t_service_principal_name.json | 2 +- ...an_t_service_principal_name_different.json | 2 +- .../out.plan_t_user_name.json | 2 +- .../out.plan_t_user_name_different.json | 2 +- .../pipelines/service_principal/output.txt | 32 +++++++++---------- .../select/grants_permissions/output.txt | 16 +++++----- .../default-python/classic/out.plan_prod.json | 4 +-- .../default-python/classic/output.txt | 12 +++---- .../combinations/classic/output.txt | 6 ++-- .../combinations/serverless/output.txt | 6 ++-- .../integration_classic/out.plan_prod.json | 4 +-- .../integration_classic/output.txt | 6 ++-- .../serverless/out.plan_prod.json | 4 +-- .../default-python/serverless/output.txt | 12 +++---- bundle/direct/apply.go | 13 +------- bundle/direct/bundle_plan_test.go | 6 ++-- bundle/direct/dresources/retry.go | 29 ----------------- 48 files changed, 154 insertions(+), 194 deletions(-) delete mode 100644 bundle/direct/dresources/retry.go diff --git a/acceptance/bundle/config-remote-sync/skip_permissions/output.txt b/acceptance/bundle/config-remote-sync/skip_permissions/output.txt index dd929a13ca0..d4c164896ad 100644 --- a/acceptance/bundle/config-remote-sync/skip_permissions/output.txt +++ b/acceptance/bundle/config-remote-sync/skip_permissions/output.txt @@ -1,8 +1,8 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created jobs.my_job -Created jobs.my_job.permissions +Updated jobs.my_job.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Add a permission remotely (a change on the permissions sub-resource) diff --git a/acceptance/bundle/deploy/immutable/can-manage/output.txt b/acceptance/bundle/deploy/immutable/can-manage/output.txt index cdcca39708d..9d31725bab4 100644 --- a/acceptance/bundle/deploy/immutable/can-manage/output.txt +++ b/acceptance/bundle/deploy/immutable/can-manage/output.txt @@ -15,9 +15,9 @@ See https://docs.databricks.com/dev-tools/bundles/permissions.html to learn more Created internal_immutable_snapshots.immutable Created jobs.my_job -Created jobs.my_job.permissions +Updated jobs.my_job.permissions Files: 0 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged === Check can_manage_principals sent to the snapshot create API >>> print_requests.py //api/2.0/snapshots diff --git a/acceptance/bundle/deploy/immutable/permissions-change/output.txt b/acceptance/bundle/deploy/immutable/permissions-change/output.txt index 7017c7b28f6..95a4bccb9ce 100644 --- a/acceptance/bundle/deploy/immutable/permissions-change/output.txt +++ b/acceptance/bundle/deploy/immutable/permissions-change/output.txt @@ -21,11 +21,11 @@ Consider using a adding a top-level permissions section such as the following: See https://docs.databricks.com/dev-tools/bundles/permissions.html to learn more about permission configuration. in databricks.yml:22:3 -Created jobs.my_job.permissions Recreated internal_immutable_snapshots.immutable Updated jobs.my_job +Updated jobs.my_job.permissions Files: 0 uploaded, 0 deleted -Resources: 2 created, 1 changed, 1 deleted, 0 unchanged +Resources: 1 created, 2 changed, 1 deleted, 0 unchanged Second snapshot path: /Workspace/Users/[UUID][0]/.snapshots/[SNAPSHOT_HASH]/[SNAPSHOT_HASH]-[UUID][2]/snapshot/files/src/main.py === Verify snapshot path changed after permissions change diff --git a/acceptance/bundle/deploy/mlops-stacks/output.txt b/acceptance/bundle/deploy/mlops-stacks/output.txt index 1b62cc0093e..c672daacdff 100644 --- a/acceptance/bundle/deploy/mlops-stacks/output.txt +++ b/acceptance/bundle/deploy/mlops-stacks/output.txt @@ -83,15 +83,15 @@ Warning: unknown field: description Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files... Created experiments.experiment -Created experiments.experiment.permissions Created jobs.batch_inference_job -Created jobs.batch_inference_job.permissions Created jobs.model_training_job -Created jobs.model_training_job.permissions Created registered_models.model -Created registered_models.model.grants +Updated experiments.experiment.permissions +Updated jobs.batch_inference_job.permissions +Updated jobs.model_training_job.permissions +Updated registered_models.model.grants Files: 26 uploaded, 0 deleted -Resources: 8 created, 0 changed, 0 deleted, 0 unchanged +Resources: 4 created, 4 changed, 0 deleted, 0 unchanged >>> [CLI] bundle summary --var catalog_name=main -o json Warning: expected a string value, found null diff --git a/acceptance/bundle/deploy/readplan/grants-remove-principal/output.txt b/acceptance/bundle/deploy/readplan/grants-remove-principal/output.txt index 948a497f7e9..9d7c7abdced 100644 --- a/acceptance/bundle/deploy/readplan/grants-remove-principal/output.txt +++ b/acceptance/bundle/deploy/readplan/grants-remove-principal/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created schemas.myschema -Created schemas.myschema.grants +Updated schemas.myschema.grants Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //unity-catalog/permissions --sort { diff --git a/acceptance/bundle/deployment/unbind/grants/output.txt b/acceptance/bundle/deployment/unbind/grants/output.txt index 56265eeccd3..9d8ad8721bd 100644 --- a/acceptance/bundle/deployment/unbind/grants/output.txt +++ b/acceptance/bundle/deployment/unbind/grants/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... Created schemas.schema_1 -Created schemas.schema_1.grants +Updated schemas.schema_1.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] grants get schema main.test-schema-[UNIQUE_NAME] --output json { @@ -20,9 +20,9 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle deploy --var suffix=another Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... Created schemas.schema_1 -Created schemas.schema_1.grants +Updated schemas.schema_1.grants Files: 0 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Grants should be the same as before unbind >>> [CLI] grants get schema main.test-schema-[UNIQUE_NAME] --output json diff --git a/acceptance/bundle/deployment/unbind/permissions/output.txt b/acceptance/bundle/deployment/unbind/permissions/output.txt index 4c7e4bde615..e7fa879f7ba 100644 --- a/acceptance/bundle/deployment/unbind/permissions/output.txt +++ b/acceptance/bundle/deployment/unbind/permissions/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... Created jobs.job_1 -Created jobs.job_1.permissions +Updated jobs.job_1.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] jobs get-permissions [JOB_1_ID] --output json { @@ -22,9 +22,9 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... Created jobs.job_1 -Created jobs.job_1.permissions +Updated jobs.job_1.permissions Files: 0 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Permissions should be the same as before unbind >>> [CLI] jobs get-permissions [JOB_1_ID] --output json diff --git a/acceptance/bundle/dms/empty-grants/output.txt b/acceptance/bundle/dms/empty-grants/output.txt index 169598c56a2..125b3ace48a 100644 --- a/acceptance/bundle/dms/empty-grants/output.txt +++ b/acceptance/bundle/dms/empty-grants/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-empty-grants-[UNIQUE_NAME]/default/files... Created schemas.foo -Created schemas.foo.grants +Updated schemas.foo.grants Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py --dms //api/2.0/bundle { @@ -35,7 +35,7 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged "resource_key": "schemas.foo" }, { - "action_type": "OPERATION_ACTION_TYPE_CREATE", + "action_type": "OPERATION_ACTION_TYPE_UPDATE", "resource_key": "schemas.foo.grants" } ], diff --git a/acceptance/bundle/dms/failed-update-permissions/output.txt b/acceptance/bundle/dms/failed-update-permissions/output.txt index e3b75a673de..ebfaf3b394a 100644 --- a/acceptance/bundle/dms/failed-update-permissions/output.txt +++ b/acceptance/bundle/dms/failed-update-permissions/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-failed-update-permissions-[UNIQUE_NAME]/default/files... Created jobs.foo -Created jobs.foo.permissions +Updated jobs.foo.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === The plan records the deployment_history feature and the job >>> [CLI] bundle plan -o json @@ -31,7 +31,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged "resource_key": "jobs.foo" }, { - "last_action_type": "OPERATION_ACTION_TYPE_CREATE", + "last_action_type": "OPERATION_ACTION_TYPE_UPDATE", "last_version_id": "1", "resource_key": "jobs.foo.permissions" } diff --git a/acceptance/bundle/lifecycle/depends-on/output.txt b/acceptance/bundle/lifecycle/depends-on/output.txt index 494c0b523ee..c3a2a274367 100644 --- a/acceptance/bundle/lifecycle/depends-on/output.txt +++ b/acceptance/bundle/lifecycle/depends-on/output.txt @@ -42,12 +42,12 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.a_job Created jobs.z_job -Created jobs.z_job.permissions Created pipelines.z_pipeline Created schemas.z_schema -Created schemas.z_schema.grants +Updated jobs.z_job.permissions +Updated schemas.z_schema.grants Files: 1 uploaded, 0 deleted -Resources: 6 created, 0 changed, 0 deleted, 0 unchanged +Resources: 4 created, 2 changed, 0 deleted, 0 unchanged >>> print_requests.py //jobs //pipelines //unity-catalog POST /api/2.2/jobs/create a_job diff --git a/acceptance/bundle/python/mutator-permissions-owner-5682/output.txt b/acceptance/bundle/python/mutator-permissions-owner-5682/output.txt index c28efb0f69f..706f173c46a 100644 --- a/acceptance/bundle/python/mutator-permissions-owner-5682/output.txt +++ b/acceptance/bundle/python/mutator-permissions-owner-5682/output.txt @@ -8,6 +8,6 @@ >>> uv run [UV_ARGS] -q [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... Created pipelines.my_pipeline -Created pipelines.my_pipeline.permissions +Updated pipelines.my_pipeline.permissions Files: 5 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/resource_deps/grant_ref/out.plan_create.json b/acceptance/bundle/resource_deps/grant_ref/out.plan_create.json index 5d3a6e82575..25b17868f0a 100644 --- a/acceptance/bundle/resource_deps/grant_ref/out.plan_create.json +++ b/acceptance/bundle/resource_deps/grant_ref/out.plan_create.json @@ -26,7 +26,7 @@ "label": "${resources.schemas.schema_b.grants[1].principal}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "schema", @@ -67,7 +67,7 @@ "label": "${resources.schemas.schema_b.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "schema", diff --git a/acceptance/bundle/resource_deps/grant_ref/output.txt b/acceptance/bundle/resource_deps/grant_ref/output.txt index 76d11455cb3..43b99649d05 100644 --- a/acceptance/bundle/resource_deps/grant_ref/output.txt +++ b/acceptance/bundle/resource_deps/grant_ref/output.txt @@ -1,19 +1,19 @@ >>> [CLI] bundle plan create schemas.schema_a -create schemas.schema_a.grants +update schemas.schema_a.grants create schemas.schema_b -create schemas.schema_b.grants +update schemas.schema_b.grants -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created schemas.schema_a -Created schemas.schema_a.grants Created schemas.schema_b -Created schemas.schema_b.grants +Updated schemas.schema_a.grants +Updated schemas.schema_b.grants Files: 2 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/resource_deps/permission_ref/out.plan_create.json b/acceptance/bundle/resource_deps/permission_ref/out.plan_create.json index 37891be49e1..a5e2e186a9d 100644 --- a/acceptance/bundle/resource_deps/permission_ref/out.plan_create.json +++ b/acceptance/bundle/resource_deps/permission_ref/out.plan_create.json @@ -35,7 +35,7 @@ "label": "${resources.jobs.job_b.permissions[1].level}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", @@ -84,7 +84,7 @@ "label": "${resources.jobs.job_b.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/resource_deps/permission_ref/output.txt b/acceptance/bundle/resource_deps/permission_ref/output.txt index 1f45e18deb9..deacdbcd962 100644 --- a/acceptance/bundle/resource_deps/permission_ref/output.txt +++ b/acceptance/bundle/resource_deps/permission_ref/output.txt @@ -1,19 +1,19 @@ >>> [CLI] bundle plan create jobs.job_a -create jobs.job_a.permissions +update jobs.job_a.permissions create jobs.job_b -create jobs.job_b.permissions +update jobs.job_b.permissions -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -o json >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs.job_a -Created jobs.job_a.permissions Created jobs.job_b -Created jobs.job_b.permissions +Updated jobs.job_a.permissions +Updated jobs.job_b.permissions Files: 2 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/resource_deps/underscore_key_reference/output.txt b/acceptance/bundle/resource_deps/underscore_key_reference/output.txt index bcb34b27024..1ccd929327a 100644 --- a/acceptance/bundle/resource_deps/underscore_key_reference/output.txt +++ b/acceptance/bundle/resource_deps/underscore_key_reference/output.txt @@ -3,7 +3,7 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created jobs._asset-bundle-deploymentjob Created jobs._job -Created jobs._job.permissions Created jobs.ref +Updated jobs._job.permissions Files: 1 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 3 created, 1 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/resources/alerts/basic/output.txt b/acceptance/bundle/resources/alerts/basic/output.txt index 3944c2a21ff..93ea340872b 100644 --- a/acceptance/bundle/resources/alerts/basic/output.txt +++ b/acceptance/bundle/resources/alerts/basic/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/alerts-basic-[UNIQUE_NAME]/default/files... Created alerts.myalert -Created alerts.myalert.permissions +Updated alerts.myalert.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] alerts-v2 get-alert [ALERT_ID] { diff --git a/acceptance/bundle/resources/cluster_policies/permissions/levels/output.txt b/acceptance/bundle/resources/cluster_policies/permissions/levels/output.txt index 37d4c20606e..62cbf78c9a7 100644 --- a/acceptance/bundle/resources/cluster_policies/permissions/levels/output.txt +++ b/acceptance/bundle/resources/cluster_policies/permissions/levels/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/cluster-policy-permission-levels-[UNIQUE_NAME]/default/files... Created cluster_policies.test_cluster_policy -Created cluster_policies.test_cluster_policy.permissions +Updated cluster_policies.test_cluster_policy.permissions Files: 2 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions/cluster-policies { diff --git a/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_deletion/output.txt b/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_deletion/output.txt index e64e6628d1b..e55c38b9cd5 100644 --- a/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_deletion/output.txt +++ b/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_deletion/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test_cluster_policy_permissions_recreate/default/files... Created cluster_policies.test_cluster_policy -Created cluster_policies.test_cluster_policy.permissions +Updated cluster_policies.test_cluster_policy.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Permissions are set on the live policy >>> [CLI] api get /api/2.0/permissions/cluster-policies/[TEST_CLUSTER_POLICY_ID] diff --git a/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_grant/output.txt b/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_grant/output.txt index 886ab1d7f1d..cc2662f6d23 100644 --- a/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_grant/output.txt +++ b/acceptance/bundle/resources/cluster_policies/permissions/out_of_band_grant/output.txt @@ -2,9 +2,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test_cluster_policy_permissions_drift/default/files... Created cluster_policies.test_cluster_policy -Created cluster_policies.test_cluster_policy.permissions +Updated cluster_policies.test_cluster_policy.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged === Plan is a no-op immediately after deploy >>> [CLI] bundle plan diff --git a/acceptance/bundle/resources/external_locations/output.txt b/acceptance/bundle/resources/external_locations/output.txt index 56858719e8e..9e101adfe33 100644 --- a/acceptance/bundle/resources/external_locations/output.txt +++ b/acceptance/bundle/resources/external_locations/output.txt @@ -2,20 +2,20 @@ === Deploy bundle with catalog and external location >>> [CLI] bundle plan create catalogs.test_catalog -create catalogs.test_catalog.grants +update catalogs.test_catalog.grants create external_locations.test_location -create external_locations.test_location.grants +update external_locations.test_location.grants -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files... Created catalogs.test_catalog -Created catalogs.test_catalog.grants Created external_locations.test_location -Created external_locations.test_location.grants +Updated catalogs.test_catalog.grants +Updated external_locations.test_location.grants Files: 5 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged === Assert the catalog is created with grants >>> [CLI] catalogs get test_catalog_[UNIQUE_NAME] diff --git a/acceptance/bundle/resources/model_serving_endpoints/basic/out.first-plan.txt b/acceptance/bundle/resources/model_serving_endpoints/basic/out.first-plan.txt index ec4d39e8dda..9e9ff95ac5e 100644 --- a/acceptance/bundle/resources/model_serving_endpoints/basic/out.first-plan.txt +++ b/acceptance/bundle/resources/model_serving_endpoints/basic/out.first-plan.txt @@ -4,7 +4,7 @@ json.plan.resources.model_serving_endpoints.my_endpoint.action = "create"; json.plan.resources.model_serving_endpoints.my_endpoint.new_state.value.name = "[ENDPOINT_NAME_1]"; json.plan.resources.model_serving_endpoints.my_endpoint.permissions.depends_on[0].node = "resources.model_serving_endpoints.my_endpoint"; json.plan.resources.model_serving_endpoints.my_endpoint.permissions.depends_on[0].label = "${resources.model_serving_endpoints.my_endpoint.endpoint_id}"; -json.plan.resources.model_serving_endpoints.my_endpoint.permissions.action = "create"; +json.plan.resources.model_serving_endpoints.my_endpoint.permissions.action = "update"; json.plan.resources.model_serving_endpoints.my_endpoint.permissions.new_state.value.object_id = ""; json.plan.resources.model_serving_endpoints.my_endpoint.permissions.new_state.value.__embed__[0].level = "CAN_MANAGE"; json.plan.resources.model_serving_endpoints.my_endpoint.permissions.new_state.value.__embed__[0].service_principal_name = "[USERNAME]"; diff --git a/acceptance/bundle/resources/model_serving_endpoints/drift/recreated_same_name/output.txt b/acceptance/bundle/resources/model_serving_endpoints/drift/recreated_same_name/output.txt index 6c9c004b74e..bf71bd90390 100644 --- a/acceptance/bundle/resources/model_serving_endpoints/drift/recreated_same_name/output.txt +++ b/acceptance/bundle/resources/model_serving_endpoints/drift/recreated_same_name/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/drift-mse-recreated-same-name-[UNIQUE_NAME]/default/files... Created model_serving_endpoints.my_endpoint -Created model_serving_endpoints.my_endpoint.permissions +Updated model_serving_endpoints.my_endpoint.permissions Files: 0 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] serving-endpoints get mse-endpoint-[UNIQUE_NAME] { diff --git a/acceptance/bundle/resources/models/readplan-permissions/output.txt b/acceptance/bundle/resources/models/readplan-permissions/output.txt index a4e059b61a7..454463c8e42 100644 --- a/acceptance/bundle/resources/models/readplan-permissions/output.txt +++ b/acceptance/bundle/resources/models/readplan-permissions/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... Created models.mymodel -Created models.mymodel.permissions +Updated models.mymodel.permissions Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions/registered-models { diff --git a/acceptance/bundle/resources/vector_search_endpoints/update/target_qps/output.txt b/acceptance/bundle/resources/vector_search_endpoints/update/target_qps/output.txt index 44bbd77a910..99030307d18 100644 --- a/acceptance/bundle/resources/vector_search_endpoints/update/target_qps/output.txt +++ b/acceptance/bundle/resources/vector_search_endpoints/update/target_qps/output.txt @@ -3,9 +3,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/update-vs-endpoint-target-qps-[UNIQUE_NAME]/default/files... Created vector_search_endpoints.my_endpoint -Created vector_search_endpoints.my_endpoint.permissions +Updated vector_search_endpoints.my_endpoint.permissions Files: 0 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //vector-search/endpoints //permissions diff --git a/acceptance/bundle/resources/vector_search_indexes/grants/select/output.txt b/acceptance/bundle/resources/vector_search_indexes/grants/select/output.txt index 14fa8a3d48b..0ecd969b729 100644 --- a/acceptance/bundle/resources/vector_search_indexes/grants/select/output.txt +++ b/acceptance/bundle/resources/vector_search_indexes/grants/select/output.txt @@ -2,17 +2,17 @@ >>> [CLI] bundle plan create vector_search_endpoints.my_endpoint create vector_search_indexes.my_index -create vector_search_indexes.my_index.grants +update vector_search_indexes.my_index.grants -Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/vs-index-grants-[UNIQUE_NAME]/default/files... Created vector_search_endpoints.my_endpoint Created vector_search_indexes.my_index -Created vector_search_indexes.my_index.grants +Updated vector_search_indexes.my_index.grants Files: 0 uploaded, 0 deleted -Resources: 3 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 1 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged diff --git a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name.json b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name.json index 2ef869ccde5..218ca35c1bb 100644 --- a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name.json +++ b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name_different.json b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name_different.json index 530eb3584ad..c636dd5d5c6 100644 --- a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name_different.json +++ b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_service_principal_name_different.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name.json b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name.json index 59caae39355..e069b8843ee 100644 --- a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name.json +++ b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name_different.json b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name_different.json index 73e78d7ff49..6a25a298764 100644 --- a/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name_different.json +++ b/acceptance/bundle/run_as/pipelines/regular_user/out.plan_t_user_name_different.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/regular_user/output.txt b/acceptance/bundle/run_as/pipelines/regular_user/output.txt index 21faafb4d57..58a6231c42c 100644 --- a/acceptance/bundle/run_as/pipelines/regular_user/output.txt +++ b/acceptance/bundle/run_as/pipelines/regular_user/output.txt @@ -12,16 +12,16 @@ Validation OK! >>> [CLI] bundle plan -t t_user_name create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_user_name Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_user_name/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_user_name_different >>> [CLI] bundle validate -t t_user_name_different @@ -35,16 +35,16 @@ Validation OK! >>> [CLI] bundle plan -t t_user_name_different create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_user_name_different Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_user_name_different/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 5 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_service_principal_name >>> [CLI] bundle validate -t t_service_principal_name @@ -58,16 +58,16 @@ Validation OK! >>> [CLI] bundle plan -t t_service_principal_name create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_service_principal_name Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_service_principal_name/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 7 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_service_principal_name_different >>> [CLI] bundle validate -t t_service_principal_name_different @@ -81,13 +81,13 @@ Validation OK! >>> [CLI] bundle plan -t t_service_principal_name_different create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_service_principal_name_different Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_service_principal_name_different/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 9 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name.json b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name.json index c9ea7a11405..fc6bc07e3bd 100644 --- a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name.json +++ b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name_different.json b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name_different.json index 313da5328f1..8e951737259 100644 --- a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name_different.json +++ b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_service_principal_name_different.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name.json b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name.json index c813a21c989..eb0c2cf561c 100644 --- a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name.json +++ b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name_different.json b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name_different.json index e066c98eab8..41c7411cc55 100644 --- a/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name_different.json +++ b/acceptance/bundle/run_as/pipelines/service_principal/out.plan_t_user_name_different.json @@ -33,7 +33,7 @@ "label": "${resources.pipelines.nyc_taxi_pipeline.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/run_as/pipelines/service_principal/output.txt b/acceptance/bundle/run_as/pipelines/service_principal/output.txt index 21faafb4d57..58a6231c42c 100644 --- a/acceptance/bundle/run_as/pipelines/service_principal/output.txt +++ b/acceptance/bundle/run_as/pipelines/service_principal/output.txt @@ -12,16 +12,16 @@ Validation OK! >>> [CLI] bundle plan -t t_user_name create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_user_name Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_user_name/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_user_name_different >>> [CLI] bundle validate -t t_user_name_different @@ -35,16 +35,16 @@ Validation OK! >>> [CLI] bundle plan -t t_user_name_different create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_user_name_different Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_user_name_different/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 5 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_service_principal_name >>> [CLI] bundle validate -t t_service_principal_name @@ -58,16 +58,16 @@ Validation OK! >>> [CLI] bundle plan -t t_service_principal_name create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_service_principal_name Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_service_principal_name/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 7 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged \nProcessing target: t_service_principal_name_different >>> [CLI] bundle validate -t t_service_principal_name_different @@ -81,13 +81,13 @@ Validation OK! >>> [CLI] bundle plan -t t_service_principal_name_different create pipelines.nyc_taxi_pipeline -create pipelines.nyc_taxi_pipeline.permissions +update pipelines.nyc_taxi_pipeline.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged >>> [CLI] bundle deploy -t t_service_principal_name_different Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/run_as/t_service_principal_name_different/files... Created pipelines.nyc_taxi_pipeline -Created pipelines.nyc_taxi_pipeline.permissions +Updated pipelines.nyc_taxi_pipeline.permissions Files: 9 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged diff --git a/acceptance/bundle/select/grants_permissions/output.txt b/acceptance/bundle/select/grants_permissions/output.txt index 6ada2c1689b..f545e45b792 100644 --- a/acceptance/bundle/select/grants_permissions/output.txt +++ b/acceptance/bundle/select/grants_permissions/output.txt @@ -1,15 +1,15 @@ >>> [CLI] bundle plan --select jobs.my_job create jobs.my_job -create jobs.my_job.permissions +update jobs.my_job.permissions -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged, 2 not selected +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged, 2 not selected >>> [CLI] bundle plan --select schemas.my_schema create schemas.my_schema -create schemas.my_schema.grants +update schemas.my_schema.grants -Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged, 2 not selected +Plan: 1 to add, 1 to change, 0 to delete, 0 unchanged, 2 not selected >>> [CLI] bundle plan --select jobs.my_job.permissions Error: no such resource: jobs.my_job.permissions @@ -22,16 +22,16 @@ Error: no such resource: schemas.my_schema.grants === bundle deploy --select jobs.my_job Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-subnodes-[UNIQUE_NAME]/default/files... Created jobs.my_job -Created jobs.my_job.permissions +Updated jobs.my_job.permissions Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged, 2 not selected +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged, 2 not selected === bundle deploy --select schemas.my_schema Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-subnodes-[UNIQUE_NAME]/default/files... Created schemas.my_schema -Created schemas.my_schema.grants +Updated schemas.my_schema.grants Files: 1 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged, 2 not selected +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged, 2 not selected >>> print_requests.py --sort //permissions { diff --git a/acceptance/bundle/templates/default-python/classic/out.plan_prod.json b/acceptance/bundle/templates/default-python/classic/out.plan_prod.json index 20e33bf4620..6568ceca39f 100644 --- a/acceptance/bundle/templates/default-python/classic/out.plan_prod.json +++ b/acceptance/bundle/templates/default-python/classic/out.plan_prod.json @@ -116,7 +116,7 @@ "label": "${resources.jobs.sample_job.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", @@ -167,7 +167,7 @@ "label": "${resources.pipelines.my_default_python_etl.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/templates/default-python/classic/output.txt b/acceptance/bundle/templates/default-python/classic/output.txt index 873557670ea..a9439b12327 100644 --- a/acceptance/bundle/templates/default-python/classic/output.txt +++ b/acceptance/bundle/templates/default-python/classic/output.txt @@ -42,11 +42,11 @@ Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -t prod Building python_artifact... create jobs.sample_job -create jobs.sample_job.permissions +update jobs.sample_job.permissions create pipelines.my_default_python_etl -create pipelines.my_default_python_etl.permissions +update pipelines.my_default_python_etl.permissions -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged Building python_artifact... Building python_artifact... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev/files... @@ -65,11 +65,11 @@ Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged Building python_artifact... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/prod/files... Created jobs.sample_job -Created jobs.sample_job.permissions Created pipelines.my_default_python_etl -Created pipelines.my_default_python_etl.permissions +Updated jobs.sample_job.permissions +Updated pipelines.my_default_python_etl.permissions Files: 20 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t prod Building python_artifact... diff --git a/acceptance/bundle/templates/default-python/combinations/classic/output.txt b/acceptance/bundle/templates/default-python/combinations/classic/output.txt index 930848ad17d..4f870930736 100644 --- a/acceptance/bundle/templates/default-python/combinations/classic/output.txt +++ b/acceptance/bundle/templates/default-python/combinations/classic/output.txt @@ -42,10 +42,10 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/prod/files... Created jobs.sample_job -Created jobs.sample_job.permissions Created pipelines.X[UNIQUE_NAME]_etl -Created pipelines.X[UNIQUE_NAME]_etl.permissions +Updated jobs.sample_job.permissions +Updated pipelines.X[UNIQUE_NAME]_etl.permissions Files: 24 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged Destroy: 2 deleted diff --git a/acceptance/bundle/templates/default-python/combinations/serverless/output.txt b/acceptance/bundle/templates/default-python/combinations/serverless/output.txt index 930848ad17d..4f870930736 100644 --- a/acceptance/bundle/templates/default-python/combinations/serverless/output.txt +++ b/acceptance/bundle/templates/default-python/combinations/serverless/output.txt @@ -42,10 +42,10 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged Destroy: 2 deleted Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/prod/files... Created jobs.sample_job -Created jobs.sample_job.permissions Created pipelines.X[UNIQUE_NAME]_etl -Created pipelines.X[UNIQUE_NAME]_etl.permissions +Updated jobs.sample_job.permissions +Updated pipelines.X[UNIQUE_NAME]_etl.permissions Files: 24 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged Destroy: 2 deleted diff --git a/acceptance/bundle/templates/default-python/integration_classic/out.plan_prod.json b/acceptance/bundle/templates/default-python/integration_classic/out.plan_prod.json index 9f57d18ed24..5a5d0310838 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/out.plan_prod.json +++ b/acceptance/bundle/templates/default-python/integration_classic/out.plan_prod.json @@ -116,7 +116,7 @@ "label": "${resources.jobs.sample_job.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", @@ -167,7 +167,7 @@ "label": "${resources.pipelines.project_name_[UNIQUE_NAME]_etl.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/templates/default-python/integration_classic/output.txt b/acceptance/bundle/templates/default-python/integration_classic/output.txt index f3a56f4b4ae..d7f40daaa53 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/output.txt +++ b/acceptance/bundle/templates/default-python/integration_classic/output.txt @@ -291,11 +291,11 @@ Building python_artifact... Uploading dist/project_name_[UNIQUE_NAME]-0.0.1-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod/files... Created jobs.sample_job -Created jobs.sample_job.permissions Created pipelines.project_name_[UNIQUE_NAME]_etl -Created pipelines.project_name_[UNIQUE_NAME]_etl.permissions +Updated jobs.sample_job.permissions +Updated pipelines.project_name_[UNIQUE_NAME]_etl.permissions Files: 20 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged >>> [CLI] bundle summary -t prod Name: project_name_[UNIQUE_NAME] diff --git a/acceptance/bundle/templates/default-python/serverless/out.plan_prod.json b/acceptance/bundle/templates/default-python/serverless/out.plan_prod.json index 9d636f14ccc..ec02b04f43e 100644 --- a/acceptance/bundle/templates/default-python/serverless/out.plan_prod.json +++ b/acceptance/bundle/templates/default-python/serverless/out.plan_prod.json @@ -102,7 +102,7 @@ "label": "${resources.jobs.sample_job.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", @@ -155,7 +155,7 @@ "label": "${resources.pipelines.my_default_python_etl.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "object_id": "", diff --git a/acceptance/bundle/templates/default-python/serverless/output.txt b/acceptance/bundle/templates/default-python/serverless/output.txt index 1a92c10eeeb..6b5732a8de1 100644 --- a/acceptance/bundle/templates/default-python/serverless/output.txt +++ b/acceptance/bundle/templates/default-python/serverless/output.txt @@ -42,11 +42,11 @@ Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged >>> [CLI] bundle plan -t prod Building python_artifact... create jobs.sample_job -create jobs.sample_job.permissions +update jobs.sample_job.permissions create pipelines.my_default_python_etl -create pipelines.my_default_python_etl.permissions +update pipelines.my_default_python_etl.permissions -Plan: 4 to add, 0 to change, 0 to delete, 0 unchanged +Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged Building python_artifact... Building python_artifact... @@ -71,11 +71,11 @@ Building python_artifact... Uploading dist/my_default_python-0.0.1-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/prod/files... Created jobs.sample_job -Created jobs.sample_job.permissions Created pipelines.my_default_python_etl -Created pipelines.my_default_python_etl.permissions +Updated jobs.sample_job.permissions +Updated pipelines.my_default_python_etl.permissions Files: 20 uploaded, 0 deleted -Resources: 4 created, 0 changed, 0 deleted, 0 unchanged +Resources: 2 created, 2 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -t prod Building python_artifact... diff --git a/bundle/direct/apply.go b/bundle/direct/apply.go index 505781c4761..f45e4e9021b 100644 --- a/bundle/direct/apply.go +++ b/bundle/direct/apply.go @@ -79,18 +79,7 @@ func (d *DeploymentUnit) Deploy(ctx context.Context, db *dstate.DeploymentState, // Create creates the resource and records its state. func (d *DeploymentUnit) Create(ctx context.Context, db *dstate.DeploymentState, newState any) error { - var newID string - var remoteState any - _, err := retry.With(ctx, func(ctx context.Context, err error) bool { - // For DoCreate, retry feature is opt-in via retrySafe(err) error wrapper - _, ok := errors.AsType[*dresources.RetrySafeError](err) - return ok && retry.IsTransient(ctx, err) - }, func() (struct{}, error) { - var e error - newID, remoteState, e = d.Adapter.DoCreate(ctx, newState) - return struct{}{}, e - }) - err = dresources.UnwrapRetrySafe(err) + newID, remoteState, err := d.Adapter.DoCreate(ctx, newState) if err != nil { // No need to prefix error, there is no ambiguity (only one operation - DoCreate) and no additional context (like id) return err diff --git a/bundle/direct/bundle_plan_test.go b/bundle/direct/bundle_plan_test.go index 7b27a5e6bca..586ff1805b3 100644 --- a/bundle/direct/bundle_plan_test.go +++ b/bundle/direct/bundle_plan_test.go @@ -547,11 +547,11 @@ func TestLookupReferencePreDeployDelaysNewPermissionsID(t *testing.T) { adapters, err := dresources.InitAll(nil) require.NoError(t, err) const resourceKey = "resources.jobs.job.permissions" + plan := deployplan.NewPlanDirect() + plan.Plan[resourceKey] = &deployplan.PlanEntry{Action: deployplan.Update} b := &DeploymentBundle{ Adapters: adapters, - Plan: &deployplan.Plan{Plan: map[string]*deployplan.PlanEntry{ - resourceKey: {Action: deployplan.Update}, - }}, + Plan: plan, } b.StateDB.OpenWithData("state.json", dstate.NewDatabase("test", 0)) diff --git a/bundle/direct/dresources/retry.go b/bundle/direct/dresources/retry.go deleted file mode 100644 index e7aa77fa956..00000000000 --- a/bundle/direct/dresources/retry.go +++ /dev/null @@ -1,29 +0,0 @@ -package dresources - -import "errors" - -// RetrySafeError wraps an error to signal that the failed DoCreate is safe to retry. -type RetrySafeError struct { - err error -} - -func (e *RetrySafeError) Error() string { return e.err.Error() } -func (e *RetrySafeError) Unwrap() error { return e.err } - -// retrySafe wraps err to mark the operation as safe to retry from DoCreate. -// Use this when the create is idempotent (e.g. a PUT that can be repeated safely). -func retrySafe(err error) error { - if err == nil { - return nil - } - return &RetrySafeError{err: err} -} - -// UnwrapRetrySafe removes the retrySafe wrapper, returning the underlying error. -// If err is not retrySafe-wrapped, it returns err unchanged. -func UnwrapRetrySafe(err error) error { - if safe, ok := errors.AsType[*RetrySafeError](err); ok { - return safe.err - } - return err -} From d5c0d2c4b2dff206c7ffd6f98ad18c248d33e860 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 20:07:13 +0000 Subject: [PATCH 3/7] Link optional create changelog to PR 7510 --- .nextchanges/bundles/optional-create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nextchanges/bundles/optional-create.md b/.nextchanges/bundles/optional-create.md index 60497e77ca4..e2eac6b3d27 100644 --- a/.nextchanges/bundles/optional-create.md +++ b/.nextchanges/bundles/optional-create.md @@ -1 +1 @@ -* Report grants and permissions as updates when their parent resources are first deployed. +* Report grants and permissions as updates when their parent resources are first deployed. ([#7510](https://github.com/databricks/cli/pull/7510)) From db35bcbaccaa56edc01a0c0ed69e1f25e47e39c8 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 20:12:18 +0000 Subject: [PATCH 4/7] Exercise optional create validation through NewAdapter --- bundle/direct/dresources/adapter.go | 2 +- bundle/direct/dresources/adapter_test.go | 60 ++++++++++++++++++------ 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/bundle/direct/dresources/adapter.go b/bundle/direct/dresources/adapter.go index a6640edd42b..0941eef1cc5 100644 --- a/bundle/direct/dresources/adapter.go +++ b/bundle/direct/dresources/adapter.go @@ -136,9 +136,9 @@ type Adapter struct { prepareState *calladapt.BoundCaller remapState *calladapt.BoundCaller doRefresh *calladapt.BoundCaller - doCreate *calladapt.BoundCaller // Optional: + doCreate *calladapt.BoundCaller doDelete *calladapt.BoundCaller prepareInputConfig *calladapt.BoundCaller isEmptyState *calladapt.BoundCaller diff --git a/bundle/direct/dresources/adapter_test.go b/bundle/direct/dresources/adapter_test.go index 1a30c11e298..55648bf93a8 100644 --- a/bundle/direct/dresources/adapter_test.go +++ b/bundle/direct/dresources/adapter_test.go @@ -1,16 +1,19 @@ -package dresources +package dresources_test import ( + "context" "strings" "testing" + "github.com/databricks/cli/bundle/direct/dresources" + "github.com/databricks/databricks-sdk-go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestResourcesWithoutCreate(t *testing.T) { - for resourceType, resource := range SupportedResources { - adapter, err := NewAdapter(resource, resourceType, nil) + for resourceType, resource := range dresources.SupportedResources { + adapter, err := dresources.NewAdapter(resource, resourceType, nil) require.NoError(t, err) noCreate := strings.HasSuffix(resourceType, ".grants") || strings.HasSuffix(resourceType, ".permissions") assert.Equal(t, !noCreate, adapter.HasDoCreate(), resourceType) @@ -22,17 +25,46 @@ func TestResourcesWithoutCreate(t *testing.T) { } func TestResourcesWithoutCreateRequireIdentityAndUpdate(t *testing.T) { - for _, missing := range []string{"IDFromState", "DoUpdate"} { - t.Run(missing, func(t *testing.T) { - adapter, err := NewAdapter((*ResourceGrants)(nil), "schemas.grants", nil) - require.NoError(t, err) - switch missing { - case "IDFromState": - adapter.idFromState = nil - case "DoUpdate": - adapter.doUpdate = nil - } - assert.EqualError(t, adapter.validate(), "resources without DoCreate require IDFromState and DoUpdate") + for _, tc := range []struct { + missing string + resource any + }{ + {"IDFromState", (*resourceWithoutIdentity)(nil)}, + {"DoUpdate", (*resourceWithoutUpdate)(nil)}, + } { + t.Run(tc.missing, func(t *testing.T) { + _, err := dresources.NewAdapter(tc.resource, "test", nil) + assert.EqualError(t, err, "resources without DoCreate require IDFromState and DoUpdate") }) } } + +type resourceWithoutCreate struct{} + +func (*resourceWithoutCreate) PrepareState(state *dresources.GrantsState) *dresources.GrantsState { + return state +} + +func (*resourceWithoutCreate) DoRead(context.Context, string) (*dresources.GrantsState, error) { + return nil, nil +} + +type resourceWithoutIdentity struct{ resourceWithoutCreate } + +func (*resourceWithoutIdentity) New(*databricks.WorkspaceClient) *resourceWithoutIdentity { + return &resourceWithoutIdentity{} +} + +func (*resourceWithoutIdentity) DoUpdate(context.Context, string, *dresources.GrantsState, *dresources.PlanEntry) (*dresources.GrantsState, error) { + return nil, nil +} + +type resourceWithoutUpdate struct{ resourceWithoutCreate } + +func (*resourceWithoutUpdate) New(*databricks.WorkspaceClient) *resourceWithoutUpdate { + return &resourceWithoutUpdate{} +} + +func (*resourceWithoutUpdate) IDFromState(state *dresources.GrantsState) string { + return state.FullName +} From f4c04c6fe4a10f037fabe761abed5fab3c856860 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 20:26:04 +0000 Subject: [PATCH 5/7] Reject saved creates for resources that only support updates --- .../deploy/update-without-create/output.txt | 13 +++++++++++ .../deploy/update-without-create/script | 9 ++++++++ bundle/direct/bundle_plan.go | 22 ++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/acceptance/bundle/deploy/update-without-create/output.txt b/acceptance/bundle/deploy/update-without-create/output.txt index 77224d80323..60fc5314712 100644 --- a/acceptance/bundle/deploy/update-without-create/output.txt +++ b/acceptance/bundle/deploy/update-without-create/output.txt @@ -12,6 +12,19 @@ Plan: 2 to add, 2 to change, 0 to delete, 0 unchanged >>> print_state.py +=== Reject old create actions before modifying resources +>>> musterr [CLI] bundle deploy --plan legacy-plan.json +Error: cannot create resources.jobs.job.permissions: resource does not support creation; run 'bundle plan' again + + +>>> musterr [CLI] bundle deploy --plan legacy-plan.json +Error: cannot recreate resources.jobs.job.permissions: resource does not support creation; run 'bundle plan' again + + +>>> print_requests.py //jobs //unity-catalog + +>>> print_state.py + === Create the parents and apply their dependent updates >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/update-without-create-[UNIQUE_NAME]/default/files... diff --git a/acceptance/bundle/deploy/update-without-create/script b/acceptance/bundle/deploy/update-without-create/script index 609e184c5da..2428738262d 100644 --- a/acceptance/bundle/deploy/update-without-create/script +++ b/acceptance/bundle/deploy/update-without-create/script @@ -12,6 +12,15 @@ trace $CLI bundle plan -o json > plan.json jq '.plan | with_entries(.value |= {action})' plan.json > out.actions.json trace print_state.py +title "Reject old create actions before modifying resources" +for action in create recreate; do + jq --arg action "$action" '.plan["resources.jobs.job.permissions"].action = $action' plan.json > legacy-plan.json + trace musterr $CLI bundle deploy --plan legacy-plan.json +done +rm legacy-plan.json +trace print_requests.py //jobs //unity-catalog +trace print_state.py + title "Create the parents and apply their dependent updates" trace $CLI bundle deploy $(readplanarg plan.json) replace_ids.py diff --git a/bundle/direct/bundle_plan.go b/bundle/direct/bundle_plan.go index 093e3a2e40b..8fc167987f9 100644 --- a/bundle/direct/bundle_plan.go +++ b/bundle/direct/bundle_plan.go @@ -43,7 +43,7 @@ func (b *DeploymentBundle) init(client *databricks.WorkspaceClient) error { } // ValidatePlanAgainstState rejects a saved plan that no longer matches the state it was built -// against: its features, its lineage and its serial. +// against (features, lineage and serial), or requests creation of a resource that no longer supports it. func ValidatePlanAgainstState(stateDB *dstate.DeploymentState, plan *deployplan.Plan) error { stateDB.AssertOpenedForReadOrWrite() @@ -66,6 +66,26 @@ func ValidatePlanAgainstState(stateDB *dstate.DeploymentState, plan *deployplan. return fmt.Errorf("plan serial %d does not match state serial %d; the state has been modified since the plan was created. Please run 'bundle plan' again", plan.Serial, expected) } + // Older saved plans used create for grants and permissions. Reject them before + // applying any resources now that these types only support updates. + adapters, err := dresources.InitAll(nil) + if err != nil { + return err + } + b := DeploymentBundle{Adapters: adapters} + for _, action := range plan.GetActions() { + if action.ActionType != deployplan.Create && action.ActionType != deployplan.Recreate { + continue + } + adapter, err := b.getAdapterForKey(action.ResourceKey) + if err != nil { + return fmt.Errorf("%s: %w", action.ResourceKey, err) + } + if !adapter.HasDoCreate() { + return fmt.Errorf("cannot %s %s: resource does not support creation; run 'bundle plan' again", action.ActionType, action.ResourceKey) + } + } + return nil } From 1efcc53735351e732e9a07bc260bf5b6dfa0200b Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 20:51:34 +0000 Subject: [PATCH 6/7] Use the cloud service principal in dependent-update coverage --- .../bundle/deploy/update-without-create/databricks.yml.tmpl | 2 +- acceptance/bundle/deploy/update-without-create/output.txt | 6 +++--- acceptance/bundle/deploy/update-without-create/test.toml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl b/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl index 43d2c07cb8b..0060d3c2d07 100644 --- a/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl +++ b/acceptance/bundle/deploy/update-without-create/databricks.yml.tmpl @@ -17,5 +17,5 @@ resources: notebook_task: notebook_path: ./hello.py permissions: - - user_name: ${workspace.current_user.userName} + - service_principal_name: ${workspace.current_user.userName} level: IS_OWNER diff --git a/acceptance/bundle/deploy/update-without-create/output.txt b/acceptance/bundle/deploy/update-without-create/output.txt index 60fc5314712..583964b24c5 100644 --- a/acceptance/bundle/deploy/update-without-create/output.txt +++ b/acceptance/bundle/deploy/update-without-create/output.txt @@ -60,7 +60,7 @@ Resources: 2 created, 2 changed, 0 deleted, 0 unchanged "access_control_list": [ { "permission_level": "IS_OWNER", - "user_name": "[USERNAME]" + "service_principal_name": "[USERNAME]" } ] } @@ -75,7 +75,7 @@ Resources: 2 created, 2 changed, 0 deleted, 0 unchanged "__embed__": [ { "level": "IS_OWNER", - "user_name": "[USERNAME]" + "service_principal_name": "[USERNAME]" } ] }, @@ -139,7 +139,7 @@ Resources: 1 created, 1 changed, 0 deleted, 2 unchanged "access_control_list": [ { "permission_level": "IS_OWNER", - "user_name": "[USERNAME]" + "service_principal_name": "[USERNAME]" } ] } diff --git a/acceptance/bundle/deploy/update-without-create/test.toml b/acceptance/bundle/deploy/update-without-create/test.toml index 0c063522813..8be9ef42682 100644 --- a/acceptance/bundle/deploy/update-without-create/test.toml +++ b/acceptance/bundle/deploy/update-without-create/test.toml @@ -1,4 +1,5 @@ Cloud = true +IsServicePrincipal = true RecordRequests = true EnvMatrix.READPLAN = ["", "1"] Ignore = [".databricks", "databricks.yml", "plan.json"] From 2ad675f9ecf272525275944469f74f2d838f6d91 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 11 Nov 2026 22:21:57 +0000 Subject: [PATCH 7/7] Update feature spec grants expectations after base refresh --- .../bundle/resources/grants/feature_specs/out.plan1.json | 2 +- acceptance/bundle/resources/grants/feature_specs/output.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/resources/grants/feature_specs/out.plan1.json b/acceptance/bundle/resources/grants/feature_specs/out.plan1.json index 67401dddfbb..6f9e9edd70d 100644 --- a/acceptance/bundle/resources/grants/feature_specs/out.plan1.json +++ b/acceptance/bundle/resources/grants/feature_specs/out.plan1.json @@ -31,7 +31,7 @@ "label": "${resources.feature_specs.my_feature_spec.id}" } ], - "action": "create", + "action": "update", "new_state": { "value": { "securable_type": "function", diff --git a/acceptance/bundle/resources/grants/feature_specs/output.txt b/acceptance/bundle/resources/grants/feature_specs/output.txt index 3a9978724f2..04ed4a14708 100644 --- a/acceptance/bundle/resources/grants/feature_specs/output.txt +++ b/acceptance/bundle/resources/grants/feature_specs/output.txt @@ -13,9 +13,9 @@ >>> [CLI] bundle deploy Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-feature-spec-grants-[UNIQUE_NAME]/default/files... Created feature_specs.my_feature_spec -Created feature_specs.my_feature_spec.grants +Updated feature_specs.my_feature_spec.grants Files: 3 uploaded, 0 deleted -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged +Resources: 1 created, 1 changed, 0 deleted, 0 unchanged >>> print_requests.py //permissions