Skip to content
Draft
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,11 +1,4 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/remove-is-protected-[UNIQUE_NAME]/default/files...
Error: cannot update resources.postgres_branches.main: updating id=projects/test-pg-proj-[UNIQUE_NAME]/branches/main: Field 'spec.is_protected' is in update_mask but not provided in request (400 INVALID_PARAMETER_VALUE)

Endpoint: PATCH [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main?update_mask=spec.is_protected
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Field 'spec.is_protected' is in update_mask but not provided in request

Updated postgres_branches.main
Files: 0 uploaded, 0 deleted

Exit code: 1
Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"action": "update",
"changes": {
"is_protected": {
"action": "update",
"old": true,
"remote": true
}
}
"action": "skip",
"changes": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main",
"q": {
"update_mask": "spec.is_protected"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Verified against a real workspace on 2026-11-19: the direct engine masks spec.is_protected and omits it from
# the body, and the API rejects a masked scalar with no value. The old value stays in state, so
# out.plan.after_remove.json shows the removal pending again and every later deploy fails the same way.
Badness = "Removing is_protected fails: the field is named in update_mask but omitted from the body, which the API rejects"
# Verified against a real workspace on 2026-11-19: the engine masks the whole spec and omits
# is_protected from the body. The API accepts it and keeps the stored value in status, but echoes
# back the spec as sent, so out.plan.after_remove.json shows no drift although out.get.remove.json still
# reports the old value. Before update_mask=spec this deploy failed with 400.
Badness = "Removing is_protected is silently ignored: the deploy succeeds and the plan shows no drift, but the resource keeps the old value"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/dev-branch",
"q": {
"update_mask": "spec.expiration"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[DEV_BRANCH_ID]",
"q": {
"update_mask": "spec.is_protected"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[DEV_BRANCH_ID]",
"q": {
"update_mask": "spec.is_protected"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/dev-branch",
"q": {
"update_mask": "spec.expiration"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[MY_DATABASE_ID]",
"q": {
"update_mask": "spec.postgres_database"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[MY_DATABASE_ID]",
"q": {
"update_mask": "spec.postgres_database"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.settings"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/remove-disabled-[UNIQUE_NAME]/default/files...
Error: cannot update resources.postgres_endpoints.my_endpoint: updating id=projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint: Field 'spec.disabled' is in update_mask but not provided in request (400 INVALID_PARAMETER_VALUE)

Endpoint: PATCH [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint?update_mask=spec.disabled
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Field 'spec.disabled' is in update_mask but not provided in request

Updated postgres_endpoints.my_endpoint
Files: 0 uploaded, 0 deleted

Exit code: 1
Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"action": "update",
"changes": {
"disabled": {
"action": "update",
"old": true,
"remote": true
}
}
"action": "skip",
"changes": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.disabled"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Verified against a real workspace on 2026-11-19: the direct engine masks spec.disabled and omits it from
# the body, and the API rejects a masked scalar with no value. The old value stays in state, so
# out.plan.after_remove.json shows the removal pending again and every later deploy fails the same way.
Badness = "Removing disabled fails: the field is named in update_mask but omitted from the body, which the API rejects"
# Verified against a real workspace on 2026-11-19: the engine masks the whole spec and omits
# disabled from the body. The API accepts it and keeps the stored value in status, but echoes
# back the spec as sent, so out.plan.after_remove.json shows no drift although out.get.remove.json still
# reports the old value. Before update_mask=spec this deploy failed with 400.
Badness = "Removing disabled is silently ignored: the deploy succeeds and the plan shows no drift, but the resource keeps the old value"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.settings.pg_settings"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/remove-postgres-endpoint-suspend-[UNIQUE_NAME]/default/files...
Error: cannot update resources.postgres_endpoints.my_endpoint: updating id=projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint: Field 'spec.suspension' is in update_mask but not provided in request (400 INVALID_PARAMETER_VALUE)

Endpoint: PATCH [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint?update_mask=spec.suspension
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Field 'spec.suspension' is in update_mask but not provided in request

Updated postgres_endpoints.my_endpoint
Files: 0 uploaded, 0 deleted

Exit code: 1
Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"action": "update",
"changes": {
"suspend_timeout_duration": {
"action": "update",
"old": "300s",
"remote": "300s"
}
}
"action": "skip",
"changes": null
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

>>> [CLI] bundle plan
update postgres_endpoints.my_endpoint

Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged
Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.suspension"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
}
}

=== Remove suspend_timeout_duration: neither engine can apply it
=== Remove suspend_timeout_duration

>>> update_file.py databricks.yml suspend_timeout_duration: 300s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ trace $CLI bundle deploy
rm -f "$OUT_REQUESTS"
trace $CLI postgres get-endpoint "${endpoint_name}" | endpoint_fields

title "Remove suspend_timeout_duration: neither engine can apply it"
title "Remove suspend_timeout_duration"
trace update_file.py databricks.yml " suspend_timeout_duration: 300s" ""

# Both engines plan the removal and neither applies it, but they fail differently, so the
# deploy and the drift it leaves stay in per-engine files. The direct engine masks
# spec.suspension with no member of that oneof in the body and the API rejects it; the
# Terraform provider masks the whole spec, which the API accepts and then ignores. See
# The removal is planned and the deploy succeeds, but the API keeps the old value. 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
Expand All @@ -28,8 +25,7 @@ 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

# Read the endpoint back to see whether the removal reached it, then plan again to
# record the drift it leaves behind: direct still has the removal pending and will
# fail again on every deploy, terraform applied it and is clean.
# record the drift it leaves behind.
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# The mask is now correct: suspend_timeout_duration is masked under its oneof group name
# spec.suspension. The removal still cannot be applied, and that is a property of the API
# rather than of the mask: a masked field has to be populated in the request body, so
# dropping it from the bundle leaves nothing to send. Probed against a real workspace on
# 2026-08-31 -- an absent value and an explicit null are both answered with "is in
# update_mask but not provided in request". The only way to stop an endpoint suspending is
# to set the other member of the oneof, no_suspension: true.
Badness = "Removing suspend_timeout_duration cannot be applied: the API requires a masked field to be populated, so the removal fails on every deploy. Setting no_suspension: true instead is the supported way to express it"
# Verified against a real workspace on 2026-11-19: the engine masks the whole spec and omits
# suspend_timeout_duration from the body. The API accepts it and keeps 300s, but echoes back
# the spec as sent, so out.plan.drift.json shows no drift. Before update_mask=spec this
# deploy failed with 400 "Field 'spec.suspension' is in update_mask but not provided in
# request". The supported way to stop an endpoint suspending is to set the other member of
# the oneof, no_suspension: true.
Badness = "Removing suspend_timeout_duration is silently ignored: the deploy succeeds and the plan shows no drift, but the endpoint keeps the old timeout. Setting no_suspension: true instead is the supported way to express it"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[MY_ENDPOINT_ID]",
"q": {
"update_mask": "spec.autoscaling_limit_max_cu"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/[MY_ENDPOINT_ID]",
"q": {
"update_mask": "spec.autoscaling_limit_max_cu"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.settings.pg_settings"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/my-endpoint",
"q": {
"update_mask": "spec.suspension"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
Error: cannot update resources.postgres_projects.my_project: updating id=projects/test-pg-proj-[UNIQUE_NAME]: Field 'spec.default_endpoint_settings.suspension' is in update_mask but not provided in request (400 INVALID_PARAMETER_VALUE)

Endpoint: PATCH [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]?update_mask=spec.default_endpoint_settings
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Field 'spec.default_endpoint_settings.suspension' is in update_mask but not provided in request

Updated postgres_projects.my_project
Files: 0 uploaded, 0 deleted

Exit code: 1
Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ trace update_file.py databricks.yml "#TO_ADD: " ""
# to its leaves. (The top-level plan verdict is 'update' on both engines.)
$CLI bundle plan -o json | plan_filter.py > 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
# oneof in the body (see dresources/util.go), so the direct deploy FAILS with a 400;
# terraform masks the leaf spec.default_endpoint_settings.autoscaling_limit_max_cu
# and succeeds.
# The engine masks the whole spec, so the block-level change does not reach the mask
# and the deploy succeeds.
errcode $CLI bundle deploy > out.deploy.txt 2>&1
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
RecordRequests = false
# Inherits Cloud = true from the parent. On a real workspace this validates that the
# API still rejects a message-level update_mask exactly as the testserver models it
# (libs/testserver/postgres.go, probed 2026-08-31): the direct deploy is expected to
# 400 there (tolerated by errcode), while terraform masks the leaf and succeeds. Runs
# on both engines; the divergent plan/deploy are routed to per-engine files.

Badness = "On the direct engine, adding the whole default_endpoint_settings block produces update_mask=spec.default_endpoint_settings (the enclosing message) instead of the leaf spec.default_endpoint_settings.autoscaling_limit_max_cu, and the deploy FAILS with 400: 'Field spec.default_endpoint_settings.suspension is in update_mask but not provided in request'. Root cause: structdiff records one change at the block level instead of descending to leaves, so collectUpdatePathsWithPrefix masks the message. Terraform masks the leaf and succeeds."
# Inherits Cloud = true from the parent. Adding the whole default_endpoint_settings block
# records one change at the block level. With a field mask this masked the enclosing
# message and the API rejected it with 400 "Field 'spec.default_endpoint_settings.suspension'
# is in update_mask but not provided in request"; the whole-spec mask is accepted (verified
# against a real workspace on 2026-11-19).
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"custom_tags": null
"custom_tags": [
{
"key": "env",
"value": "test"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]",
"q": {
"update_mask": "spec.custom_tags"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]",
"q": {
"update_mask": "spec.custom_tags"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Regression from update_mask=spec, verified against a real workspace on 2026-11-19. With a
# field mask, removing the last tag masks spec.custom_tags with no custom_tags in the body,
# which the API applies by clearing the tags. Under the whole-spec mask the API keeps the
# stored tags when the body omits them, and the SDK cannot send an empty list instead. It
# echoes back the spec as sent, so out.plan.after_remove.json shows no drift although
# out.get.remove.json still has the tag. See factcheck/clear_field.
Badness = "Removing all custom_tags is silently ignored: the deploy succeeds and the plan shows no drift, but the project keeps its tags. This worked before update_mask=spec"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"method": "PATCH",
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]",
"q": {
"update_mask": "spec.default_endpoint_settings.pg_settings"
"update_mask": "spec"
},
"body": {
"spec": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/remove-enable-pg-native-login-[UNIQUE_NAME]/default/files...
Error: cannot update resources.postgres_projects.my_project: updating id=projects/test-pg-proj-[UNIQUE_NAME]: Field 'spec.enable_pg_native_login' is in update_mask but not provided in request (400 INVALID_PARAMETER_VALUE)

Endpoint: PATCH [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]?update_mask=spec.enable_pg_native_login
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Field 'spec.enable_pg_native_login' is in update_mask but not provided in request

Updated postgres_projects.my_project
Files: 0 uploaded, 0 deleted

Exit code: 1
Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
Loading
Loading