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 #48817

Merged
merged 7 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -20,7 +20,7 @@
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp/*3.3.1*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp.Workspaces/*3.3.1*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Workspaces.Common/*3.3.1*" />
<UsagePattern IdentityGlob="System.Composition/*1.0.31*" />
<UsagePattern IdentityGlob="System.Composition/*7.0.0*" />
captainsafia marked this conversation as resolved.
Show resolved Hide resolved
<UsagePattern IdentityGlob="System.Threading.Tasks.Extensions/*4.5.3*" />

<!-- Added to unblock dependency flow, needs review. -->
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>0d04efdab9f26bad07edc881dc7fa088337b8562</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.7.23354.1">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>f8cb3c760030ec9443d0d01d3f3ffd31fb92d9f7</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.23314.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</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.23314.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.4.0-4.22520.2">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.7.0-3.23314.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</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.23314.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>65df6b1065bae316232a6c9907a8be995302fb5e</Sha>
<Sha>1aa759af23d2a29043ea44fcef5bd6823dafa5d0</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 @@ -146,10 +146,10 @@
<MicrosoftEntityFrameworkCoreVersion>8.0.0-preview.7.23354.1</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>8.0.0-preview.7.23354.1</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.23314.3</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23314.3</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.4</NuGetPackagingVersion>
Expand All @@ -165,6 +165,8 @@
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23319.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
<!-- Packages from dotnet/source-build-reference-packages -->
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23326.1</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 @@ -241,11 +243,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.23314.3</MicrosoftCodeAnalysisVersion_LatestVS>
Copy link
Member

Choose a reason for hiding this comment

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

Was this just missed in #49245?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes 😅

The other PR has already flown into the installer without any major issues so this hopefully doesn't cause any headaches....

<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCommonVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.7.0-3.23314.3</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.7.0-3.23314.3</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>
Copy link
Member Author

Choose a reason for hiding this comment

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

This change, and stylistic modifications in the analyzers, are a result of new diagnostics emitted from the updated compiler version.

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Analyzers.RouteEmbeddedLanguage.Infrastructure;
using Microsoft.AspNetCore.Testing;
using Microsoft.CodeAnalysis.Completion;

namespace Microsoft.AspNetCore.Analyzers.RouteEmbeddedLanguage;

[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/49126")]
Copy link
Member Author

Choose a reason for hiding this comment

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

A downstream change in Roslyn makes these tests unreliable. A PR with a fix is out but I am quarantining for now so that we can move forward with this change.

public partial class FrameworkParametersCompletionProviderTests
{
private TestDiagnosticAnalyzerRunner Runner { get; } = new(new RoutePatternAnalyzer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

using System.Text;
using Microsoft.AspNetCore.Analyzers.RouteEmbeddedLanguage.Infrastructure;
using Microsoft.AspNetCore.Testing;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.AspNetCore.Analyzers.RouteEmbeddedLanguage;

[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/49126")]
public partial class RoutePatternCompletionProviderTests
{
private TestDiagnosticAnalyzerRunner Runner { get; } = new(new RoutePatternAnalyzer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Compile Include="$(SharedSourceRoot)RoslynUtils\SyntaxTreeExtensions.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)RoslynUtils\ParsabilityHelper.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)RoslynUtils\CodeWriter.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)RoslynUtils\IncrementalValuesProviderExtensions.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)Diagnostics\AnalyzerDebug.cs" LinkBase="Shared" />
</ItemGroup>

Expand Down
Loading