-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[release/8.0] Make src gen for property setters consistent with reflection #92167
Conversation
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsBackport of #91899 to release/8.0 /cc @ericstj @steveharter Customer ImpactTestingRiskIMPORTANT: If this backport is for a servicing release, please verify that:
|
@steveharter can you please fill out the template? @layomia can you please also sign-off this backport? cc @ericstj |
Will review. |
...libraries/Microsoft.Extensions.Configuration.Binder/tests/Common/ConfigurationBinderTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - this scenario is an important one that we know our customers care about (since we had to restore it after a previous regression).
Fix looks low-risk. Most of the churn here is to the baseline txt files that record the output of the generator.
The only test that changed was the one that observed this difference, and new tests have been added.
@artl93 can you please have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M2 Approved.
Backport of #91899 to release/8.0. Fixes
Customer Impact
Aligns source-gen binding of object properties that have no value in input configuration objects with the reflection behavior, that is to set them to their default values. The important aspect of this change is that we call the setters for this property; some users have a dependency on this behavior to define custom behavior when config is missing. A regression from this behavior in .NET 7 had to be fixed in servicing (#80562), and has already been reported in RC-1 (#91380). So we don't think that we can afford the current divergence in the 8.0 release.
Testing
We added tests for the reported scenarios & added more tests further validating the change.
Risk
Low. Contained fix for off-by-default component.