-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Options source gen support Validation attributes having constructor with array parameters #91934
Conversation
…tor with params Parameter
Tagging subscribers to this area: @dotnet/area-extensions-options Issue DetailsBackport of #91915 to release/8.0 /cc @tarekgh Customer ImpactTestingRiskIMPORTANT: If this backport is for a servicing release, please verify that:
|
@ericstj could you please have a look and approve it if you have no concern with the change? Thanks! |
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.
I agree with the scenario here just had a couple questions.
src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/EmitterTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
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.
Looks good to me and has my support for RC2
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.
LGTM, @artl93 this is ready for your approval.
Otherwise, M2 Approved. |
Backport of #91915 to release/8.0
/cc @tarekgh
Customer Impact
.NET 8.0 introduces the Options Validation Source Generator, the change here addressing a specific scenario involving validation attribute constructors that utilize arrays, including those using the
params
keyword. The cloud native team encountered an issue where the source generator would throw an exception, resulting in the failure to generate any code and disrupting the build process. This fix is crucial to ensure the successful completion of the feature and remove obstacles for source generator users.Testing
It passed all regression tests and I have added more tests to cover the new cases we are fixing.
Risk
Low because we didn't change any handling in the already supported cases. The change here is an addition to cover the new case.
IMPORTANT: If this backport is for a servicing release, please verify that:
The PR target branch is
release/X.0-staging
, notrelease/X.0
.If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.