Skip to content

Mask a Lakebase map field as a whole, not per entry - #6441

Open
denik wants to merge 2 commits into
denik/update-mask-leaf-onlyfrom
denik/update-mask-index
Open

Mask a Lakebase map field as a whole, not per entry#6441
denik wants to merge 2 commits into
denik/update-mask-leaf-onlyfrom
denik/update-mask-index

Conversation

@denik

@denik denik commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Stacked on #6440 — review that one first.

A bundle that changes one key of postgres_endpoints.settings.pg_settings cannot deploy:

Unknown field path in update_mask: 'spec.settings.pg_settings['statement_timeout']'

The plan diffs maps entry by entry, so the change path carries the map key and the mask repeated it verbatim. A map or repeated field is addressable only as a whole. Probed against a real endpoint on 2026-08-31: spec.settings and spec.settings.pg_settings are both accepted, the indexed form is not.

So drop everything from the first subscript on, and dedupe — two changed entries of one map collapse onto the same path. Terraform is unaffected; it masks the whole spec.

Two tests, both local and cloud:

  • update_pg_settings — edit a key. Fails without this change.
  • add_settings — add the whole block, which leaves one change path and masks the message itself. That path was missing from the fake's allowed list, so a case the real API accepts was failing locally.

This pull request and its description were written by Isaac.

@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

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

/bundle/ - needs approval

Files: bundle/direct/dresources/util.go
Suggested: @pietern
Also eligible: @janniklasrose, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

General files (require maintainer)

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

  • @pietern -- recent work in libs/testserver/, bundle/direct/dresources/

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 added 2 commits August 31, 2026 16:58
The plan diffs maps entry by entry, so changing one pg_settings key produced the
change path settings.pg_settings['statement_timeout'], and the mask repeated it
verbatim. A map or repeated field is addressable only as a whole: the API answers
the indexed form with "Unknown field path in update_mask" (probed against a real
workspace on 2026-08-31, where spec.settings and spec.settings.pg_settings are both
accepted). Drop everything from the first subscript on, and dedupe, since two changed
entries of one map collapse onto the same path.

update_pg_settings covers the edit. add_settings covers adding the block, which masks
the message itself; that path was missing from the fake's allowed list, so a case the
real API accepts failed locally.

Co-authored-by: Isaac
@denik
denik force-pushed the denik/update-mask-index branch from f9b090d to bcab355 Compare August 31, 2026 14:58
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.

1 participant