Skip to content

Conversation

oroztocil
Copy link
Member

@oroztocil oroztocil commented Sep 19, 2025

Backport of #63687 to release/10.0

[backport fix] Fix Validation source generator deployment for non-Web SDKs

This PR fixes incomplete backport #63715.

Description

I forgot to update that PR with an additional commit that I pushed into the original approved bugfix PR (https://github.com/dotnet/aspnetcore/pull/63687/commits) after code review.

The missing commit lessens the impact of the merged change on other ASP.NET Core analyzers (other than the Validation source generator). In particular, the commit re-enables throwing behavior of certain checks that were put in place to spot packaging problems.

Customer Impact

There is no direct customer impact but the partial change decreases our ability to spot packaging issues early.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

This fix decreases risk of packaging errors going unnoticed.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.3

  • Make necessary changes in eng/PatchConfig.props

@oroztocil oroztocil added this to the 10.0-rc2 milestone Sep 19, 2025
@oroztocil oroztocil added the Servicing-consider Shiproom approval is required for the issue label Sep 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR completes a previously incomplete backport by adding missing changes that restore throwing behavior for well-known type resolution in the Validation source generator. The original backport only partially addressed the issue of making the generator work with non-Web SDKs.

  • Adds GetOptional method to WellKnownTypes for graceful handling of missing types
  • Updates specific type lookups to use GetOptional for ASP.NET Core HTTP types that may be missing in non-Web SDKs
  • Preserves throwing behavior for other type lookups to maintain early detection of packaging issues

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Validation/gen/Parsers/ValidationsGenerator.TypesParser.cs Updates calls to use GetOptional for ASP.NET Core service metadata types
src/Validation/gen/Extensions/ITypeSymbolExtensions.cs Updates exempt type checks to use GetOptional for HTTP-related types
src/Shared/RoslynUtils/WellKnownTypes.cs Adds GetOptional method and restores throwing behavior for Get method

@danmoseley danmoseley added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 19, 2025
@wtgodbe wtgodbe merged commit a999c40 into release/10.0 Sep 19, 2025
28 checks passed
@wtgodbe wtgodbe deleted the oroztocil/validation-sg-fix-backport branch September 19, 2025 20:29
@dotnet-policy-service dotnet-policy-service bot modified the milestone: 10.0-rc2 Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants