Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

thomas11
Copy link
Contributor

@thomas11 thomas11 commented Jan 8, 2025

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

Copy link

github-actions bot commented Jan 8, 2025

Does the PR have any schema changes?

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

Copy link

codecov bot commented Jan 8, 2025

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.

Copy link
Member

@danielrbradley danielrbradley left a comment

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
Copy link
Contributor Author

thomas11 commented Jan 8, 2025

@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
Member

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

@thomas11 thomas11 merged commit 3145291 into master Jan 8, 2025
24 checks passed
@thomas11 thomas11 deleted the tkappler/v3-skip-flattening-2 branch January 8, 2025 15:01
@pulumi-bot
Copy link
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