Skip to content

postgres: mask the fields of a message added to config, not the message - #6374

Draft
denik wants to merge 1 commit into
mainfrom
denik/update-mask-fix
Draft

denik wants to merge 1 commit into
mainfrom
denik/update-mask-fix

Conversation

@denik

@denik denik commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Growing a config with a nested block — adding default_endpoint_settings with just an autoscaling limit — failed the deploy:

400 INVALID_PARAMETER_VALUE
Field 'spec.default_endpoint_settings.suspension' is in update_mask but not provided in request

#6440 masks only leaves when a child of the message changed, but a block added as a whole leaves a single change on the message itself, and that was masked as-is.

Changes

Expand such a change to the fields the request body actually carries. A map, a repeated field and a wrapper like duration.Duration do not expand: the first two are addressable only as a whole, and the last is a struct in Go but a scalar on the wire.

This also changes the mask add_settings asserts, from spec.settings to spec.settings.pg_settings. The message form happens to be accepted for settings because everything under it is optional, but it is rejected for default_endpoint_settings, whose suspension oneof must be populated, and for group, whose max is required. The leaf form works for all three, so it applies uniformly rather than per message.

Tests

New acceptance test postgres_projects/add_default_endpoint_settings, which reproduces the failure and asserts the value the API applied alongside the siblings' backend defaults. Ran the postgres suite against a real AWS workspace.

@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

16 files changed
Suggested: @pietern
Also eligible: @janniklasrose, @shreyas-goenka, @andrewnester, @anton-107, @lennartkats-db

/bundle/ - needs approval

9 files changed
Suggested: @pietern
Also eligible: @janniklasrose, @shreyas-goenka, @andrewnester, @anton-107, @lennartkats-db

General files (require maintainer)

Files: .nextchanges/bundles/postgres-update-mask.md, libs/testserver/postgres.go
Based on git history:

  • @pietern -- recent work in bundle/direct/dresources/, libs/testserver/, acceptance/bundle/resources/postgres_endpoints/update_autoscaling/

Any maintainer (@andrewnester, @anton-107, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@denik
denik marked this pull request as draft August 25, 2026 09:24
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 63267f7

Run: 34403769920

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 281 15 6:26
💚​ aws windows 1 283 13 6:16
💚​ azure linux 1 274 16 8:55
💚​ azure windows 1 276 14 5:11
💚​ gcp linux 1 275 16 6:50
💚​ gcp windows 1 277 14 6:39
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
5:13 gcp windows TestAccept
5:02 aws windows TestAccept
3:50 azure windows TestAccept
2:12 gcp linux TestAccept
2:09 aws linux TestAccept
2:02 azure linux TestAccept

denik added a commit that referenced this pull request Aug 25, 2026
The direct engine now sends the PATCH, and the real API rejects the mask path
it builds: suspend_timeout_duration is a oneof member, so the API only accepts
the group name spec.suspension. Separate bug, separate fix (#6374). The
testserver ignores update_mask, which is why the local run is unaffected.

Co-authored-by: Isaac
denik added a commit that referenced this pull request Aug 25, 2026
The direct engine now sends the PATCH, and the API rejects the mask path it
builds: suspend_timeout_duration is a member of the suspension oneof, so only
the group name spec.suspension is accepted. Separate bug, separate fix (#6374).

Teach the testserver to validate update_mask against the paths the real API
accepts, so the failure reproduces locally rather than only on aws. The engines
diverge from the second deploy on, so those steps go back to per-engine files,
and the deploy requests are recorded per engine: same body, different mask.

Cloud stays enabled, with the golden recording what the real workspace does.

Co-authored-by: Isaac
@denik
denik force-pushed the denik/update-mask-fix branch from aa81513 to e9071cf Compare September 3, 2026 19:36
@denik denik changed the title postgres: fix deploy failing with unknown field path in update_mask postgres: mask the fields of a message added to config, not the message Sep 3, 2026
@denik
denik force-pushed the denik/update-mask-fix branch from 902aedb to 8d8e156 Compare September 7, 2026 13:36
Growing a config with a nested block — adding default_endpoint_settings with
just autoscaling limits — failed the deploy with

    400 INVALID_PARAMETER_VALUE
    Field 'spec.default_endpoint_settings.suspension' is in update_mask
    but not provided in request

#6440 masks only leaves when a child of the message changed, but a block added
as a whole leaves a single change on the message itself, and that was masked
as-is. Expand such a change to the fields the request body carries.

Two things do not expand. A message the body populates completely, because no
requirement the API places on a masked field can then go unmet and replacing
the message is what the config declares — that keeps spec.settings as the mask
for endpoint settings. And a map, a repeated field or a wrapper like
duration.Duration: the first two are addressable only as a whole, the last is a
struct in Go but a scalar on the wire.

The expansion reads the spec the request body carries rather than the plan's own
copy of the new value, because a plan read back from disk carries that copy as
deserialized JSON with the types erased; deploying a saved plan would otherwise
still send the message path and fail. The READPLAN cell of the acceptance test
covers that path.

This turns the postgres_projects/add_default_endpoint_settings case that #6566
recorded as broken into a passing one; its Badness marker is removed.

Co-authored-by: Isaac
@denik
denik force-pushed the denik/update-mask-fix branch from 8d8e156 to 63267f7 Compare September 9, 2026 20:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants