-
Notifications
You must be signed in to change notification settings - Fork 27
CHORE: Publish Symbols Pipeline #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bewithgaurav
wants to merge
21
commits into
main
Choose a base branch
from
bewithgaurav/publish_symbols
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
56518ec
build pipeline publishing pdb as artifacts
bewithgaurav 00a2e00
added a job to publish in dummy release pipeline
bewithgaurav 8e80e7d
fixed pdb dir
bewithgaurav 0637928
fixed pdb ext
bewithgaurav e2a1037
fixed parameters and made them into env
bewithgaurav 632f13b
fixed input azureSubscription
bewithgaurav 080af4f
fixed input azureSubscription as mssql-python
bewithgaurav 06caf7e
fixed input azureSubscription as mssql-python-service
bewithgaurav 1e7b296
fix download pipeline artifact
bewithgaurav 026f9a8
rename SymbolsArtifactName
bewithgaurav c6372d1
changed symbolsArtifactName
bewithgaurav e219f61
Merge branch 'main' into bewithgaurav/publish_symbols
bewithgaurav 640bf3a
code changes from review
bewithgaurav dab82e8
add symbol generation and copy step in dummy release
bewithgaurav 3d68d94
syntax
bewithgaurav b987d0d
use onebranch temp
bewithgaurav bfab7cf
use onebranch temp
bewithgaurav 115b262
use onebranch temp
bewithgaurav 864a7ff
use onebranch template - change pool to windows
bewithgaurav 4faedbc
use onebranch template - remove globalSdl
bewithgaurav 2d0265f
Merge branch 'main' into bewithgaurav/publish_symbols
bewithgaurav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,153 @@ | ||
| name: mssql-python-official-release-pipeline | ||
| name: mssql-python-dummy-release-pipeline | ||
|
|
||
| variables: | ||
| - group: 'ESRP Federated Creds (AME)' | ||
|
|
||
| jobs: | ||
| - job: ReleaseESRPPackage | ||
| displayName: 'Release ESRP Package' | ||
| - job: PublishSymbols | ||
| # Use the latest Windows image for building | ||
| pool: | ||
| vmImage: 'windows-latest' | ||
|
|
||
| displayName: 'Publish Symbols - Windows' | ||
| # Strategy matrix to build all combinations | ||
|
|
||
| steps: | ||
| - task: DownloadPipelineArtifact@2 | ||
| inputs: | ||
| buildType: 'specific' | ||
| project: '$(System.TeamProject)' | ||
| definition: 2162 | ||
| buildVersionToDownload: 'latest' | ||
| branchName: '$(Build.SourceBranch)' | ||
| artifactName: 'mssql-python-wheels-dist' | ||
| targetPath: '$(Build.SourcesDirectory)\dist' | ||
| displayName: 'Download release wheel files artifact from latest successful run on main branch' | ||
|
|
||
| # Show content of the downloaded artifact | ||
| - script: | | ||
| echo "Contents of the dist directory:" | ||
| dir "$(Build.SourcesDirectory)\dist" | ||
| displayName: 'List contents of dist directory' | ||
| - task: EsrpRelease@9 | ||
| displayName: 'ESRP Release' | ||
| artifactName: 'mssql-python-symbols' | ||
| targetPath: '$(Build.ArtifactStagingDirectory)\all-pdbs' | ||
| displayName: 'Download PDB files artifact from latest successful run' | ||
|
|
||
| - powershell: 'Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]mssql-python"' | ||
| displayName: 'Update Symbol.AccountName with mssql-python' | ||
|
|
||
| - task: PublishSymbols@2 | ||
| displayName: 'Upload symbols to mssql-python org' | ||
bewithgaurav marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inputs: | ||
| SymbolsFolder: '$(Build.ArtifactStagingDirectory)\all-pdbs' | ||
| SearchPattern: '**/*.pdb' | ||
| IndexSources: false | ||
| SymbolServerType: TeamServices | ||
| SymbolsMaximumWaitTime: 60 | ||
| SymbolExpirationInDays: 1825 # 5 years | ||
| SymbolsProduct: mssql-python | ||
| # Have kept the default version as the build ID, which is unique for each build | ||
| # This will be used to identify the symbols in the symbol server | ||
| SymbolsVersion: $(Build.BuildId) | ||
|
||
| # Ensuring the symbols are uniquely identified | ||
| # MDS uses symbolsArtifactName as mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(NuGetPackageVersion)_$(System.TimelineId) | ||
| SymbolsArtifactName: $(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId) | ||
| Pat: $(System.AccessToken) | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: 'Publish symbols' | ||
| env: | ||
| SymbolServer: '$(SymbolServer)' | ||
| SymbolTokenUri: '$(SymbolTokenUri)' | ||
| requestName: '$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)' | ||
| inputs: | ||
| connectedservicename: '$(ESRPConnectedServiceName)' | ||
| usemanagedidentity: true | ||
| keyvaultname: '$(AuthAKVName)' | ||
| signcertname: '$(AuthSignCertName)' | ||
| clientid: '$(EsrpClientId)' | ||
| Intent: 'PackageDistribution' | ||
| # Changing content type to Maven release (NOT PyPI) since we want to do dummy release | ||
| # for ESRP testing purposes, not for actual PyPI distribution. | ||
| # This is a workaround to allow ESRP to process the release without actual PyPI content | ||
| # and to avoid ESRP validation errors. | ||
| ContentType: 'Maven' | ||
| ContentSource: 'Folder' | ||
| FolderLocation: '$(Build.SourcesDirectory)/dist' | ||
| WaitForReleaseCompletion: true | ||
| Owners: '$(owner)' | ||
| Approvers: '$(approver)' | ||
| ServiceEndpointUrl: 'https://api.esrp.microsoft.com' | ||
| MainPublisher: 'ESRPRELPACMAN' | ||
| DomainTenantId: '$(DomainTenantId)' | ||
| azureSubscription: 'mssql-python-service' | ||
bewithgaurav marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| scriptType: ps | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| # Should be true by default for internal server | ||
| $publishToInternalServer = $true | ||
| $publishToPublicServer = $false | ||
| echo "Publishing request name: $requestName" | ||
| echo "Publish to internal server: $publishToInternalServer" | ||
| echo "Publish to public server: $publishToPublicServer" | ||
| $symbolServer = '$(SymbolServer)' | ||
| $tokenUri = '$(SymbolTokenUri)' | ||
| $projectName = "mssql-python" | ||
| # Get the access token for the symbol publishing service | ||
| $symbolPublishingToken = az account get-access-token --resource $tokenUri --query accessToken -o tsv | ||
| echo "> 1.Symbol publishing token acquired." | ||
| echo "Registering the request name ..." | ||
| $requestName = '$(requestName)' | ||
| $requestNameRegistrationBody = "{'requestName': '$requestName'}" | ||
| Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $requestNameRegistrationBody | ||
| echo "> 2.Registration of request name succeeded." | ||
| echo "Publishing the symbols ..." | ||
| $publishSymbolsBody = "{'publishToInternalServer': $publishToInternalServer, 'publishToPublicServer': $publishToPublicServer}" | ||
| echo "Publishing symbols request body: $publishSymbolsBody" | ||
| Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $publishSymbolsBody | ||
| echo "> 3.Request to publish symbols succeeded." | ||
| # The following REST calls are used to check publishing status. | ||
| echo "> 4.Checking the status of the request ..." | ||
| Invoke-RestMethod -Method GET -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" | ||
| echo "Use below tables to interpret the values of xxxServerStatus and xxxServerResult fields from the response." | ||
| echo "PublishingStatus" | ||
| echo "-----------------" | ||
| echo "0 NotRequested; The request has not been requested to publish." | ||
| echo "1 Submitted; The request is submitted to be published" | ||
| echo "2 Processing; The request is still being processed" | ||
| echo "3 Completed; The request has been completed processing. It can be failed or successful. Check PublishingResult to get more details" | ||
| echo "PublishingResult" | ||
| echo "-----------------" | ||
| echo "0 Pending; The request has not completed or has not been requested." | ||
| echo "1 Succeeded; The request has published successfully" | ||
| echo "2 Failed; The request has failed to publish" | ||
| echo "3 Cancelled; The request was cancelled" | ||
| # - job: ReleaseESRPPackage | ||
| # displayName: 'Release ESRP Package' | ||
| # pool: | ||
| # vmImage: 'windows-latest' | ||
|
|
||
| # steps: | ||
| # - task: DownloadPipelineArtifact@2 | ||
| # inputs: | ||
| # buildType: 'specific' | ||
| # project: '$(System.TeamProject)' | ||
| # definition: 2162 | ||
| # buildVersionToDownload: 'latest' | ||
| # branchName: '$(Build.SourceBranch)' | ||
| # artifactName: 'mssql-python-wheels-dist' | ||
| # targetPath: '$(Build.SourcesDirectory)\dist' | ||
| # displayName: 'Download release wheel files artifact from latest successful run on main branch' | ||
|
|
||
| # # Show content of the downloaded artifact | ||
| # - script: | | ||
| # echo "Contents of the dist directory:" | ||
| # dir "$(Build.SourcesDirectory)\dist" | ||
| # displayName: 'List contents of dist directory' | ||
|
|
||
| # - task: EsrpRelease@9 | ||
| # displayName: 'ESRP Release' | ||
| # inputs: | ||
| # connectedservicename: '$(ESRPConnectedServiceName)' | ||
| # usemanagedidentity: true | ||
| # keyvaultname: '$(AuthAKVName)' | ||
| # signcertname: '$(AuthSignCertName)' | ||
| # clientid: '$(EsrpClientId)' | ||
| # Intent: 'PackageDistribution' | ||
| # # Changing content type to Maven release (NOT PyPI) since we want to do dummy release | ||
| # # for ESRP testing purposes, not for actual PyPI distribution. | ||
| # # This is a workaround to allow ESRP to process the release without actual PyPI content | ||
| # # and to avoid ESRP validation errors. | ||
| # ContentType: 'Maven' | ||
| # ContentSource: 'Folder' | ||
| # FolderLocation: '$(Build.SourcesDirectory)/dist' | ||
| # WaitForReleaseCompletion: true | ||
| # Owners: '$(owner)' | ||
| # Approvers: '$(approver)' | ||
| # ServiceEndpointUrl: 'https://api.esrp.microsoft.com' | ||
| # MainPublisher: 'ESRPRELPACMAN' | ||
| # DomainTenantId: '$(DomainTenantId)' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.