Skip to content

Commit 9395287

Browse files
committed
Merged PR 6250: FIX: Build Release Pipeline - Removed Symbols Publishing
#### AI description (iteration 1) #### PR Classification This pull request fixes the release pipeline to ensure compliant and streamlined publishing of private symbols while migrating to 1ES for the Python driver. #### PR Summary The changes update the build pipeline to correctly set up and execute symbol publishing tasks fulfilling compliance requirements and build pipeline migration. - In `OneBranchPipelines/steps/symbol-publishing-step.yml`, the PowerShell task setting the AccountName was updated, the symbol upload wait time reduced, and an additional Azure CLI task was added to publish symbols to the Microsoft Symbol Publishing Service. - In `OneBranchPipelines/stages/build-windows-single-stage.yml`, a new Boolean parameter `publishSymbols` was introduced to conditionally trigger the symbol publishing step. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #37472, #38066
1 parent df7b770 commit 9395287

File tree

10 files changed

+42
-3515
lines changed

10 files changed

+42
-3515
lines changed

OneBranchPipelines/build-release-package-pipeline.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ parameters:
4141
- 'Debug'
4242
default: 'Release'
4343

44-
- name: publishSymbols
45-
displayName: 'Publish Debug Symbols'
46-
type: boolean
47-
default: true
48-
4944
- name: runSdlTasks
5045
displayName: 'Run SDL Security Tasks'
5146
type: boolean
@@ -150,10 +145,10 @@ extends:
150145
# ApiScan - Scans APIs for security vulnerabilities
151146
apiscan:
152147
enabled: ${{ parameters.runSdlTasks }}
153-
softwareFolder: '${{ variables.apiScanDllPath }}'
148+
softwareFolder: '$(apiScanDllPath)'
154149
softwareName: 'mssql-python'
155-
softwareVersionNum: '${{ variables.packageVersion }}'
156-
symbolsFolder: '${{ variables.apiScanPdbPath }}'
150+
softwareVersionNum: '$(packageVersion)'
151+
symbolsFolder: '$(apiScanPdbPath)'
157152

158153
# Armory - Security scanning for binaries
159154
armory:

OneBranchPipelines/stages/build-windows-single-stage.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ parameters:
2121
- name: buildConfiguration
2222
type: string
2323
default: 'Release'
24+
- name: publishSymbols
25+
type: boolean
26+
default: true
2427

2528
stages:
2629
- stage: ${{ parameters.stageName }}
@@ -41,6 +44,7 @@ stages:
4144
pythonVersion: ${{ parameters.pythonVersion }}
4245
shortPyVer: ${{ parameters.shortPyVer }}
4346
targetArch: ${{ parameters.architecture }}
47+
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # Make System.AccessToken available to all steps in this job
4448

4549
steps:
4650
- checkout: self
@@ -213,8 +217,5 @@ stages:
213217
# esrpConnectedServiceName: '$(SigningEsrpConnectedServiceName)'
214218
# signPath: '$(ob_outputDirectory)\wheels'
215219

216-
# Publish symbols (Windows only)
217-
- ${{ if eq(parameters.oneBranchType, 'Official') }}:
218-
- template: /OneBranchPipelines/steps/symbol-publishing-step.yml@self
219-
parameters:
220-
SymbolsFolder: '$(ob_outputDirectory)\symbols'
220+
# Note: Symbol publishing moved to release pipeline
221+
# Symbols are published as artifacts here and consumed in release pipeline

OneBranchPipelines/steps/symbol-publishing-step.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,41 @@ parameters:
66
default: '$(ob_outputDirectory)\symbols'
77

88
steps:
9-
- powershell: 'Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]SqlClientDrivers"'
10-
displayName: 'Update Symbol.AccountName with SqlClientDrivers'
9+
# Set AccountName for SqlClientDrivers organization (separate PowerShell task like JDBC)
10+
- task: PowerShell@2
11+
displayName: 'Set Symbol.AccountName to SqlClientDrivers'
12+
inputs:
13+
targetType: inline
14+
# NOTE: we're setting PAT in this step since Pat:$(System.AccessToken) doesn't work in PublishSymbols@2 task directly
15+
# Tried using env: parameter on PublishSymbols@2 but it didn't work
16+
# This is a workaround to set it via script, and setting as a secret variable
17+
script: |
18+
Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]SqlClientDrivers"
19+
Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.Pat;issecret=true;]$env:SYSTEM_ACCESSTOKEN"
20+
# Verify System.AccessToken is available
21+
if (-not $env:SYSTEM_ACCESSTOKEN) {
22+
Write-Error "SYSTEM_ACCESSTOKEN is not available. Ensure 'Allow scripts to access the OAuth token' is enabled in the pipeline settings."
23+
} else {
24+
Write-Host "SYSTEM_ACCESSTOKEN is available and will be used for symbol publishing."
25+
}
26+
env:
27+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
1128

1229
- task: PublishSymbols@2
13-
displayName: 'Upload symbols to Azure DevOps Symbol Server'
30+
displayName: 'Push Symbols to SqlClientDrivers ADO Organization'
1431
inputs:
1532
SymbolsFolder: '${{ parameters.SymbolsFolder }}'
1633
SearchPattern: '**/*.pdb'
1734
IndexSources: false
1835
SymbolServerType: TeamServices
19-
SymbolsMaximumWaitTime: 60
20-
SymbolExpirationInDays: 1825 # 5 years
36+
SymbolsMaximumWaitTime: 10
2137
SymbolsProduct: mssql-python
2238
SymbolsVersion: $(Build.BuildId)
23-
SymbolsArtifactName: $(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)
24-
Pat: $(System.AccessToken)
2539

40+
# Publish to Microsoft Symbol Publishing Service (External)
41+
# This requires additional variable group with SymbolServer, SymbolTokenUri variables
42+
# Project name must be registered with Symbol team via IcM incident
43+
# Reference: https://www.osgwiki.com/wiki/Symbols_Publishing_Pipeline_to_SymWeb_and_MSDL#Step_3:_Project_Setup
2644
- task: AzureCLI@2
2745
displayName: 'Publish symbols to Microsoft Symbol Publishing Service'
2846
condition: succeeded()
@@ -39,12 +57,12 @@ steps:
3957
$publishToInternalServer = $true
4058
$publishToPublicServer = $false
4159
42-
echo "Publishing request name: $(requestName)"
60+
echo "Publishing request name: $env:requestName"
4361
echo "Publish to internal server: $publishToInternalServer"
4462
echo "Publish to public server: $publishToPublicServer"
4563
46-
$symbolServer = '$(SymbolServer)'
47-
$tokenUri = '$(SymbolTokenUri)'
64+
$symbolServer = $env:SymbolServer
65+
$tokenUri = $env:SymbolTokenUri
4866
$projectName = "mssql-python"
4967
5068
# Get the access token for the symbol publishing service
@@ -53,7 +71,7 @@ steps:
5371
echo "> 1.Symbol publishing token acquired."
5472
5573
echo "Registering the request name ..."
56-
$requestName = '$(requestName)'
74+
$requestName = $env:requestName
5775
$requestNameRegistrationBody = "{'requestName': '$requestName'}"
5876
Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $requestNameRegistrationBody
5977

OneBranchPipelines/variables/symbol-variables.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Symbol Publishing Variables
22
# These variables configure where debug symbols (.pdb files) are published
3-
# Note: Symbol server variables (SymbolsAzureSubscription, SymbolsPublishServer, etc.)
4-
# should come from variable groups, not redefined here to avoid cyclical references
53
variables:
64
# Symbol paths for ApiScan
75
# Must use Build.SourcesDirectory (not ob_outputDirectory) so files persist for globalSdl
@@ -12,3 +10,7 @@ variables:
1210
- name: apiScanPdbPath
1311
value: '$(Build.SourcesDirectory)/apiScan/pdbs'
1412

13+
# Symbol server variables come from 'Symbols Publishing' variable group:
14+
# - SymbolServer: Symbol publishing server hostname
15+
# - SymbolTokenUri: Token URI for symbol publishing service authentication
16+

OneBranch_Learnings/00_Quick_Start.md

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

0 commit comments

Comments
 (0)