diff --git a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.drift.json b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.drift.json index 77467bdb5d0..76de6eaa49d 100644 --- a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.drift.json +++ b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.drift.json @@ -1,25 +1,6 @@ { "action": "update", "changes": { - "autoscaling_limit_max_cu": { - "action": "skip", - "reason": "spec:input_only", - "old": 8, - "new": 8 - }, - "autoscaling_limit_min_cu": { - "action": "skip", - "reason": "spec:input_only", - "old": 0.5, - "new": 0.5 - }, - "endpoint_type": { - "action": "skip", - "reason": "spec:input_only", - "old": "ENDPOINT_TYPE_READ_ONLY", - "new": "ENDPOINT_TYPE_READ_ONLY", - "remote": "" - }, "suspend_timeout_duration": { "action": "update", "old": "300s" diff --git a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.json b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.json index 77467bdb5d0..76de6eaa49d 100644 --- a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.json +++ b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/out.plan.json @@ -1,25 +1,6 @@ { "action": "update", "changes": { - "autoscaling_limit_max_cu": { - "action": "skip", - "reason": "spec:input_only", - "old": 8, - "new": 8 - }, - "autoscaling_limit_min_cu": { - "action": "skip", - "reason": "spec:input_only", - "old": 0.5, - "new": 0.5 - }, - "endpoint_type": { - "action": "skip", - "reason": "spec:input_only", - "old": "ENDPOINT_TYPE_READ_ONLY", - "new": "ENDPOINT_TYPE_READ_ONLY", - "remote": "" - }, "suspend_timeout_duration": { "action": "update", "old": "300s" diff --git a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/script b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/script index ecd4e1c3db9..f3c04e0c3a7 100644 --- a/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/script +++ b/acceptance/bundle/resources/postgres_endpoints/remove_suspend_timeout/script @@ -22,7 +22,9 @@ trace update_file.py databricks.yml " suspend_timeout_duration: 300s" "" # Terraform provider masks the whole spec, which the API accepts and then ignores. See # test.toml. trace $CLI bundle plan -trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_endpoints.my_endpoint" | {action, changes}' > out.plan.json +# Whether GET echoes spec affects unchanged fields and remote metadata, not the +# planned removal. The endpoint reads also assert that its value stays unchanged. +trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_endpoints.my_endpoint" | {action, changes} | del(.changes[] | select(.action == "skip")) | del(.changes[].remote)' > out.plan.json rm -f "$OUT_REQUESTS" errcode $CLI bundle deploy &> out.deploy.txt trace print_requests.py --del-body project_id,branch_id,endpoint_id --sort '//postgres' '^//workspace-files/' '^//workspace/' '^//telemetry-ext' '^//operations/' > out.requests.json @@ -32,4 +34,4 @@ trace print_requests.py --del-body project_id,branch_id,endpoint_id --sort '//po # fail again on every deploy, terraform applied it and is clean. trace $CLI postgres get-endpoint "${endpoint_name}" | endpoint_fields trace $CLI bundle plan &> out.plan.drift.txt -trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_endpoints.my_endpoint" | {action, changes}' > out.plan.drift.json +trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_endpoints.my_endpoint" | {action, changes} | del(.changes[] | select(.action == "skip")) | del(.changes[].remote)' > out.plan.drift.json diff --git a/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/out.plan.json b/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/out.plan.json index 39cc2aef2f3..42c001246fb 100644 --- a/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/out.plan.json +++ b/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/out.plan.json @@ -1,72 +1,11 @@ { - "plan_version": [PLAN_VERSION], - "cli_version": "[CLI_VERSION]", - "lineage": "[UUID][0]", - "serial": 1, - "plan": { - "resources.postgres_projects.my_project": { + "action": "update", + "changes": { + "default_endpoint_settings": { "action": "update", - "new_state": { - "value": { - "default_endpoint_settings": { - "autoscaling_limit_max_cu": 4, - "autoscaling_limit_min_cu": 0.5 - }, - "display_name": "Test Project for Adding Default Endpoint Settings", - "history_retention_duration": "604800s", - "pg_version": 16, - "project_id": "test-pg-proj-[UNIQUE_NAME]" - } - }, - "remote_state": { - "create_time": "[TIMESTAMP]", - "name": "projects/test-pg-proj-[UNIQUE_NAME]", - "project_id": "test-pg-proj-[UNIQUE_NAME]", - "status": { - "branch_logical_size_limit_bytes": [BRANCH_SIZE_LIMIT], - "default_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", - "default_endpoint_settings": { - "autoscaling_limit_max_cu": 1, - "autoscaling_limit_min_cu": 1, - "suspend_timeout_duration": "86400s" - }, - "display_name": "Test Project for Adding Default Endpoint Settings", - "enable_pg_native_login": false, - "history_retention_duration": "604800s", - "owner": "[USERNAME]", - "pg_version": 16, - "project_id": "test-pg-proj-[UNIQUE_NAME]", - "synthetic_storage_size_bytes": 0 - }, - "uid": "[UUID][1]", - "update_time": "[TIMESTAMP]" - }, - "changes": { - "default_endpoint_settings": { - "action": "update", - "new": { - "autoscaling_limit_max_cu": 4, - "autoscaling_limit_min_cu": 0.5 - } - }, - "display_name": { - "action": "skip", - "reason": "spec:input_only", - "old": "Test Project for Adding Default Endpoint Settings", - "new": "Test Project for Adding Default Endpoint Settings" - }, - "history_retention_duration": { - "action": "skip", - "reason": "spec:input_only", - "old": "604800s", - "new": "604800s" - }, - "pg_version": { - "action": "skip", - "reason": "spec:input_only", - "old": 16, - "new": 16 - } + "new": { + "autoscaling_limit_max_cu": 4, + "autoscaling_limit_min_cu": 0.5 } } } diff --git a/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/script b/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/script index 7c442d6aae7..b6f7bd4ad82 100644 --- a/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/script +++ b/acceptance/bundle/resources/postgres_projects/add_default_endpoint_settings/script @@ -14,7 +14,9 @@ trace update_file.py databricks.yml "#TO_ADD: " "" # The direct plan's "changes" map is the structdiff artifact: it records one # change at path default_endpoint_settings (the whole block) instead of descending # to its leaves. (The top-level plan verdict is 'update' on both engines.) -$CLI bundle plan -o json | nostamp > out.plan.json +# Whether GET echoes spec affects unchanged fields and remote metadata, so keep +# the planned updates that this test exercises. +$CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_projects.my_project" | {action, changes} | del(.changes[] | select(.action == "skip")) | del(.changes[].remote)' > out.plan.json # The consequence shows up at deploy time, which diverges by engine, so route it to # per-engine files. Masking the whole message means the API requires the suspension diff --git a/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.drift.json b/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.drift.json index 156a5dd37d3..31c6954b55a 100644 --- a/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.drift.json +++ b/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.drift.json @@ -1,21 +1,9 @@ { "action": "update", "changes": { - "display_name": { - "action": "skip", - "reason": "spec:input_only", - "old": "Test Project for History Retention Update", - "new": "Test Project for History Retention Update" - }, "history_retention_duration": { "action": "update", "old": "604800s" - }, - "pg_version": { - "action": "skip", - "reason": "spec:input_only", - "old": 16, - "new": 16 } } } diff --git a/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.json b/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.json index 156a5dd37d3..31c6954b55a 100644 --- a/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.json +++ b/acceptance/bundle/resources/postgres_projects/remove_history_retention/out.plan.json @@ -1,21 +1,9 @@ { "action": "update", "changes": { - "display_name": { - "action": "skip", - "reason": "spec:input_only", - "old": "Test Project for History Retention Update", - "new": "Test Project for History Retention Update" - }, "history_retention_duration": { "action": "update", "old": "604800s" - }, - "pg_version": { - "action": "skip", - "reason": "spec:input_only", - "old": 16, - "new": 16 } } } diff --git a/acceptance/bundle/resources/postgres_projects/remove_history_retention/script b/acceptance/bundle/resources/postgres_projects/remove_history_retention/script index 99ff406c0c0..fc2876359a7 100644 --- a/acceptance/bundle/resources/postgres_projects/remove_history_retention/script +++ b/acceptance/bundle/resources/postgres_projects/remove_history_retention/script @@ -16,7 +16,9 @@ trace $CLI postgres get-project "${project_name}" | project_fields title "Remove history_retention_duration and re-deploy" trace update_file.py databricks.yml " history_retention_duration: 604800s" "" trace $CLI bundle plan -trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_projects.my_project" | {action, changes}' > out.plan.json +# Whether GET echoes spec affects unchanged fields and remote metadata, not the +# planned removal. The project reads also assert that its value stays unchanged. +trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_projects.my_project" | {action, changes} | del(.changes[] | select(.action == "skip")) | del(.changes[].remote)' > out.plan.json rm -f "$OUT_REQUESTS" errcode $CLI bundle deploy &> out.deploy.txt trace print_requests.py --del-body project_id --sort '//postgres' '^//workspace-files/' '^//workspace/' '^//telemetry-ext' '^//operations/' > out.requests.json @@ -25,4 +27,4 @@ trace print_requests.py --del-body project_id --sort '//postgres' '^//workspace- # record the drift it leaves behind. trace $CLI postgres get-project "${project_name}" | project_fields > out.project.txt trace $CLI bundle plan &> out.plan.drift.txt -trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_projects.my_project" | {action, changes}' > out.plan.drift.json +trace $CLI bundle plan -o json | nostamp | jq '.plan."resources.postgres_projects.my_project" | {action, changes} | del(.changes[] | select(.action == "skip")) | del(.changes[].remote)' > out.plan.drift.json