Repository navigation
Conversation
Bundle tests for removing a field from each postgres resource, plus a raw-API factcheck showing how each Update API clears a field under a field mask and under update_mask=spec. The testserver now matches what the real API did on 2026-11-19 for these requests. Co-authored-by: Isaac <no-reply@databricks.com>
Regression test report ✅Commit: Selected 9 changed tests (limit=20, 0 not selected) 17 tests: regression=0 unreleased=0 coverage=17 failing=0
|
Co-authored-by: Isaac <no-reply@databricks.com>
✅ Integration test reportCommit: 7b21931
Top 2 slowest tests (at least 2 minutes):
|
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Sonnet 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
| func maskApplies(mask string, body map[string]any, path string) bool { | ||
| for entry := range strings.SplitSeq(mask, ",") { | ||
| entry = strings.TrimSpace(entry) | ||
| if entry != path && !strings.HasPrefix(path, entry+".") { |
There was a problem hiding this comment.
[AI Generated] maskApplies never matches * or an empty mask, so an update_mask=* update with is_protected: true leaves branch status unchanged while echoedSpec merges it into spec. Treat * like spec, as maskSetsGroup does?
|
|
||
| // Map fields under spec. One named in update_mask but absent from the body is accepted | ||
| // and keeps the stored map (probed against a real workspace on 2026-11-19). | ||
| var postgresMapMaskPaths = []string{"spec.default_endpoint_settings.pg_settings", "spec.settings.pg_settings"} |
There was a problem hiding this comment.
[AI Generated] No golden sends a masked pg_settings with the map omitted, since both map tests keep one key, so this skip never runs. Can a test remove the last key, or clear_field record that case?
| // observed to change and still return status only): the fields the | ||
| // caller set (a field masked but absent from the body keeps its previous value), | ||
| // caller set (a field masked but absent from the body keeps its previous value, except | ||
| // a repeated field, which is cleared), |
There was a problem hiding this comment.
[AI Generated] nit: Under update_mask=spec an omitted repeated field is kept (clear_field/output.txt:22, via mergeSpecMap), so "except a repeated field, which is cleared" overstates it. Say "a repeated field the mask names"?
Calls that always fail use musterr, calls that succeed run bare, and best-effort cleanup uses `|| true`. Co-authored-by: Isaac <no-reply@databricks.com>
Changes
New bundle tests that remove a field from each postgres resource and record the deploy, the PATCH, the read-back and the following plan: project
custom_tags(shrink, then remove),default_endpoint_settings.pg_settingskey,enable_pg_native_login; endpointsettings.pg_settingskey,disabled; branchis_protected; roleattributes.createdb,membership_roles.New raw-API factcheck
postgres_projects/factcheck/clear_field: for each resource, clears a field by masking it with the field omitted, by maskingspecwith it omitted, and by maskingspecwith the zero value sent.The testserver is updated to match what the real API returned for these requests: a masked repeated field the body omits is cleared, a masked map the body omits is kept,
update_mask=speckeeps an omittedis_protected/disabled/ role attribute, role updates reject a masked scalar with no value, and project/endpoint status reflectcustom_tags,pg_settingsandenable_pg_native_login.Why
To see what changes if postgres resources switch to
update_mask=spec(#7806), we need a baseline of what removals do today on a real workspace. Today: removing a list entry, a whole list or a map key works; removing a bool fails with 400 (is in update_mask but not provided in request), recorded as Badness.The factcheck is meant for the Lakebase team: an omitted scalar cannot be cleared under either mask, and under
specan omitted repeated field is kept for projectcustom_tagsbut cleared for rolemembership_roles.Tests
All new tests were generated against an AWS workspace and pass locally against the testserver.
This pull request and its description were written by Isaac.