Skip to content

Commit 46104b4

Browse files
committed
Merge branch 'main' into dev/russellben/flatten/sqlinternalconnection
2 parents 3b795ae + 9bce6ad commit 46104b4

File tree

120 files changed

+2032
-1548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2032
-1548
lines changed

.config/CredScanSuppressions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
{
1313
"file": "doc/samples/SqlConnectionStringBuilder.cs",
1414
"justification": "Documentation could include sample data and can be ignored"
15+
},
16+
{
17+
"file": "src/Microsoft.Data.SqlClient/tests/UnitTests/Fixtures/AlwaysEncrypted/NativeColumnEncryptionKeyCertificateBaselineFixture.cs",
18+
"justification": "Test projects should be skipped"
19+
},
20+
{
21+
"file": "src/Microsoft.Data.SqlClient/tests/UnitTests/Resources/AlwaysEncrypted/NativeColumnEncryptionKeyBaseline/Certificate.pfx",
22+
"justification": "Test projects should be skipped"
1523
}
1624
]
1725
}

.github/workflows/codeql.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '33 23 * * 6'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: csharp
47+
build-mode: manual
48+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Setup .NET Core SDK
61+
uses: actions/[email protected]
62+
with:
63+
# TODO: Update this to .NET 10 once PR #3686 is complete.
64+
# TODO: Replace this with global-json-file once PR #3797 is complete.
65+
dotnet-version: 9.x
66+
dotnet-quality: ga
67+
#global-json-file: global.json
68+
69+
# Initializes the CodeQL tools for scanning.
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v4
72+
with:
73+
languages: ${{ matrix.language }}
74+
build-mode: ${{ matrix.build-mode }}
75+
# If you wish to specify custom queries, you can do so here or in a config file.
76+
# By default, queries listed here will override any specified in a config file.
77+
# Prefix the list here with "+" to use these queries and those in the config file.
78+
79+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
80+
# queries: security-extended,security-and-quality
81+
82+
# If the analyze step fails for one of the languages you are analyzing with
83+
# "We were unable to automatically build your code", modify the matrix above
84+
# to set the build mode to "manual" for that language. Then modify this step
85+
# to build your code.
86+
# ℹ️ Command-line programs to run using the OS shell.
87+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88+
- name: Run manual build steps
89+
if: matrix.build-mode == 'manual'
90+
shell: bash
91+
run: |
92+
mkdir packages
93+
dotnet build src/
94+
95+
- name: Perform CodeQL Analysis
96+
uses: github/codeql-action/analyze@v4
97+
with:
98+
category: "/language:${{matrix.language}}"

Directory.Packages.props

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<PackageVersion Include="Microsoft.Identity.Client" Version="4.78.0" />
1313
</ItemGroup>
1414
<!-- Published - Target Framework Specific Dependencies -->
15-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
15+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
1616
<!-- MDS and AKV -->
1717
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
1818
</ItemGroup>
19-
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
19+
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
2020
<!-- MDS and AKV -->
2121
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
2222
</ItemGroup>
@@ -31,7 +31,6 @@
3131
<PackageVersion Include="Microsoft.SqlServer.SqlManagementObjects" Version="172.76.0" />
3232
<PackageVersion Include="Microsoft.SqlServer.Types" Version="160.1000.6" />
3333
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
34-
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
3534
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
3635
<PackageVersion Include="System.Data.Odbc" Version="9.0.9" />
3736
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0" />
@@ -42,11 +41,11 @@
4241
<PackageVersion Include="xunit.runner.console" Version="2.9.3" />
4342
</ItemGroup>
4443
<!-- Internal - Target Framework Specific Dependencies -->
45-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
44+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
4645
<!-- MDS and AKV Tests -->
4746
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
4847
</ItemGroup>
49-
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
48+
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
5049
<!-- MDS and AKV Tests -->
5150
<!--
5251
We can't use a newer major version of this package because it pulls in
@@ -62,20 +61,17 @@
6261
<PackageVersion Include="Azure.Identity" Version="1.16.0" />
6362
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.14.0" />
6463
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.14.0" />
65-
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
6664
</ItemGroup>
6765
<!-- Common Target Framework Specific Dependencies -->
68-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
66+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
6967
<PackageVersion Include="Microsoft.Bcl.Cryptography" Version="9.0.9" />
7068
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.9" />
7169
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.9" />
72-
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
7370
</ItemGroup>
74-
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
71+
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
7572
<PackageVersion Include="Microsoft.Bcl.Cryptography" Version="8.0.0" />
7673
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
7774
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
78-
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
7975
</ItemGroup>
8076
<!-- .NET Dependencies -->
8177
<ItemGroup>
@@ -86,10 +82,10 @@
8682
<ItemGroup>
8783
<PackageVersion Include="Microsoft.Data.SqlClient.SNI" Version="6.0.2" />
8884
<PackageVersion Include="System.Buffers" Version="4.6.1" />
89-
<PackageVersion Include="System.Data.Common" Version="4.3.0" />
9085
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
9186
<PackageVersion Include="System.Memory" Version="4.6.3" />
92-
<PackageVersion Include="System.Text.Encodings.Web" Version="8.0.0" />
87+
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
88+
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
9389
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
9490
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
9591
</ItemGroup>
@@ -101,4 +97,4 @@
10197
<!-- =================================================================== -->
10298
<!-- MSS Dependencies -->
10399
<!-- None -->
104-
</Project>
100+
</Project>

build.proj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@
153153
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT;" RemoveProperties="TargetsWindows;TargetsUnix;" Condition="'$(IsEnabledWindows)' == 'true'" />
154154
<MSBuild Projects="@(NetCoreDriver)" Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;" RemoveProperties="TargetsWindows;TargetsUnix;" />
155155
</Target>
156+
157+
<Target Name="BuildNetCoreUnix" DependsOnTargets="RestoreNetCore">
158+
<MSBuild Projects="@(NetCoreDriver)"
159+
Properties="$(CI);$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;"
160+
RemoveProperties="TargetsWindows;TargetsUnix;" />
161+
</Target>
162+
156163
<!-- Build .NET Standard target DLLs for Lib folder from here.
157164
This target enables BuildForLib for the NetCore ref project. -->
158165
<Target Name="BuildNetStandard">

eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ parameters:
3333
# True to upload code coverage results to CodeCov.
3434
- name: upload
3535
type: boolean
36-
default: true
3736

3837
jobs:
3938
- job: CodeCoverage
@@ -63,6 +62,11 @@ jobs:
6362
- template: ../steps/ensure-dotnet-version.yml@self
6463
parameters:
6564
packageType: sdk
65+
version: '10.0'
66+
67+
- template: ../steps/ensure-dotnet-version.yml@self
68+
parameters:
69+
packageType: runtime
6670
version: '9.0'
6771

6872
- pwsh: |

eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ steps:
3232
retryCount: 5
3333

3434
- task: UseDotNet@2
35-
displayName: 'Use .NET 9.x sdk'
35+
displayName: 'Use .NET 10.x sdk'
3636
inputs:
3737
packageType: sdk
38+
version: '10.x'
39+
40+
- task: UseDotNet@2
41+
displayName: 'Use .NET 9.x runtime'
42+
inputs:
43+
packageType: runtime
3844
version: '9.x'
3945

4046
- task: UseDotNet@2

eng/pipelines/common/templates/steps/ci-prebuild-step.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ steps:
2929
parameters:
3030
packageType: sdk
3131
usePreview: false
32+
version: 10.0
33+
34+
- template: ensure-dotnet-version.yml
35+
parameters:
36+
packageType: runtime
37+
usePreview: false
3238
version: 9.0
3339

3440
- template: ensure-dotnet-version.yml

eng/pipelines/common/templates/steps/ci-project-build-step.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ steps:
4040
- template: ./ensure-dotnet-version.yml@self
4141
parameters:
4242
packageType: 'sdk'
43+
version: '10.0'
44+
45+
- template: ./ensure-dotnet-version.yml@self
46+
parameters:
47+
packageType: 'runtime'
4348
version: '9.0'
4449

4550
- template: ./ensure-dotnet-version.yml@self

eng/pipelines/common/templates/steps/pre-build-step.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ steps:
77
- template: ./ensure-dotnet-version.yml@self
88
parameters:
99
packageType: 'sdk'
10+
version: '10.0'
11+
usePreview: false
12+
13+
- template: ./ensure-dotnet-version.yml@self
14+
parameters:
15+
packageType: 'runtime'
1016
version: '9.0'
1117

1218
- template: ./ensure-dotnet-version.yml@self

0 commit comments

Comments
 (0)