Skip to content

structs: use only a struct's own ForceSendFields in structdiff and structwalk - #7224

Open
denik wants to merge 1 commit into
mainfrom
denik/structs-fsf-declaring
Open

denik wants to merge 1 commit into
mainfrom
denik/structs-fsf-declaring

Conversation

@denik

@denik denik commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

structdiff and structwalk looked up ForceSendFields with FieldByName, which also finds one promoted from an embedded struct, and used it for the outer struct's own fields. That list can only name the embedded struct's fields (the SDK marshaller rejects other names), so it was only ever applied by mistake: to an outer omitempty field that shadows an embedded one. Both now look only at the struct that declares the field, as structaccess and libs/dyn/convert already do.

No current type is affected: the shadowing fields are resources.ClusterPolicy definition / policy_family_definition_overrides, whose embedded list config loading never fills with those names, and QualityMonitor/QualityMonitorState table_name, which is not omitempty.

Next: #7221 moves these field rules into a shared per-type cache.

This pull request and its description were written by Isaac.

…ructwalk

FieldByName also finds a ForceSendFields promoted from an embedded struct.
That list can only name the embedded struct's fields (the SDK marshaller
rejects other names), so it must not decide whether the outer struct's own
fields are forced. structaccess and libs/dyn/convert already look only at the
declaring struct.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 4b3dff0

Run: 40706187931

Env 🔄​flaky ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 281 15 5:44
✅​ aws-windows-latest-4core-16gb 283 13 5:16
✅​ azure linux-2core-8gb 280 15 5:23
🔄​ azure-windows-latest-4core-16gb 1 281 13 9:28
✅​ gcp linux-2core-8gb 281 15 5:33
✅​ gcp-windows-latest-4core-16gb 283 13 5:06
Test Name azure-windows-latest-4core-16gb
🔄​ TestAccept 🔄​f
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:41 gcp-windows-latest-4core-16gb TestAccept
3:54 gcp linux-2core-8gb TestAccept
3:49 azure linux-2core-8gb TestAccept
3:41 aws linux-2core-8gb TestAccept
3:31 azure-windows-latest-4core-16gb TestAccept
3:21 aws-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review October 28, 2026 15:33
@denik
denik requested a review from a team as a code owner October 28, 2026 15:33
@denik
denik requested a review from shreyas-goenka October 28, 2026 15:33
@denik
denik enabled auto-merge October 28, 2026 15:34

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