Skip to content

Commit bf59162

Browse files
authored
Merge branch 'main' into auth-params
2 parents 8adfef4 + cb4f568 commit bf59162

File tree

102 files changed

+3307
-2439
lines changed

Some content is hidden

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

102 files changed

+3307
-2439
lines changed

BUILDGUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Once the environment is setup properly, execute the desired set of commands belo
3030
|`RunTests`|Runs the functional and manual tests for the .NET Framework and .NET drivers|
3131
|`RunFunctionalTests`|Runs just the functional tests for the .NET Framework and .NET drivers|
3232
|`RunManualTests`|Runs just the manual tests for the .NET Framework and .NET drivers|
33+
|`BuildAkv`|Builds the Azure Key Vault Provider package for all supported platforms.|
3334

3435

3536
### Parameters

azurepipelines-coverage.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Azure DevOps code coverage settings:
2+
#
3+
# https://learn.microsoft.com/en-us/azure/devops/pipelines/test/codecoverage-for-pullrequests?view=azure-devops#configuring-coverage-settings
4+
#
5+
coverage:
6+
# Code coverage status will be posted to pull requests based on targets
7+
# defined below.
8+
status:
9+
# Off by default. When on, details about coverage for each file changed will
10+
# be posted as a pull request comment.
11+
comments: on
12+
# Diff coverage is code coverage only for the lines changed in a pull
13+
# request.
14+
diff:
15+
# Set this to a desired %. Default is 70%.
16+
target: 70%

eng/pipelines/common/templates/jobs/build-signed-akv-package-job.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ parameters:
2020
default: MDS
2121
values:
2222
- MDS
23-
- AKV
2423
- MSS
2524

2625
steps:
@@ -49,18 +48,3 @@ steps:
4948
solution: '**/build.proj'
5049
configuration: '${{parameters.Configuration }}'
5150
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAllConfigurations -p:GenerateNuget=false -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'
52-
53-
- ${{ if eq(parameters.product, 'AKV') }}:
54-
- task: MSBuild@1
55-
displayName: 'BuildAKVNetFx using build.proj'
56-
inputs:
57-
solution: '**/build.proj'
58-
configuration: '${{parameters.Configuration }}'
59-
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAKVNetFx -p:NugetPackageVersion=${{parameters.packageRefMdsVersion }} -p:ReferenceType=Package -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'
60-
61-
- task: MSBuild@1
62-
displayName: 'BuildAKVNetCoreAllOS using build.proj'
63-
inputs:
64-
solution: '**/build.proj'
65-
configuration: '${{parameters.Configuration }}'
66-
msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAKVNetCoreAllOS -p:NugetPackageVersion=${{parameters.packageRefMdsVersion }} -p:ReferenceType=Package -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'

eng/pipelines/common/templates/steps/code-analyze-step.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ parameters:
2222
default: MDS
2323
values:
2424
- MDS
25-
- AKV
2625
- MSS
2726

2827
steps:
@@ -35,14 +34,6 @@ steps:
3534
msBuildArchitecture: x64
3635
setupCommandlinePicker: vs2022
3736
msBuildCommandline: 'msbuild ${{parameters.sourceRoot}}\build.proj -p:configuration=Release -p:GenerateNuget=false -p:BuildTools=false -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'
38-
- ${{ if eq(parameters.product, 'AKV') }}:
39-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-roslynanalyzers.RoslynAnalyzers@3
40-
displayName: 'Guardian Dotnet Analyzers '
41-
inputs:
42-
msBuildVersion: 17.0
43-
msBuildArchitecture: x64
44-
setupCommandlinePicker: vs2022
45-
msBuildCommandline: 'msbuild ${{parameters.sourceRoot}}\build.proj -p:configuration=Release -p:GenerateNuget=false -p:BuildTools=false -p:NugetPackageVersion=${{parameters.packageRefMdsVersion }} -p:ReferenceType=Package -t:BuildAKVNetCoreAllOS -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk'
4637

4738
- ${{ if or(eq(parameters.analyzeType, 'inspect'), eq(parameters.analyzeType, 'all')) }}:
4839
- task: securedevelopmentteam.vss-secure-development-tools.build-task-codeinspector.CodeInspector@2

eng/pipelines/common/templates/steps/copy-dlls-for-test-step.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ parameters:
3333
default: MDS
3434
values:
3535
- MDS
36-
- AKV
3736
- MSS
3837

3938
steps:
@@ -80,23 +79,6 @@ steps:
8079
Get-Location
8180
displayName: 'Prepare ${{ targetFramework }} Artifacts for Testing'
8281
83-
- ${{ if eq(parameters.product, 'AKV') }}:
84-
- powershell: |
85-
$software = '${{parameters.softwareFolder}}'
86-
$tf = '${{ targetFramework }}'
87-
md $software\win\$tf
88-
89-
Copy-Item "artifacts\${{parameters.referenceType }}\bin\Windows_NT\${{parameters.Configuration }}.AnyCPU\AzureKeyVaultProvider\$tf\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.dll" "$software\win\$tf" -recurse
90-
91-
$symbols = '${{parameters.symbolsFolder}}'
92-
md $symbols\win\$tf
93-
94-
Copy-Item "artifacts\${{parameters.referenceType }}\bin\Windows_NT\${{parameters.Configuration }}.AnyCPU\AzureKeyVaultProvider\$tf\Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.pdb" "$symbols\win\$tf" -recurse
95-
96-
Write-Host "Artifacts fetched for testing"
97-
Get-Location
98-
displayName: 'Prepare ${{ targetFramework }} Artifacts for Testing'
99-
10082
- powershell: |
10183
$software = '${{parameters.softwareFolder}}'
10284
$symbols = '${{parameters.symbolsFolder}}'
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#################################################################################
2+
# Licensed to the .NET Foundation under one or more agreements. #
3+
# The .NET Foundation licenses this file to you under the MIT license. #
4+
# See the LICENSE file in the project root for more information. #
5+
#################################################################################
6+
7+
parameters:
8+
- name: SNIVersion
9+
type: string
10+
11+
- name: SNIValidationFeed
12+
type: string
13+
14+
steps:
15+
- task: PowerShell@2
16+
displayName: Add SNI Validation Feed in Nuget.config
17+
inputs:
18+
targetType: inline
19+
script: |
20+
Write-Host "SNI validation feed to use = ${{parameters.SNIValidationFeed}}"
21+
22+
# define file to update
23+
$NugetCfg = Join-Path -Path '.' -ChildPath 'NuGet.config'
24+
type $NugetCfg
25+
26+
# load content of xml from file defined above
27+
$xml = New-Object XML
28+
$xml.Load($NugetCfg)
29+
30+
# define namespace used to read a node
31+
$nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable)
32+
$nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI)
33+
34+
# get the package sources node
35+
$packageSources = $xml.SelectSingleNode('//ns:packageSources', $nsm)
36+
37+
# define new package source
38+
$newSource = $xml.CreateElement("add")
39+
$newSource.SetAttribute("key","SNIValidation")
40+
$newSource.SetAttribute("value","${{parameters.SNIValidationFeed}}")
41+
42+
# add the new package source
43+
$packageSources.AppendChild($newSource)
44+
45+
# save the xml file
46+
$xml.Save($NugetCfg)
47+
type $NugetCfg
48+
- task: PowerShell@2
49+
displayName: Update SNI Version in Versions.props
50+
inputs:
51+
targetType: inline
52+
script: |
53+
Write-Host "SNI Version to test = ${{parameters.SNIVersion}}"
54+
55+
# define file to update
56+
$PropsPath = Join-Path -Path '.' -ChildPath 'tools\props\Versions.props'
57+
type $PropsPath
58+
59+
# load content of xml from file defined above
60+
$xml = New-Object XML
61+
$xml.Load($PropsPath)
62+
63+
# define namespace used to read a node
64+
$nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable)
65+
$nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI)
66+
67+
# update the node inner text for netfx
68+
$netFxSniVersion = $xml.SelectSingleNode('//ns:MicrosoftDataSqlClientSniVersion', $nsm)
69+
Write-Host "Current .NET Framework SNI Version = $($netFxSniVersion.InnerText)"
70+
$netFxSniVersion.InnerText = "${{parameters.SNIVersion}}"
71+
72+
# update the node inner text for net core
73+
$netCoreSniVersion = $xml.SelectSingleNode('//ns:MicrosoftDataSqlClientSNIRuntimeVersion', $nsm)
74+
Write-Host "Current .NET Core SNI Version = $($netCoreSniVersion.InnerText)"
75+
$netCoreSniVersion.InnerText = "${{parameters.SNIVersion}}"
76+
77+
# save the xml file
78+
$xml.Save($PropsPath)
79+
type $PropsPath
80+
- task: NuGetAuthenticate@1
81+
displayName: 'NuGet Authenticate with SNI Validation Feed'

eng/pipelines/common/templates/steps/publish-symbols-step.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ parameters:
4545
default: MDS
4646
values:
4747
- MDS
48-
- AKV
4948
- MSS
5049

5150
steps:
@@ -71,24 +70,6 @@ steps:
7170
Pat: $(System.AccessToken)
7271
condition: and(succeeded(), ${{ eq(parameters.publishSymbols, 'true') }})
7372

74-
- ${{ if eq(parameters.product, 'AKV') }}:
75-
- task: PublishSymbols@2
76-
displayName: 'Upload symbols to ${{parameters.SymAccount }} org'
77-
inputs:
78-
SymbolsFolder: '$(Build.SourcesDirectory)\artifacts\${{parameters.referenceType }}\bin'
79-
SearchPattern: |
80-
Windows_NT/$(Configuration).AnyCPU/AzureKeyVaultProvider/**/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.pdb
81-
AnyOS/$(Configuration).AnyCPU/AzureKeyVaultProvider/**/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.pdb
82-
IndexSources: false
83-
SymbolServerType: TeamServices
84-
SymbolsMaximumWaitTime: 60
85-
SymbolExpirationInDays: 1825 # 5 years
86-
SymbolsProduct: Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
87-
SymbolsVersion: ${{parameters.symbolsVersion }}
88-
SymbolsArtifactName: ${{parameters.symbolsArtifactName }}
89-
Pat: $(System.AccessToken)
90-
condition: and(succeeded(), ${{ eq(parameters.publishSymbols, 'true') }})
91-
9273
- task: AzureCLI@2
9374
displayName: 'Publish symbols'
9475
condition: and(succeeded(), ${{ eq(parameters.publishSymbols, 'true') }})

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ parameters:
4141
type: object
4242
default: [false, true]
4343

44+
- name: SNIVersion
45+
displayName: |
46+
SNI Version Override
47+
type: string
48+
default: ''
49+
50+
- name: SNIValidationFeed
51+
displayName: |
52+
SNI Version Override Nuget Feed
53+
type: string
54+
default: https://sqlclientdrivers.pkgs.visualstudio.com/ADO.Net/_packaging/SNIValidation/nuget/v3/index.json
55+
4456
- name: codeCovTargetFrameworks
4557
displayName: 'Code Coverage Target Frameworks'
4658
type: object
@@ -73,6 +85,12 @@ stages:
7385
- template: common/templates/jobs/ci-build-nugets-job.yml@self
7486
parameters:
7587
artifactName: $(artifactName)
88+
${{if ne(parameters.SNIVersion, '')}}:
89+
prebuildSteps:
90+
- template: common/templates/steps/override-sni-version.yml@self
91+
parameters:
92+
SNIVersion: ${{parameters.SNIVersion}}
93+
SNIValidationFeed: ${{parameters.SNIValidationFeed}}
7694

7795
- template: common/templates/stages/ci-run-tests-stage.yml@self
7896
parameters:
@@ -81,12 +99,24 @@ stages:
8199
${{ if eq(parameters.buildType, 'Package') }}:
82100
dependsOn: build_nugets
83101

84-
prebuildSteps: # steps to run prior to building and running tests on each job
85-
- template: common/templates/steps/ci-prebuild-step.yml@self
86-
parameters:
87-
debug: ${{ parameters.debug }}
88-
artifactName: $(artifactName)
89-
buildType: ${{ parameters.buildType }}
102+
${{if ne(parameters.SNIVersion, '')}}:
103+
prebuildSteps: # steps to run prior to building and running tests on each job
104+
- template: common/templates/steps/override-sni-version.yml@self
105+
parameters:
106+
SNIVersion: ${{parameters.SNIVersion}}
107+
SNIValidationFeed: ${{parameters.SNIValidationFeed}}
108+
- template: common/templates/steps/ci-prebuild-step.yml@self
109+
parameters:
110+
debug: ${{ parameters.debug }}
111+
artifactName: $(artifactName)
112+
buildType: ${{ parameters.buildType }}
113+
${{else}}:
114+
prebuildSteps: # steps to run prior to building and running tests on each job
115+
- template: common/templates/steps/ci-prebuild-step.yml@self
116+
parameters:
117+
debug: ${{ parameters.debug }}
118+
artifactName: $(artifactName)
119+
buildType: ${{ parameters.buildType }}
90120

91121
${{ if eq(parameters.buildType, 'Project') }}: # only run the code coverage job if the build type is project
92122
postTestJobs: # jobs to run after the tests are done

eng/pipelines/dotnet-sqlclient-signing-pipeline.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ parameters: # parameters are shown up in ADO UI in a build queue time
4545
type: boolean
4646
default: false
4747

48-
- name: MDS_PackageRef_Version
49-
displayName: 'MDS package version of AKV Provider (build AKV)'
50-
type: string
51-
default: 5.1.5
52-
5348
- name: CurrentNetFxVersion
5449
displayName: 'Lowest supported .NET Framework version (MDS validation)'
5550
type: string
@@ -73,8 +68,6 @@ variables:
7368
value: drop_buildMDS_build_signed_package
7469
- name: PublishSymbols
7570
value: ${{ parameters['publishSymbols'] }}
76-
- name: MDS_PackageRef_Version
77-
value: ${{ parameters['MDS_PackageRef_Version'] }}
7871
- name: CurrentNetFxVersion
7972
value: ${{ parameters['CurrentNetFxVersion'] }}
8073

@@ -130,15 +123,6 @@ extends:
130123
tsaOptionsPath: $(REPOROOT)\.config\tsaoptions.json
131124
disableLegacyManifest: true
132125
stages:
133-
- stage: buildAKV
134-
displayName: 'Build AKV Provider'
135-
jobs:
136-
- template: eng/pipelines/common/templates/jobs/build-signed-akv-package-job.yml@self
137-
parameters:
138-
symbolsFolder: $(symbolsFolder)
139-
softwareFolder: $(softwareFolder)
140-
publishSymbols: ${{ parameters['publishSymbols'] }}
141-
142126
- stage: buildMDS
143127
displayName: 'Build MDS'
144128
jobs:

0 commit comments

Comments
 (0)