C#: Models for Microsoft.Data.SqlClient.#19877
Conversation
eef6daa to
23ee048
Compare
Click to show differences in coveragecsharpGenerated file changes for csharp
- Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2253,152,4
+ Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Data.SqlClient``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2257,159,4
- Totals,,107,14399,400,9
+ Totals,,107,14403,407,9
+ Microsoft.Data.SqlClient,7,,4,,,,,,,,,,7,,,,,,,,,4, |
There was a problem hiding this comment.
Pull Request Overview
Adds support for modeling Microsoft.Data.SqlClient sinks and establishes stubs for related assemblies to enable inline expectation tests.
- Include Microsoft.Data.SqlClient in the stub-generation script.
- Add stub project and code files for various .NET libraries under
csharp/ql/test/resources/stubs. - (Also converted
cs/sql-injectiontests to inline expectations, not shown here.)
Reviewed Changes
Copilot reviewed 64 out of 66 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| csharp/scripts/stubs/make_stubs_all.py | Include "Microsoft.Data.SqlClient" in the list of libraries for stub generation. |
| csharp/ql/test/resources/stubs/System.Threading.Tasks.Extensions/4.5.4/System.Threading.Tasks.Extensions.csproj | Add stub project for System.Threading.Tasks.Extensions 4.5.4. |
| csharp/ql/test/resources/stubs/System.Text.Json/4.7.2/System.Text.Json.csproj | Add stub project for System.Text.Json 4.7.2. |
| csharp/ql/test/resources/stubs/System.Text.Encodings.Web/4.7.2/System.Text.Encodings.Web.csproj | Add stub project for System.Text.Encodings.Web 4.7.2. |
| csharp/ql/test/resources/stubs/System.Security.Cryptography.ProtectedData/9.0.4/System.Security.Cryptography.ProtectedData.csproj | Add stub project for System.Security.Cryptography.ProtectedData 9.0.4. |
| … | … |
fcc247e to
cfadd30
Compare
Why do we then need to (re)model it? |
|
|
DCA looks uneventful. |
In this PR we
Microsoft.Data.SqlClient.[SqlCommand|SqlDataAdapter].Microsoft.Data.SqlClientusing the stub generator.cs/sql-injectionto inline expectations tests.Note that prior to this change
Microsoft.Data.SqlClient.SqlCommandwas identified as a sink since it is declared in type that implements theSystem.Data.IDbCommandinterface. Furthermore,Microsoft.Data.SqlClient.SqlDataAdapterwas not modelled as a sink.