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

Update RDG to use interceptors feature #48555

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- These are what the analyzers are built against. They are overridden in full source build.
It may be possible to generate SBRPs -->
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Analyzers/*2.9.4*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.AnalyzerUtilities/*3.3.0*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.AnalyzerUtilities/*3.3.5*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Common/*3.3.1*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp/*3.3.1*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp.Workspaces/*3.3.1*" />
Expand Down
21 changes: 13 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@
<Sha>7f9ae67f86a5adc1d9bf2f22f4bf3ec05b6d7b68</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="2.0.0-beta-23228-03">
<Uri>https://github.com/dotnet/symreader</Uri>
<Sha>27e584661980ee6d82c419a2a471ae505b7d122e</Sha>
<SourceBuild RepoName="symreader" ManagedOnly="true" />
</Dependency>
<Dependency Name="System.Configuration.ConfigurationManager" Version="8.0.0-preview.6.23309.7">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>37c0371ab3f7651d64a6dfe4c2e8677206fa34ee</Sha>
Expand Down Expand Up @@ -335,22 +340,22 @@
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Not updated automatically -->
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.4.0-4.22520.2">
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.7.0-3.23313.12">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>28075742c870be732a3f20fcfc540a915bc51820</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.4.0-4.22520.2">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" Version="4.7.0-3.23313.12">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>28075742c870be732a3f20fcfc540a915bc51820</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.4.0-4.22520.2">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.7.0-3.23313.12">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>28075742c870be732a3f20fcfc540a915bc51820</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0-4.22520.2">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0-3.23313.12">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>28075742c870be732a3f20fcfc540a915bc51820</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
20 changes: 11 additions & 9 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
<MicrosoftEntityFrameworkCoreVersion>8.0.0-preview.6.23312.10</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>8.0.0-preview.6.23312.10</MicrosoftEntityFrameworkCoreDesignVersion>
<!-- Packages from dotnet/roslyn -->
<MicrosoftCodeAnalysisCommonVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisCommonVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<!-- Packages from NuGet/Nuget.client -->
<!-- If you update these versions, make sure to also update https://github.com/dotnet/aspnetcore/blob/main/eng/SourceBuildPrebuiltBaseline.xml -->
<NuGetPackagingVersion>6.2.2</NuGetPackagingVersion>
Expand All @@ -163,6 +163,8 @@
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23305.2</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
<!-- Packages from dotnet/source-build-reference-packages -->
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23312.2</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
<!-- Packages from dotnet/symreader -->
<MicrosoftSourceBuildIntermediatesymreaderVersion>2.0.0-beta-23228-03</MicrosoftSourceBuildIntermediatesymreaderVersion>
<!-- Packages from dotnet/xdt -->
<MicrosoftWebXdtVersion>7.0.0-preview.22423.2</MicrosoftWebXdtVersion>
</PropertyGroup>
Expand Down Expand Up @@ -239,11 +241,11 @@
<Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<!-- Pin the version of the M.CA dependencies that we utilize with a cutom version property $(MicrosoftCodeAnalysisVersion_LatestVS) to avoid automatically
consuming the newest version of the packages when using the $(MicrosoftCodeAnalysisCSharpVersion) properties in source-build. -->
<MicrosoftCodeAnalysisVersion_LatestVS>4.5.0</MicrosoftCodeAnalysisVersion_LatestVS>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCommonVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.4.0-4.22520.2</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisVersion_LatestVS>4.7.0-3.23313.12</MicrosoftCodeAnalysisVersion_LatestVS>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCommonVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23313.12</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.22531.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
<MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.22531.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Nullable>Enable</Nullable>
<RootNamespace>Microsoft.AspNetCore.Analyzers</RootNamespace>
<SuppressNullableAttributesImport>true</SuppressNullableAttributesImport>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
Expand Down
62 changes: 31 additions & 31 deletions src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -211,7 +211,7 @@
<value>Route handler has multiple parameters with the [FromBody] attribute or a parameter with an [AsParameters] attribute where the parameter type contains multiple members with [FromBody] attributes. Only one parameter can have a [FromBody] attribute.</value>
</data>
<data name="Analyzer_MultipleFromBody_Title" xml:space="preserve">
<value>Route handler has multiple parameters with the [FromBody] attribute.</value>
<value>Route handler has multiple parameters with the [FromBody] attribute</value>
</data>
<data name="Analyzer_DoNotUseModelBindingAttributesOnRouteHandlerParameters_Title" xml:space="preserve">
<value>Do not use model binding attributes with route handlers</value>
Expand Down Expand Up @@ -289,10 +289,10 @@
<value>Complex types referenced by route parameters must be parsable</value>
</data>
<data name="Analyzer_RouteParameterComplexTypeIsNotParsable_Message" xml:space="preserve">
<value>Parameter '{0}' of type {1} should define a bool TryParse(string, IFormatProvider, out {1}) method, or implement IParsable&lt;{1}&gt;.</value>
<value>Parameter '{0}' of type {1} should define a bool TryParse(string, IFormatProvider, out {1}) method, or implement IParsable&lt;{1}&gt;</value>
</data>
<data name="Analyzer_BindAsyncSignatureMustReturnValueTaskOfT_Title" xml:space="preserve">
<value>When implementing BindAsync(...) method, the return type must be ValueTask&lt;T&gt;.</value>
<value>When implementing BindAsync(...) method, the return type must be ValueTask&lt;T&gt;</value>
</data>
<data name="Analyzer_BindAsyncSignatureMustReturnValueTaskOfT_Message" xml:space="preserve">
<value>Parameter '{0}' of type {1} has a BindAsync(...) method, but the return type is not ValueTask&lt;{1}&gt;. Consider implementing IBindableFromHttpContext&lt;{1}&gt; to enforce implementation.</value>
Expand All @@ -310,7 +310,7 @@
<value>Route '{0}' conflicts with another action route. An HTTP request that matches multiple routes results in an ambiguous match error. Fix the conflict by changing the route's pattern, HTTP method, or route constraints.</value>
</data>
<data name="Analyzer_UseAddAuthorizationBuilder_Message" xml:space="preserve">
<value>Use AddAuthorizationBuilder to register authorization services and construct policies.</value>
<value>Use AddAuthorizationBuilder to register authorization services and construct policies</value>
</data>
<data name="Analyzer_UseAddAuthorizationBuilder_Title" xml:space="preserve">
<value>Use AddAuthorizationBuilder</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RootNamespace>Microsoft.AspNetCore.Analyzers</RootNamespace>
<!-- Disable analyzer warnings for analyzers in test project. -->
<NoWarn>$(NoWarn);RS1036;RS2008</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/Http/Http.Extensions/gen/GeneratorSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
internal class GeneratorSteps
{
internal const string EndpointModelStep = nameof(EndpointModelStep);
internal const string EndpointsWithoutDiagnosicsStep = nameof(EndpointsWithoutDiagnosicsStep);
internal const string EndpointsWithoutDiagnosticsStep = nameof(EndpointsWithoutDiagnosticsStep);
internal const string EndpointsInterceptorsStep = nameof(EndpointsInterceptorsStep);
internal const string EndpointsHelperMethodsStep = nameof(EndpointsHelperMethodsStep);
internal const string EndpointsHelperTypesStep = nameof(EndpointsHelperTypesStep);
}
Loading