Mask only leaf paths in postgres update_mask - #6440
Open
denik wants to merge 3 commits into
Open
Conversation
There were two helpers building update_mask from the plan's change paths, one that kept parent paths and one that dropped them, and the postgres resources were split between them. Keep the one that drops parents. Masking a message asks the API to replace it wholesale, and the API then requires every oneof group beneath that message to be populated in the request body. Probed against a real workspace: update_mask=spec.default_endpoint_settings with a body carrying only the autoscaling limits is rejected with "Field 'spec.default_endpoint_settings.suspension' is in update_mask but not provided in request". A bundle only sends the fields it declares, so masking the parent can never be right for us. Co-authored-by: Isaac
Contributor
Approval status: pending
|
Masking a nested message makes the API demand the oneof groups directly beneath it, so a bundle that changes default_endpoint_settings.autoscaling_limit_max_cu without declaring a suspension field could not deploy at all. The fake accepted it, which is why nothing caught this. Teach the fake the rule, in exactly the three shapes probed against a real workspace: masking a nested message requires the groups below it, masking the top-level spec does not, at either depth. The new test fails without the previous commit and passes with it, locally and on cloud. Co-authored-by: Isaac
This was referenced Aug 31, 2026
Co-authored-by: Isaac
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.
A bundle that changes a field nested inside a Lakebase message — say
postgres_projects.default_endpoint_settings.autoscaling_limit_max_cu— cannot deploy at all when it declares no suspension field:There were two helpers building
update_maskfrom the plan's change paths, one that kept parent paths and one that dropped them, and the postgres resources were split between them. The one that keeps parents masksspec.default_endpoint_settingsalongside the leaf, which asks the API to replace that message wholesale — and the API then requires the oneof groups directly beneath it to be populated in the body. A bundle only sends the fields it declares, so masking the parent can never be right for us. Keep the helper that drops parents.postgres_projects/update_default_endpoint_autoscalingcovers it and fails without the first commit, locally and on cloud.The fake accepted the broken request, which is why nothing caught this. It now models the rule in exactly the three shapes probed against a real workspace on 2026-08-31:
spec.default_endpoint_settingsspec(project, group two levels below)spec(endpoint, group one level below)So the rule is neither "every group under the mask" nor "every group one level under it". The fake reproduces only what was measured; widening it needs another probe.
update_default_endpoint_suspendstill fails on the oneof group name — separate fix.This pull request and its description were written by Isaac.