Skip to content

Commit 5a1ddad

Browse files
Merged PR 5002: Revert "Merged PR 4952: eng | Add support custom sni on CI
Reverting the earlier PR that broke "MDS Main CI - Package" Pipeline. We should revisit the changes and fix the pipeline before attempting to merge again - and it should be done on GitHub instead. ------------- Revert "Merged PR 4952: eng | Add support custom sni on CI Related work items: #30552
1 parent eecd66e commit 5a1ddad

11 files changed

+100
-307
lines changed

eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml

-42
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
# See the LICENSE file in the project root for more information. #
55
#################################################################################
66
parameters:
7-
- name: debug
8-
type: boolean
9-
default: false
10-
117
- name: poolName
128
type: string
139
default: $(ci_var_defaultPoolName)
@@ -28,10 +24,6 @@ parameters:
2824
type: string
2925
default: $(Configuration)
3026

31-
- name: internalSNIVersion
32-
type: string
33-
default: ''
34-
3527
- name: prebuildSteps
3628
type: stepList
3729
default: []
@@ -52,45 +44,11 @@ jobs:
5244
- ${{ if ne(parameters.prebuildSteps, '') }}:
5345
- ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
5446

55-
- ${{ if ne(parameters.internalSNIVersion, '') }}:
56-
- powershell: |
57-
$newVersion = "${{parameters.internalSNIVersion }}"
58-
$rootFolder = Get-location
59-
$filePath = Join-Path $rootFolder "tools\specs\Microsoft.Data.SqlClient.nuspec"
60-
Write-Host $filePath
61-
62-
[Xml] $xml = Get-Content -Path $filePath
63-
$nsm = New-Object Xml.XmlNamespaceManager($xml.NameTable)
64-
$nsm.AddNamespace('ns', $xml.DocumentElement.NamespaceURI)
65-
$dependencies = $xml.SelectNodes("//ns:dependency[@id='Microsoft.Data.SqlClient.SNI' or @id='Microsoft.Data.SqlClient.SNI.runtime']", $nsm)
66-
67-
if ($dependencies.Count -eq 0) {
68-
Write-Error "No matching dependencies found."
69-
}
70-
71-
foreach($dependency in $dependencies){
72-
$dependency.version = $newVersion
73-
}
74-
75-
$xml.Save($filePath)
76-
77-
displayName: 'Update SNI version in nuspec'
78-
79-
- ${{ if parameters.debug }}:
80-
- powershell: |
81-
# Display the content of the Versions.props file
82-
$rootFolder = Get-location
83-
$filePath = Join-Path $rootFolder "tools\specs\Microsoft.Data.SqlClient.nuspec"
84-
Get-Content -Path "$filePath"
85-
displayName: 'Read Microsoft.Data.SqlClient.nuspec [debug]'
86-
8747
- template: ../steps/ci-project-build-step.yml@self
8848
parameters:
89-
debug: ${{ parameters.debug }}
9049
platform: ${{ parameters.platform }}
9150
configuration: ${{ parameters.configuration }}
9251
operatingSystem: Windows
93-
internalSNIVersion: ${{ parameters.internalSNIVersion }}
9452
build: all
9553

9654
- template: ../steps/generate-nuget-package-step.yml@self

eng/pipelines/common/templates/stages/ci-run-tests-stage.yml

+41-49
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ parameters:
1515
type: string
1616
default: ''
1717

18-
- name: internalSNIVersion
19-
type: string
20-
default: ''
21-
2218
- name: buildType
2319
displayName: 'Build Type'
2420
default: Project
@@ -36,69 +32,65 @@ parameters:
3632

3733
stages:
3834
- ${{ each config in parameters.testConfigurations }}:
39-
# If internalSNIVersion is not set or if it is set and the test configuration requires custom SNI
40-
- ${{ if or(eq(parameters.internalSNIVersion, ''), and(ne(parameters.internalSNIVersion, ''), config.value.configProperties.runWithCustomSNI)) }}:
41-
- ${{ each image in config.value.images }}:
42-
- stage: ${{ image.key }}
43-
${{ if ne(parameters.dependsOn, '') }}:
44-
dependsOn: ${{ parameters.dependsOn }}
45-
${{ else }}:
46-
dependsOn: []
47-
jobs:
48-
- ${{ each targetFramework in config.value.TargetFrameworks }}:
49-
- ${{ each platform in config.value.buildPlatforms }}:
50-
- ${{ each testSet in config.value.TestSets }}:
51-
- ${{ if contains(targetFramework, 'net4') }}: # .NET Framework
35+
- ${{ each image in config.value.images }}:
36+
- stage: ${{ image.key }}
37+
${{ if ne(parameters.dependsOn, '') }}:
38+
dependsOn: ${{ parameters.dependsOn }}
39+
${{ else }}:
40+
dependsOn: []
41+
jobs:
42+
- ${{ each targetFramework in config.value.TargetFrameworks }}:
43+
- ${{ each platform in config.value.buildPlatforms }}:
44+
- ${{ each testSet in config.value.TestSets }}:
45+
- ${{ if contains(targetFramework, 'net4') }}: # .NET Framework
46+
- template: ../jobs/ci-run-tests-job.yml@self
47+
parameters:
48+
debug: ${{ parameters.debug }}
49+
buildType: ${{ parameters.buildType }}
50+
poolName: ${{ config.value.pool }}
51+
hostedPool: ${{ eq(config.value.hostedPool, true) }}
52+
image: ${{ image.value }}
53+
jobDisplayName: ${{ format('{0}_{1}_{2}', replace(targetFramework, '.', '_'), platform, testSet) }}
54+
configProperties: ${{ config.value.configProperties }}
55+
prebuildSteps: ${{ parameters.prebuildSteps }}
56+
targetFramework: ${{ targetFramework }}
57+
testSet: ${{ testSet }}
58+
${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
59+
${{ if eq(codeCoveTF, targetFramework) }}:
60+
publishTestResults: true
61+
configSqlFor: ${{ config.value.configSqlFor }}
62+
operatingSystem: ${{ config.value.operatingSystem }}
63+
${{if ne(config.value.configProperties, '{}') }}:
64+
${{ each x86TF in config.value.configProperties.x86TestTargetFrameworks }}:
65+
${{ if eq(x86TF, targetFramework) }}:
66+
enableX86Test: true
67+
- ${{ else }}: # .NET
68+
- ${{ each useManagedSNI in config.value.useManagedSNI }}:
5269
- template: ../jobs/ci-run-tests-job.yml@self
5370
parameters:
5471
debug: ${{ parameters.debug }}
5572
buildType: ${{ parameters.buildType }}
5673
poolName: ${{ config.value.pool }}
5774
hostedPool: ${{ eq(config.value.hostedPool, true) }}
5875
image: ${{ image.value }}
59-
jobDisplayName: ${{ format('{0}_{1}_{2}', replace(targetFramework, '.', '_'), platform, testSet) }}
76+
${{if eq(usemanagedSNI, 'true') }}:
77+
jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'ManagedSNI', testSet) }}
78+
${{ else }}:
79+
jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'NativeSNI', testSet) }}
6080
configProperties: ${{ config.value.configProperties }}
61-
prebuildSteps: ${{ parameters.prebuildSteps }}
81+
useManagedSNI: ${{ useManagedSNI }}
82+
prebuildSteps: ${{ parameters.prebuildSteps }}
6283
targetFramework: ${{ targetFramework }}
6384
testSet: ${{ testSet }}
6485
${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
6586
${{ if eq(codeCoveTF, targetFramework) }}:
6687
publishTestResults: true
6788
configSqlFor: ${{ config.value.configSqlFor }}
6889
operatingSystem: ${{ config.value.operatingSystem }}
69-
${{if ne(config.value.configProperties, '{}') }}:
90+
${{if and(eq(usemanagedSNI, false), ne(config.value.configProperties, '{}')) }}:
7091
${{ each x86TF in config.value.configProperties.x86TestTargetFrameworks }}:
7192
${{ if eq(x86TF, targetFramework) }}:
7293
enableX86Test: true
73-
- ${{ else }}: # .NET
74-
- ${{ each useManagedSNI in config.value.useManagedSNI }}:
75-
# Skips ManagedSNI if the test configuration requires custom SNI
76-
- ${{ if or(eq(parameters.internalSNIVersion, ''), and(ne(parameters.internalSNIVersion, ''), ne(config.value.operatingSystem, 'Windows')), and(ne(parameters.internalSNIVersion, ''), config.value.configProperties.runWithCustomSNI, eq(usemanagedSNI, 'false'))) }}:
77-
- template: ../jobs/ci-run-tests-job.yml@self
78-
parameters:
79-
debug: ${{ parameters.debug }}
80-
buildType: ${{ parameters.buildType }}
81-
poolName: ${{ config.value.pool }}
82-
hostedPool: ${{ eq(config.value.hostedPool, true) }}
83-
image: ${{ image.value }}
84-
${{if eq(usemanagedSNI, 'true') }}:
85-
jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'ManagedSNI', testSet) }}
86-
${{ else }}:
87-
jobDisplayName: ${{ format('{0}_{1}_{2}_{3}', replace(targetFramework, '.', '_'), platform, 'NativeSNI', testSet) }}
88-
configProperties: ${{ config.value.configProperties }}
89-
useManagedSNI: ${{ useManagedSNI }}
90-
prebuildSteps: ${{ parameters.prebuildSteps }}
91-
targetFramework: ${{ targetFramework }}
92-
testSet: ${{ testSet }}
93-
${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
94-
${{ if eq(codeCoveTF, targetFramework) }}:
95-
publishTestResults: true
96-
configSqlFor: ${{ config.value.configSqlFor }}
97-
operatingSystem: ${{ config.value.operatingSystem }}
98-
${{if and(eq(usemanagedSNI, false), ne(config.value.configProperties, '{}')) }}:
99-
${{ each x86TF in config.value.configProperties.x86TestTargetFrameworks }}:
100-
${{ if eq(x86TF, targetFramework) }}:
101-
enableX86Test: true
10294

10395
- ${{ if ne(length(parameters.postTestJobs), 0) }}:
10496
- stage: Post_Test

eng/pipelines/common/templates/steps/add-nuget-feed-step.yml

-58
This file was deleted.

eng/pipelines/common/templates/steps/ci-custom-sni-step.yml

-62
This file was deleted.

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

+1-16
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ parameters:
1111
- name: artifactName
1212
type: string
1313
default: Artifacts
14-
14+
1515
- name: buildType
1616
displayName: 'Build Type'
1717
default: Project
1818
values:
1919
- Project
2020
- Package
2121

22-
- name: internalSNIVersion
23-
type: string
24-
default: ''
25-
2622
steps:
2723
- ${{if eq(parameters.debug, true)}}:
2824
- powershell: |
@@ -38,21 +34,10 @@ steps:
3834
patterns: '**/*.nupkg'
3935
targetPath: $(Pipeline.Workspace)/${{parameters.artifactName }}
4036

41-
# Update config and properties to use internal SNI feed
42-
- ${{ if ne(parameters.internalSNIVersion, '') }}:
43-
- template: ci-custom-sni-step.yml@self
44-
parameters:
45-
debug: ${{ parameters.debug }}
46-
internalSNIVersion: ${{ parameters.internalSNIVersion }}
47-
48-
# Update projects to read from Nuget folder downloaded from the pipeline's artifact
4937
- template: update-nuget-config-local-feed-step.yml@self
5038
parameters:
5139
downloadedNugetPath: $(Pipeline.Workspace)\${{parameters.artifactName }}
5240
debug: ${{ parameters.debug }}
5341

5442
- ${{ else }}: # project
5543
- template: ci-project-build-step.yml@self
56-
parameters:
57-
debug: ${{ parameters.debug }}
58-
internalSNIVersion: ${{ parameters.internalSNIVersion }}

0 commit comments

Comments
 (0)