Repository navigation
acc: show that direct engine ignores suspend_timeout_duration updates - #6375
Merged
Merged
Conversation
Changing suspend_timeout_duration from 300s to 600s plans "0 to change" under the direct engine and the endpoint keeps its old value, while terraform applies the update. structdiff compares duration.Duration field by field and that type holds a single unexported protobuf pointer, so any two values look equal to it. Co-authored-by: Isaac
Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 7dccc1a
Top 3 slowest tests (at least 2 minutes):
|
pietern
approved these changes
Aug 25, 2026
alex-khakhlyuk
pushed a commit
to alex-khakhlyuk/cli
that referenced
this pull request
Aug 28, 2026
`duration.Duration` and `common/types/time.Time` keep their payload in an unexported protobuf pointer, so structdiff saw any two values as equal and `suspend_timeout_duration: 300s -> 600s` planned 0 to change. Such structs are now recognized by shape — no fields for the walk to see, plus a `json.Marshaler` of their own — and compared through their JSON form, so there is no type list to maintain. `isEmptyStruct` had the same blind spot, hence two goldens now showing `spec:input_only`. Four resources have such fields in their config, and every field a user can set now has a test: - `secrets.expire_time` and `postgres_projects.history_retention_duration` apply cleanly — the first updates with `update_mask=*`, the second is masked under its own name. - `postgres_branches.source_branch_time` is immutable, so a change recreates the branch and never touches update_mask. Before this fix it was invisible and the branch silently kept its old fork point. - `postgres_endpoints.suspend_timeout_duration`, `postgres_branches.ttl`, `postgres_branches.expire_time` and `postgres_projects.default_endpoint_settings.suspend_timeout_duration` are members of a oneof: the plan is right, but applying it fails because the direct engine masks the field under its own name while the API only accepts the group name (`spec.suspension`, `spec.expiration`). That is a separate bug; the tests record the failure for the follow-up fix. The testserver now validates update_mask against the paths the real API accepts, so those failures reproduce locally rather than only on cloud, and it no longer drops `expire_time` on branch create/update or the two duration fields on project update — it was reporting changes that never took effect. Test added in databricks#6375.
janniklasrose
pushed a commit
that referenced
this pull request
Sep 15, 2026
…#6375) ## Changes Acceptance test that demonstrates an existing bug: editing a duration field is silently dropped by the direct engine. Changing `suspend_timeout_duration` from `300s` to `600s` on a postgres endpoint plans `0 to change` and leaves the endpoint at `300s`. Terraform plans `1 to change` and applies it. Cause: `structdiff` compares `duration.Duration` field by field, and that type holds a single unexported protobuf pointer, so any two values look equal to it. Same for `types/time.Time`. Only `nil` <-> set transitions are detected. The goldens encode the current (wrong) direct behaviour, so the fix will show up as a diff on `out.plan.direct.txt` / `out.endpoint.direct.txt`. Prior art: #4480 implemented this fix but went stale and was auto-closed. ## Tests New acceptance test. This pull request and its description were written by Isaac.
janniklasrose
pushed a commit
that referenced
this pull request
Sep 15, 2026
`duration.Duration` and `common/types/time.Time` keep their payload in an unexported protobuf pointer, so structdiff saw any two values as equal and `suspend_timeout_duration: 300s -> 600s` planned 0 to change. Such structs are now recognized by shape — no fields for the walk to see, plus a `json.Marshaler` of their own — and compared through their JSON form, so there is no type list to maintain. `isEmptyStruct` had the same blind spot, hence two goldens now showing `spec:input_only`. Four resources have such fields in their config, and every field a user can set now has a test: - `secrets.expire_time` and `postgres_projects.history_retention_duration` apply cleanly — the first updates with `update_mask=*`, the second is masked under its own name. - `postgres_branches.source_branch_time` is immutable, so a change recreates the branch and never touches update_mask. Before this fix it was invisible and the branch silently kept its old fork point. - `postgres_endpoints.suspend_timeout_duration`, `postgres_branches.ttl`, `postgres_branches.expire_time` and `postgres_projects.default_endpoint_settings.suspend_timeout_duration` are members of a oneof: the plan is right, but applying it fails because the direct engine masks the field under its own name while the API only accepts the group name (`spec.suspension`, `spec.expiration`). That is a separate bug; the tests record the failure for the follow-up fix. The testserver now validates update_mask against the paths the real API accepts, so those failures reproduce locally rather than only on cloud, and it no longer drops `expire_time` on branch create/update or the two duration fields on project update — it was reporting changes that never took effect. Test added in #6375.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Acceptance test that demonstrates an existing bug: editing a duration field is silently dropped by the direct engine.
Changing
suspend_timeout_durationfrom300sto600son a postgres endpoint plans0 to changeand leaves the endpoint at300s. Terraform plans1 to changeand applies it.Cause:
structdiffcomparesduration.Durationfield by field, and that type holds a single unexported protobuf pointer, so any two values look equal to it. Same fortypes/time.Time. Onlynil<-> set transitions are detected.The goldens encode the current (wrong) direct behaviour, so the fix will show up as a diff on
out.plan.direct.txt/out.endpoint.direct.txt.Prior art: #4480 implemented this fix but went stale and was auto-closed.
Tests
New acceptance test.
This pull request and its description were written by Isaac.