Skip to content

[v3] Skip flattening if properties would clash - PR #2#3839

Merged
thomas11 merged 4 commits into
masterfrom
tkappler/v3-skip-flattening-2
Jan 8, 2025
Merged

[v3] Skip flattening if properties would clash - PR #2#3839
thomas11 merged 4 commits into
masterfrom
tkappler/v3-skip-flattening-2

Conversation

@thomas11

@thomas11 thomas11 commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

Skip the flattening of nested properties indicated by x-ms-client-flatten if it would lead to overwriting a property, creating incorrect schema and SDKs. This case happens when inner and outer property have the same name. For a report on all occurrences see #3013.

This change is breaking and could therefore only be applied to v3 of the provider.

The PR is written to be reviewed commit by commit. It supersedes the previous #3801. I recommend hiding whitespace when reviewing since the level of indentation of otherwise unaffected code changed.
Screenshot 2025-01-08 at 13 33 14

Resolves #3195

@github-actions

github-actions Bot commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov

codecov Bot commented Jan 8, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 56.36364% with 24 lines in your changes missing coverage. Please review.

Project coverage is 56.96%. Comparing base (b5b0a21) to head (12227e6).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
provider/pkg/gen/properties.go 56.36% 21 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3839      +/-   ##
==========================================
- Coverage   57.00%   56.96%   -0.04%     
==========================================
  Files          78       78              
  Lines       12035    12062      +27     
==========================================
+ Hits         6860     6871      +11     
- Misses       4675     4691      +16     
  Partials      500      500              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielrbradley danielrbradley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:chefkiss: Let's make sure to not squash!

@thomas11

thomas11 commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

@danielrbradley I forgot in the PR description: I rebuilt everything pretending to be on v3 (editing the boolean condition). Branch tkappler/v3-skip-flattening-2-v3gen contains the result, just for inspection, not to be merged.

@danielrbradley

Copy link
Copy Markdown
Contributor

Cool that looks spot on. (Direct link to commit: 2f823f5)

@thomas11 thomas11 merged commit 3145291 into master Jan 8, 2025
@thomas11 thomas11 deleted the tkappler/v3-skip-flattening-2 branch January 8, 2025 15:01
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.82.0.

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.

Skip flattening if properties would clash

3 participants