Skip to content
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

Insertion pipelines fix #10966

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions azure-pipelines/vs-insertion-experimental.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
trigger: none
name: $(Date:yyyyMMdd).$(Rev:r) MSBuild Experimental VS Insertion
variables:
InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion)
InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1
InsertDescription: Insert MSBuild $(Build.BuildNumber) from the branch $(Build.SourceBranchName) at commit $(Build.SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion)
InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.Build.Number);Microsoft.Build.UnGAC.vsman
InsertPayloadName: MSBuild $(Build.SourceBranchName) $(Build.BuildNumber)
TeamName: msbuild
TeamEmail: [email protected]
resources:
pipelines:
- pipeline: 'MSBuild'
Expand All @@ -28,25 +20,25 @@ extends:
pool:
name: VSEngSS-MicroBuild2022-1ES
customBuildTags:
- ES365AIMigrationTooling-Release
- Experimental
stages:
- stage: Stage_1
displayName: Create VS PR
variables:
InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion)
InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1
InsertDescription: Insert MSBuild $(resources.pipeline.MSBuild.runName) from the branch $(resources.pipeline.MSBuild.sourceBranch) at commit $(resources.pipeline.MSBuild.sourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion)
InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(resources.pipeline.MSBuild.sourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(resources.pipeline.MSBuild.sourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.UnGAC.vsman
InsertPayloadName: MSBuild $(resources.pipeline.MSBuild.sourceBranch) $(MSBuild_ExtApisPackageVersion)
TeamName: msbuild
TeamEmail: [email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use this email
[email protected]

jobs:
- job: Job_1
displayName: Run on agent
condition: succeeded()
timeoutInMinutes: 0
templateContext:
inputs:
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'BuildLogs_SourceBuild_Managed_Attempt1'
targetPath: '$(Pipeline.Workspace)/BuildLogs_SourceBuild_Managed_Attempt1'
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'build_Windows_NT_SBOM'
targetPath: '$(Pipeline.Workspace)/build_Windows_NT_SBOM'
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'xsd'
Expand All @@ -56,6 +48,14 @@ extends:
artifactName: 'PackageArtifacts'
targetPath: '$(Build.ArtifactStagingDirectory)/PackageArtifacts'
steps:
- task: Powershell@2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add comment here too

name: RemoveSourceBuildPackage
displayName: Remove sourcebuild package
inputs:
targetType: inline
script: |
$folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts"
Get-ChildItem -Path $folder -Filter 'Microsoft.SourceBuild.Intermediate*.nupkg' | Remove-Item -Force
- task: Powershell@2
name: Powershell_1
displayName: Munge ExternalAPIs package version
Expand Down
72 changes: 42 additions & 30 deletions azure-pipelines/vs-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
trigger: none
name: $(Date:yyyyMMdd).$(Rev:r)

resources:
pipelines:
- pipeline: 'MSBuild'
project: 'DevDiv'
source: 'MSBuild'
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

schedules:
- cron: '0 3 * * *' # Runs every day at 3AM UTC
displayName: Daily VS insertion
Expand All @@ -27,6 +38,15 @@ parameters:
- rel/d17.6
- rel/d17.3
- rel/d17.0
- name: DropRetentionDays
default: 183
type: number
displayName: 'Drop Retention Days (do not set to < 90)'
- name: SourceBranchNameParam
default: auto
type: string
displayName: 'Source Branch Name (recommended to use `auto`)'

variables:
# `auto` should work every time and selecting a branch in parameters is likely to fail due to incompatible versions in MSBuild and VS
- name: AutoInsertTargetBranch
Expand Down Expand Up @@ -65,17 +85,16 @@ variables:
value: msbuild
- name: TeamEmail
value: [email protected]
- name: MSBuild_CI_BuildNumber
value: $(resources.pipeline.MSBuild.runName)
- name: MSBuild_CI_SourceVersion
value: $(resources.pipeline.MSBuild.sourceCommit)
- name: SourceBranchName
${{ if not(eq(parameters.SourceBranchNameParam, 'auto')) }}:
value: ${{ parameters.SourceBranchNameParam }}
${{ else }}:
value: $(Build.SourceBranchName)

resources:
pipelines:
- pipeline: 'MSBuild'
project: 'DevDiv'
source: 'MSBuild'
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
Expand Down Expand Up @@ -106,41 +125,26 @@ extends:
name: MicroBuildRetainVstsDrops_2
displayName: Retain VSTS Drops
inputs:
DropNames: Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber)
DropNames: Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber)
AccessToken: $(System.AccessToken)
DropServiceUri: https://devdiv.artifacts.visualstudio.com/DefaultCollection
# retain servicing indefinitely, main only for 183 days
${{ if eq(variables['InsertTargetBranch'], 'main') }}:
DropRetentionDays: 183
DropRetentionDays: ${{ parameters.DropRetentionDays }}
- stage: VSInsertion
displayName: VS insertion
dependsOn: RetainBuild
variables:
InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion)
InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1
InsertDescription: Insert MSBuild $(Build.BuildNumber) from the branch $(Build.SourceBranchName) at commit $(Build.SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion)
InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.UnGAC.vsman
InsertPayloadName: MSBuild $(Build.SourceBranchName) $(Build.BuildNumber)
SymbolsAgentPath: $(Pipeline.Workspace)\$(Build.DefinitionName)\Symbols
SymbolsEmailContacts: raines
SymbolsFeatureName: MSBuild
SymbolsSymwebProject: DDE
SymbolsUncPath: '\\cpvsbuild\drops\MSBuild\symbols\$(Build.DefinitionName)\$(Build.BuildNumber)\symbols.archive'
InsertDescription: Insert MSBuild $(MSBuild_CI_BuildNumber) from the branch $(SourceBranchName) at commit $(MSBuild_CI_SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion)
InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(MSBuild_CI_SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(MSBuild_CI_SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.UnGAC.vsman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to move https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted to a variable and use it for the packages?

InsertPayloadName: MSBuild $(SourceBranchName) $(MSBuild_ExtApisPackageVersion)
jobs:
- job: PushPackages
displayName: Push Packages
condition: succeeded()
timeoutInMinutes: 0
templateContext:
inputs:
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'BuildLogs_SourceBuild_Managed_Attempt1'
targetPath: '$(Pipeline.Workspace)/BuildLogs_SourceBuild_Managed_Attempt1'
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'build_Windows_NT_SBOM'
targetPath: '$(Pipeline.Workspace)/build_Windows_NT_SBOM'
- input: pipelineArtifact
pipeline: 'MSBuild'
artifactName: 'xsd'
Expand All @@ -150,6 +154,14 @@ extends:
artifactName: 'PackageArtifacts'
targetPath: '$(Build.ArtifactStagingDirectory)/PackageArtifacts'
steps:
- task: Powershell@2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add comment why we do that

name: RemoveSourceBuildPackage
displayName: Remove sourcebuild package
inputs:
targetType: inline
script: |
$folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts"
Get-ChildItem -Path $folder -Filter 'Microsoft.SourceBuild.Intermediate*.nupkg' | Remove-Item -Force
- task: Powershell@2
name: PwshMungeExternalAPIsPkgVersion
displayName: Munge ExternalAPIs package version
Expand Down
Loading