Skip to content

Commit 7d8c78f

Browse files
Remove OneBranchType parameter and use Official type only (#3913)
1 parent 5332da3 commit 7d8c78f

4 files changed

Lines changed: 284 additions & 23 deletions

File tree

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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+
name: $(Year:YY)$(DayOfYear)$(Rev:.r)
8+
9+
parameters:
10+
- name: buildConfiguration
11+
displayName: 'Build configuration'
12+
type: 'string'
13+
values:
14+
- 'Release'
15+
- 'Debug'
16+
default: 'Release'
17+
18+
- name: publishSymbols
19+
displayName: 'Publish symbols'
20+
type: 'boolean'
21+
default: false
22+
23+
- name: runSdlTasks
24+
displayName: 'Run SDL Tasks'
25+
type: 'boolean'
26+
default: true
27+
28+
variables:
29+
- template: /eng/pipelines/variables/common-variables.yml@self
30+
- template: /eng/pipelines/variables/onebranch-variables.yml@self
31+
- template: /eng/pipelines/variables/esrp-signing-variables.yml@self
32+
- template: /eng/pipelines/variables/akv-official-variables.yml@self
33+
34+
resources:
35+
repositories:
36+
- repository: templates
37+
type: 'git'
38+
name: 'OneBranch.Pipelines/GovernedTemplates'
39+
ref: 'refs/heads/main'
40+
41+
extends:
42+
template: 'v2/OneBranch.NonOfficial.CrossPlat.yml@templates'
43+
44+
parameters:
45+
featureFlags:
46+
WindowsHostVersion:
47+
Version: '2022'
48+
49+
globalSdl:
50+
# See https://aka.ms/obpipelines/sdl
51+
52+
apiscan:
53+
enabled: ${{ parameters.runSdlTasks }}
54+
softwareFolder: '${{ variables.apiScanDllPath }}'
55+
softwareName: 'Microsoft.Data.SqlClient' # Note: This name is registered with ApiScan
56+
softwareVersionNum: '${{ variables.assemblyFileVersion }}'
57+
symbolsFolder: '${{ variables.apiScanPdbPath }}'
58+
59+
armory:
60+
enabled: ${{ parameters.runSdlTasks }}
61+
break: true
62+
63+
asyncSdl:
64+
# If this should be enabled, move supported tools under this item,
65+
# see https://aka.ms/obpipelines/asyncsdl
66+
enabled: false
67+
68+
binskim:
69+
enabled: ${{ parameters.runSdlTasks }}
70+
break: true
71+
72+
codeinspector:
73+
enabled: ${{ parameters.runSdlTasks }}
74+
logLevel: Error
75+
76+
codeql:
77+
enabled: ${{ parameters.runSdlTasks }}
78+
sourceRoot: '$(REPO_ROOT)/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider'
79+
# Note, this can only be done if project doesn't depend on other projects. In
80+
# package reference mode, this is true, but if we ever enable project reference
81+
# builds, this will have to be removed.
82+
83+
credscan:
84+
enabled: ${{ parameters.runSdlTasks }}
85+
suppressionsFile: '$(REPO_ROOT)/.config/CredScanSuppressions.json'
86+
87+
eslint:
88+
enabled: false
89+
90+
policheck:
91+
enabled: ${{ parameters.runSdlTasks }}
92+
break: true
93+
exclusionFile: '$(REPO_ROOT)/.config/PolicheckExclusions.xml'
94+
95+
roslyn:
96+
enabled: ${{ parameters.runSdlTasks }}
97+
break: true
98+
# Requires RoslynAnalyzers task to be added somewhere in the build stage.
99+
100+
publishLogs:
101+
enabled: ${{ parameters.runSdlTasks }}
102+
103+
sbom:
104+
enabled: ${{ parameters.runSdlTasks }}
105+
packageName: 'Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider'
106+
packageVersion: ${{ variables.akvPackageVersion }}
107+
108+
tsa:
109+
# OneBranch publishes all sdl results to TSA. If TSA is disabled all SDL tools will
110+
# be forced into 'break' build mode.
111+
enabled: false
112+
configFile: '$(REPO_ROOT)/.config/tsaoptions.json'
113+
114+
stages:
115+
- stage: BuildAkv
116+
displayName: 'Build AKV'
117+
jobs:
118+
- template: /eng/pipelines/jobs/build-akv-official-job.yml@self
119+
parameters:
120+
akvAssemblyFileVersion: '${{ variables.assemblyFileVersion }}'
121+
akvPackageVersion: '${{ variables.akvPackageVersion }}'
122+
apiScanDllPath: '${{ variables.apiScanDllPath }}'
123+
apiScanPdbPath: '${{ variables.apiScanPdbPath }}'
124+
buildConfiguration: '${{ parameters.buildConfiguration }}'
125+
mdsPackageVersion: '${{ variables.mdsPackageVersion }}'
126+
publishSymbols: '${{ parameters.publishSymbols }}'
127+
signingAppRegistrationClientId: '$(SigningAppRegistrationClientId)'
128+
signingAppRegistrationTenantId: '$(SigningAppRegistrationTenantId)'
129+
signingAuthAkvName: '$(SigningAuthAkvName)'
130+
signingAuthSignCertName: '$(SigningAuthSignCertName)'
131+
signingEsrpClientId: '$(SigningEsrpClientId)'
132+
signingEsrpConnectedServiceName: '$(SigningEsrpConnectedServiceName)'
133+
symbolsAzureSubscription: '$(SymbolsAzureSubscription)'
134+
symbolsPublishProjectName: '$(SymbolsPublishProjectName)'
135+
symbolsPublishServer: '$(SymbolsPublishServer)'
136+
symbolsPublishTokenUri: '$(SymbolsPublishTokenUri)'
137+
symbolsUploadAccount: '$(SymbolsUploadAccount)'

eng/pipelines/akv-official-pipeline.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ name: $(Year:YY)$(DayOfYear)$(Rev:.r)
99
# @TODO: Add triggers and schedules
1010

1111
parameters:
12-
- name: oneBranchType
13-
displayName: 'OneBranch template'
14-
type: 'string'
15-
values:
16-
- 'Official'
17-
- 'NonOfficial'
18-
default: 'Official'
19-
2012
- name: buildConfiguration
2113
displayName: 'Build configuration'
2214
type: 'string'
@@ -49,7 +41,7 @@ resources:
4941
ref: 'refs/heads/main'
5042

5143
extends:
52-
template: /v2/OneBranch.${{ parameters.oneBranchType }}.CrossPlat.yml@templates
44+
template: 'v2/OneBranch.Official.CrossPlat.yml@templates'
5345

5446
parameters:
5547
featureFlags:
@@ -118,7 +110,7 @@ extends:
118110
tsa:
119111
# OneBranch publishes all sdl results to TSA. If TSA is disabled all SDL tools will
120112
# be forced into 'break' build mode.
121-
enabled: ${{ eq(parameters.oneBranchType, 'Official') }}
113+
enabled: true
122114
configFile: '$(REPO_ROOT)/.config/tsaoptions.json'
123115

124116
stages:
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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+
name: $(Year:YY)$(DayOfYear)$(Rev:.r)
8+
trigger:
9+
branches:
10+
include:
11+
12+
# This pipeline is intended to only run against the ADO.Net dotnet-sqlclient
13+
# repo.
14+
- internal/main
15+
paths:
16+
include:
17+
- .azuredevops
18+
- .config
19+
- doc
20+
- eng/pipelines
21+
- src
22+
- tools
23+
- azurepipelines-coverage.yml
24+
- build.proj
25+
- NuGet.config
26+
27+
parameters: # parameters are shown up in ADO UI in a build queue time
28+
- name: 'debug'
29+
displayName: 'Enable debug output'
30+
type: boolean
31+
default: false
32+
33+
- name: publishSymbols
34+
displayName: 'Publish symbols'
35+
type: boolean
36+
default: false
37+
38+
- name: CurrentNetFxVersion
39+
displayName: 'Lowest supported .NET Framework version (MDS validation)'
40+
type: string
41+
default: 'net462'
42+
43+
- name: isPreview
44+
displayName: 'Is this a preview build?'
45+
type: boolean
46+
default: false
47+
48+
# The timeout, in minutes, for each test job.
49+
- name: testJobTimeout
50+
displayName: 'Test job timeout (in minutes)'
51+
type: number
52+
default: 60
53+
54+
variables:
55+
- template: /eng/pipelines/libraries/variables.yml@self
56+
- name: mdsArtifactName
57+
value: drop_buildMDS_build_signed_package
58+
- name: PublishSymbols
59+
value: ${{ parameters['publishSymbols'] }}
60+
- name: CurrentNetFxVersion
61+
value: ${{ parameters['CurrentNetFxVersion'] }}
62+
63+
resources:
64+
repositories:
65+
- repository: templates
66+
type: git
67+
name: OneBranch.Pipelines/GovernedTemplates
68+
ref: refs/heads/main
69+
70+
extends:
71+
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
72+
parameters:
73+
featureFlags:
74+
# Suggested by MerlinBot (https://sqlclientdrivers.visualstudio.com/ADO.Net/_git/dotnet-sqlclient/pullrequest/4882)
75+
EnableCDPxPAT: false
76+
WindowsHostVersion: 1ESWindows2022
77+
globalSdl: # https://aka.ms/obpipelines/sdl
78+
tsa:
79+
# The OneBranch template will set 'break' to false for the other SDL
80+
# tools when TSA is enabled. This allows TSA to gather the results
81+
# and publish them for downstream analysis.
82+
enabled: false
83+
apiscan:
84+
enabled: true
85+
softwareFolder: $(softwareFolder)
86+
symbolsFolder: $(symbolsFolder)
87+
softwarename: Microsoft.Data.SqlClient
88+
versionNumber: $(mdsAssemblyFileVersion)
89+
codeql:
90+
compiled:
91+
enabled: ${{ not(parameters['isPreview']) }}
92+
sbom:
93+
enabled: ${{ not(parameters['isPreview']) }}
94+
packageName: Microsoft.Data.SqlClient
95+
packageVersion: $(mdsPackageVersion)
96+
policheck:
97+
enabled: ${{ not(parameters['isPreview']) }}
98+
break: true # always break the build on policheck issues. You can disable it by setting to 'false'
99+
exclusionsFile: $(REPOROOT)\.config\PolicheckExclusions.xml
100+
asyncSdl:
101+
enabled: false
102+
credscan:
103+
enabled: ${{ not(parameters['isPreview']) }}
104+
suppressionsFile: $(REPOROOT)/.config/CredScanSuppressions.json
105+
binskim:
106+
enabled: ${{ not(parameters['isPreview']) }}
107+
armory:
108+
enabled: ${{ not(parameters['isPreview']) }}
109+
break: true
110+
eslint: # TypeScript and JavaScript
111+
enabled: false
112+
roslyn:
113+
enabled: ${{ not(parameters['isPreview']) }}
114+
break: true
115+
publishLogs:
116+
enabled: ${{ not(parameters['isPreview']) }}
117+
tsaOptionsPath: $(REPOROOT)\.config\tsaoptions.json
118+
disableLegacyManifest: true
119+
stages:
120+
- stage: buildMDS
121+
displayName: 'Build MDS'
122+
jobs:
123+
- template: /eng/pipelines/common/templates/jobs/build-signed-package-job.yml@self
124+
parameters:
125+
symbolsFolder: $(symbolsFolder)
126+
softwareFolder: $(softwareFolder)
127+
publishSymbols: ${{ parameters['publishSymbols'] }}
128+
isPreview: ${{ parameters['isPreview'] }}
129+
130+
- stage: mds_package_validation
131+
displayName: 'MDS Package Validation'
132+
dependsOn: buildMDS
133+
jobs:
134+
- template: /eng/pipelines/common/templates/jobs/validate-signed-package-job.yml@self
135+
parameters:
136+
artifactName: $(mdsArtifactName)
137+
isPreview: ${{ parameters['isPreview'] }}
138+
139+
# Disabling as of 10/15/2025 due to OneBranch apparently disallowing MSBuild tasks in validation stages.
140+
# - template: /eng/pipelines/common/templates/jobs/run-tests-package-reference-job.yml@self
141+
# parameters:
142+
# artifactName: $(mdsArtifactName)
143+
# isPreview: ${{ parameters['isPreview'] }}
144+
# timeout: ${{ parameters.testJobTimeout }}

eng/pipelines/dotnet-sqlclient-signing-pipeline.yml renamed to eng/pipelines/dotnet-sqlclient-official-pipeline.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ parameters: # parameters are shown up in ADO UI in a build queue time
5454
type: string
5555
default: 'net462'
5656

57-
- name: oneBranchType
58-
displayName: 'Select OneBranch template'
59-
default: Official
60-
values:
61-
- NonOfficial
62-
- Official
63-
6457
- name: isPreview
6558
displayName: 'Is this a preview build?'
6659
type: boolean
@@ -89,7 +82,7 @@ resources:
8982
ref: refs/heads/main
9083

9184
extends:
92-
template: /v2/OneBranch.${{parameters.oneBranchType }}.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
85+
template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
9386
parameters:
9487
featureFlags:
9588
# Suggested by MerlinBot (https://sqlclientdrivers.visualstudio.com/ADO.Net/_git/dotnet-sqlclient/pullrequest/4882)
@@ -103,11 +96,6 @@ extends:
10396
enabled: true
10497
apiscan:
10598
enabled: true
106-
# For non-official builds, the OneBranch template seems to set APIScan's
107-
# 'break' to true even when TSA is enabled. We don't want APIScan to
108-
# break non-official builds, so we explicitly set 'break' to false here.
109-
${{ if ne(parameters.oneBranchType, 'Official') }}:
110-
break: false
11199
softwareFolder: $(softwareFolder)
112100
symbolsFolder: $(symbolsFolder)
113101
softwarename: Microsoft.Data.SqlClient

0 commit comments

Comments
 (0)