Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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