-
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] Update binder gen emitted-interceptor nullability to match framework impl #91359
[release/8.0] Update binder gen emitted-interceptor nullability to match framework impl #91359
Conversation
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsBackport of #91180 to release/8.0 Customer ImpactUpdates null input handling by the generated replacement binding methods to align with the reflection-based implementation. This follows the general user expectation of consistency between the two implementations. TestingAutomated null handling tests have been added for all parameters of all binder methods. They assert the same behavior for source-gen and reflection. Some null refs in the reflection binder were fixed as well. This also provides complete build coverage for all binding inputs. RiskLow. It's a contained fix for an off-by-default component. cc @carlossanlop.
|
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.
This is approved for RC2 as it improves the quality of a new .NET 8 feature. I had a couple non-blocking questions in the review.
....Configuration.Binder/gen/Helpers/Emitter/OptionsConfigurationServiceCollectionExtensions.cs
Show resolved
Hide resolved
// ----------------------------------------------------------------------------------------------------------------------------- | ||
// | bindingPoint | bindingPoint | | ||
// Interface | Value | IsReadOnly | Behavior | ||
// ----------------------------------------------------------------------------------------------------------------------------- | ||
// ISet<T> | not null | true/false | Use the Value instance to populate the configuration | ||
// ISet<T> | null | false | Create HashSet<T> instance to populate the configuration | ||
// ISet<T> | null | true | nothing | ||
// IReadOnlySet<T> | null/not null | false | Create HashSet<T> instance, copy over existing values, and populate the configuration | ||
// IReadOnlySet<T> | null/not null | true | nothing | ||
// ----------------------------------------------------------------------------------------------------------------------------- |
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.
These comments with the table of scenarios is really helpful
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.
Yeah the source gen impl followed this closely.
Backport of #91180 to release/8.0
Fixes #90987 for 8.0.
Customer Impact
Updates null input handling by the generated replacement binding methods to align with the reflection-based implementation. This follows the general user expectation of consistency between the two implementations.
Testing
Automated null handling tests have been added for all parameters of all binder methods. They assert the same behavior for source-gen and reflection. Some null refs in the reflection binder were fixed as well. This also provides complete build coverage for all binding inputs.
Risk
Low. It's a contained fix for an off-by-default component.
cc @carlossanlop.