Skip to content

Commit

Permalink
disallow package conflicts by default and add override parameter (#11152
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JanProvaznik authored Jan 9, 2025
1 parent 09beddc commit 81c00a4
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions azure-pipelines/vs-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# To achieve insertion automation, this pipeline definition yml has to be on servicing branches and main.


# Runs in 3 modes:
# Runs in 3 modes:
# 1. daily main insertion from latest main CI.
# - can be disabled in the UI by adding a custom schedule for any branch.
# - can be disabled in the UI by adding a custom schedule for any branch.
# 2. trigger insert as a followup to a servicing CI run.
# - can be disabled in the UI by adding a custom CI trigger.
# 3. manual insertion - select manually the TargetBranch and inserted CI run.
Expand Down Expand Up @@ -56,6 +56,10 @@ parameters:
default: 183
type: number
displayName: 'Drop Retention Days (do not set to < 90)'
- name: SkipUploadingPackages
default: false
type: boolean
displayName: 'Skip uploading packages (set to true if inserting the same version multiple times)'

variables:
# `auto` should work every time and selecting a branch in parameters is likely to fail due to incompatible versions in MSBuild and VS
Expand Down Expand Up @@ -95,8 +99,8 @@ variables:
value: $(resources.pipeline.MSBuild.sourceCommit)
- name: ArtifactPackagesPath
value: $(Build.ArtifactStagingDirectory)/PackageArtifacts
- name: MSBuildPackagePattern

- name: MSBuildPackagePattern
value: '$(ArtifactPackagesPath)/Microsoft.Build.*.nupkg'
- name: StringToolsPackagePattern
value: '$(ArtifactPackagesPath)/Microsoft.NET.StringTools*.nupkg'
Expand Down Expand Up @@ -200,7 +204,7 @@ extends:
$MicrosoftNETStringToolsPackageVersion = $packageFile.BaseName.TrimStart("Microsoft.NET.StringTools")
Write-Host "Setting MicrosoftNETStringToolsPackageVersion to '$MicrosoftNETStringToolsPackageVersion'"
Write-Host "##vso[task.setvariable variable=MicrosoftNETStringToolsPackageVersion]$($MicrosoftNETStringToolsPackageVersion)"
$props = @(
"VS.ExternalAPIs.MSBuild=$MSBuild_ExtApisPackageVersion",
"Microsoft.Build=$MicrosoftNETStringToolsPackageVersion",
Expand All @@ -223,24 +227,26 @@ extends:
Write-Host "##vso[task.setvariable variable=InsertPackagePropsValues]$($propsValue)"
- task: 1ES.PublishNuGet@1
displayName: 'Push MSBuild CoreXT packages'
condition: ${{ eq(parameters.SkipUploadingPackages, false) }}
inputs:
packageParentPath: '$(Build.ArtifactStagingDirectory)'
packagesToPush: $(MSBuildPackagePattern);$(StringToolsPackagePattern);$(ExternalAPIsPackagePattern)
nuGetFeedType: internal
publishVstsFeed: VS
allowPackageConflicts: true
allowPackageConflicts: false
- template: /azure-pipelines/WIFtoPATauth.yml@self
parameters:
wifServiceConnectionName: azure-public/vside package push
deadPATServiceConnectionId: 42175e93-c771-4a4f-a132-3cca78f44b3b
- task: 1ES.PublishNuGet@1
condition: ${{ eq(parameters.SkipUploadingPackages, false) }}
displayName: 'Push MSBuild packages to VSSDK'
inputs:
packageParentPath: '$(Build.ArtifactStagingDirectory)'
packagesToPush: $(MSBuildPackagePattern);$(StringToolsPackagePattern)
nuGetFeedType: external
publishFeedCredentials: azure-public/vssdk
allowPackageConflicts: true
allowPackageConflicts: false
- task: PowerShell@2
name: PrintTargetBranch
inputs:
Expand All @@ -264,4 +270,4 @@ extends:
CustomScriptExecutionCommand: $(InsertCustomScriptExecutionCommand)
AutoCompletePR: true
AutoCompleteMergeStrategy: Squash
InsertionBuildPolicy: Request Perf DDRITs
InsertionBuildPolicy: Request Perf DDRITs

0 comments on commit 81c00a4

Please sign in to comment.