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

[release/8.0] Fix Options Source Gen with Length attributes applied on properties of Interface type #93482

Merged
merged 2 commits into from Oct 13, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 13, 2023

Fixes #93403

Backport of #93426 to release/8.0

/cc @tarekgh

Customer Impact

When Length validation attributes are applied to a property of an interface type, the Options source generator will generate a diagnostic warning during the build, and the generated code will disregard the property validation. This issue represents a regression from a prior change. This problem became evident when building the extensions repro and resulted in test failures in that context.

Details

This corrects a regression stemming from the recent changes made in #93088. The issue arose when searching for the Count property within a type. In cases where the type is an interface, the lookup was failing because ITypeSymbol.GetMembers did not report the members of the extended interfaces. The solution involves conducting the property lookup within all interfaces implemented by the given type.

Testing

The changes have successfully passed all regression tests and have allowed for a successful build of the extensions repository, with all tests running without any issues. I added more regression tests to cover the failure cases.

Risk

The risk associated with these changes is low, as they are focused on addressing a specific failed case and do not significantly alter the existing logic, except for enhancing the lookup within the type interfaces.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 13, 2023
@tarekgh tarekgh added Servicing-consider Issue for next servicing release review area-Extensions-Options source-generator Indicates an issue with a source generator feature and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 13, 2023
@ghost
Copy link

ghost commented Oct 13, 2023

Tagging subscribers to this area: @dotnet/area-extensions-options
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #93426 to release/8.0

/cc @tarekgh

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/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.

Author: github-actions[bot]
Assignees: -
Labels:

Servicing-consider, area-Extensions-Options, source-generator, needs-area-label

Milestone: -

@tarekgh tarekgh added this to the 8.0.0 milestone Oct 13, 2023
@tarekgh tarekgh self-assigned this Oct 13, 2023
@tarekgh
Copy link
Member

tarekgh commented Oct 13, 2023

@artl93 this one is ready for your review.

Copy link
Contributor

@artl93 artl93 left a comment

Choose a reason for hiding this comment

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

M2 Approved.

@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 13, 2023
@carlossanlop
Copy link
Member

Approved by Tactics via email.

@carlossanlop carlossanlop merged commit fb1d8b4 into release/8.0 Oct 13, 2023
109 of 116 checks passed
@carlossanlop carlossanlop deleted the backport/pr-93426-to-release/8.0 branch October 13, 2023 23:31
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Options Servicing-approved Approved for servicing release source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants