From 8e87e57656dd3b72a2219a59cef2f93af25c21ac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 09:11:25 +0800 Subject: [PATCH 1/5] [vs17.10] Update dependencies from dotnet/arcade (#11586) * Update dependencies from https://github.com/dotnet/arcade build 20250220.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions From Version 8.0.0-beta.25114.5 -> To Version 8.0.0-beta.25120.1 * Update Versions.props VersionPrefix * Update dependencies from https://github.com/dotnet/arcade build 20250314.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.XUnitExtensions From Version 8.0.0-beta.25114.5 -> To Version 8.0.0-beta.25164.5 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Jenny Bai --- eng/Version.Details.xml | 12 +++++------ eng/Versions.props | 4 ++-- eng/common/cross/toolchain.cmake | 4 ++++ eng/common/generate-sbom-prep.ps1 | 20 +++++++++++++------ eng/common/generate-sbom-prep.sh | 17 ++++++++++------ eng/common/templates-official/job/job.yml | 3 ++- .../steps/generate-sbom.yml | 2 +- eng/common/tools.ps1 | 4 ++-- eng/common/tools.sh | 4 ++-- global.json | 2 +- 10 files changed, 45 insertions(+), 27 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 008966fd087..303c0099304 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -71,14 +71,14 @@ - + https://github.com/dotnet/arcade - 221fba21fbd6a29f17af7a7004f8ef18a51519bd + 802042c6e779b73b4edb012ee1d5bae02ec8d41c - + https://github.com/dotnet/arcade - 221fba21fbd6a29f17af7a7004f8ef18a51519bd + 802042c6e779b73b4edb012ee1d5bae02ec8d41c @@ -100,9 +100,9 @@ 919d4dbfb0dffb35a702417e28ceea652d248bc6 - + https://github.com/dotnet/arcade - 221fba21fbd6a29f17af7a7004f8ef18a51519bd + 802042c6e779b73b4edb012ee1d5bae02ec8d41c diff --git a/eng/Versions.props b/eng/Versions.props index 6b72862d8ba..d96f419e089 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.10.23 + 17.10.24 release 17.8.3 15.1.0.0 @@ -50,7 +50,7 @@ Otherwise, this version of dotnet will not be installed and the build will error out. --> $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1)) 4.2.0-1.22102.8 - 8.0.0-beta.25114.5 + 8.0.0-beta.25164.5 7.0.0 6.0.1 4.10.0-3.24175.2 diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index dafabdcaef0..f93dc440df0 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -280,6 +280,8 @@ elseif(TARGET_ARCH_NAME MATCHES "^(arm64|x64)$") add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64") add_toolchain_linker_flag("-Wl,--rpath-link=${TIZEN_TOOLCHAIN_PATH}") endif() +elseif(TARGET_ARCH_NAME STREQUAL "s390x") + add_toolchain_linker_flag("--target=${TOOLCHAIN}") elseif(TARGET_ARCH_NAME STREQUAL "x86") if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl) add_toolchain_linker_flag("--target=${TOOLCHAIN}") @@ -327,6 +329,8 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") if(TARGET_ARCH_NAME STREQUAL "armel") add_compile_options(-mfloat-abi=softfp) endif() +elseif(TARGET_ARCH_NAME STREQUAL "s390x") + add_compile_options("--target=${TOOLCHAIN}") elseif(TARGET_ARCH_NAME STREQUAL "x86") if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl) add_compile_options(--target=${TOOLCHAIN}) diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 index 3e5c1c74a1c..a0c7d792a76 100644 --- a/eng/common/generate-sbom-prep.ps1 +++ b/eng/common/generate-sbom-prep.ps1 @@ -4,18 +4,26 @@ Param( . $PSScriptRoot\pipeline-logging-functions.ps1 +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" +$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' +$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName + +Write-Host "Artifact name before : $ArtifactName" +Write-Host "Artifact name after : $SafeArtifactName" + Write-Host "Creating dir $ManifestDirPath" + # create directory for sbom manifest to be placed -if (!(Test-Path -path $ManifestDirPath)) +if (!(Test-Path -path $SbomGenerationDir)) { - New-Item -ItemType Directory -path $ManifestDirPath - Write-Host "Successfully created directory $ManifestDirPath" + New-Item -ItemType Directory -path $SbomGenerationDir + Write-Host "Successfully created directory $SbomGenerationDir" } else{ Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." } Write-Host "Updating artifact name" -$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_' -Write-Host "Artifact name $artifact_name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh index d5c76dc827b..bbb4922151e 100644 --- a/eng/common/generate-sbom-prep.sh +++ b/eng/common/generate-sbom-prep.sh @@ -14,19 +14,24 @@ done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptroot/pipeline-logging-functions.sh +# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. +artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" +safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" + manifest_dir=$1 -if [ ! -d "$manifest_dir" ] ; then - mkdir -p "$manifest_dir" - echo "Sbom directory created." $manifest_dir +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +sbom_generation_dir="$manifest_dir/$safe_artifact_name" + +if [ ! -d "$sbom_generation_dir" ] ; then + mkdir -p "$sbom_generation_dir" + echo "Sbom directory created." $sbom_generation_dir else Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." fi -artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" echo "Artifact name before : "$artifact_name -# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. -safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" echo "Artifact name after : "$safe_artifact_name export ARTIFACT_NAME=$safe_artifact_name echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 1f035fee73f..98ccbd7a9c1 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -38,6 +38,7 @@ parameters: enableSbom: true PackageVersion: 7.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' + ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom jobs: - job: ${{ parameters.name }} @@ -261,4 +262,4 @@ jobs: targetPath: '$(Build.SourcesDirectory)\eng\common\BuildConfiguration' artifactName: 'BuildConfiguration' displayName: 'Publish build retry configuration' - continueOnError: true \ No newline at end of file + continueOnError: true diff --git a/eng/common/templates-official/steps/generate-sbom.yml b/eng/common/templates-official/steps/generate-sbom.yml index 1bf43bf807a..daf0957b68d 100644 --- a/eng/common/templates-official/steps/generate-sbom.yml +++ b/eng/common/templates-official/steps/generate-sbom.yml @@ -35,7 +35,7 @@ steps: PackageName: ${{ parameters.packageName }} BuildDropPath: ${{ parameters.buildDropPath }} PackageVersion: ${{ parameters.packageVersion }} - ManifestDirPath: ${{ parameters.manifestDirPath }} + ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME) ${{ if ne(parameters.IgnoreDirectories, '') }}: AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}' diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index a00577ed17a..82b2798ba30 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -42,7 +42,7 @@ [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1 [string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' } # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -263,7 +263,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - $uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" + $uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" Retry({ Write-Host "GET $uri" diff --git a/eng/common/tools.sh b/eng/common/tools.sh index b9b329ce37f..68db1543023 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true} use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -297,7 +297,7 @@ function with_retries { function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" - local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" + local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" if [[ ! -a "$install_script" ]]; then mkdir -p "$root" diff --git a/global.json b/global.json index 901b8445c51..5023d005478 100644 --- a/global.json +++ b/global.json @@ -10,6 +10,6 @@ "xcopy-msbuild": "17.8.5" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25114.5" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.25164.5" } } From 1ea6ceed0fd5619219a18100eca042a382dee3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Provazn=C3=ADk?= Date: Wed, 2 Apr 2025 20:27:38 +0200 Subject: [PATCH 2/5] add preview suffix in experimental CI Builds, enable expinsert (#11534) * remove release branding for experimental in CI Build * backport experimental insertion and add servicing branch selection logic * fix removing versionkind * bump version * simplify version suffix selection * fix comment --- .vsts-dotnet.yml | 4 + azure-pipelines/vs-insertion-experimental.yml | 181 ++++++++++++++++++ eng/Versions.props | 2 +- 3 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 azure-pipelines/vs-insertion-experimental.yml diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml index 8869e9c7b82..e7abdfc749d 100644 --- a/.vsts-dotnet.yml +++ b/.vsts-dotnet.yml @@ -40,6 +40,9 @@ variables: value: false - name: Codeql.Enabled value: true + # ensures we don't build and push experimental versions to official feeds as release versions + - name: IsExperimental + value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/exp/') }} - group: DotNet-MSBuild-SDLValidation-Params resources: @@ -165,6 +168,7 @@ extends: /p:DotNetPublishUsingPipelines=true /p:VisualStudioIbcDrop=$(OptProfDrop) /p:GenerateSbom=true + /p:SuppressFinalPackageVersion=$(IsExperimental) displayName: Build condition: succeeded() diff --git a/azure-pipelines/vs-insertion-experimental.yml b/azure-pipelines/vs-insertion-experimental.yml new file mode 100644 index 00000000000..0e248a57da9 --- /dev/null +++ b/azure-pipelines/vs-insertion-experimental.yml @@ -0,0 +1,181 @@ +# Create an experimental VS insertion auto-triggered from exp/* branches to validate changes before merging to main +trigger: none +name: $(Date:yyyyMMdd).$(Rev:r) + +resources: + pipelines: + - pipeline: 'MSBuild' + project: 'DevDiv' + source: 'MSBuild' + trigger: + branches: + include: + - exp/* + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +parameters: + - name: TargetBranch + type: string + default: main + displayName: 'Insertion Target Branch (select for manual insertion)' + values: + - main + - rel/d17.14 + - rel/d17.13 + - rel/d17.12 + - rel/d17.11 + - rel/d17.10 + - rel/d17.8 + - rel/d17.6 + - rel/d17.3 + - rel/d17.0 + +variables: + - name: TeamName + value: msbuild + - name: TeamEmail + value: msbtm@microsoft.com + - name: MSBuild_CI_BuildNumber + value: $(resources.pipeline.MSBuild.runName) + - name: MSBuild_CI_SourceVersion + value: $(resources.pipeline.MSBuild.sourceCommit) + - name: ArtifactPackagesPath + value: $(Build.ArtifactStagingDirectory)/PackageArtifacts + + - name: MSBuildPackagePattern + value: '$(ArtifactPackagesPath)/Microsoft.Build.*.nupkg' + - name: StringToolsPackagePattern + value: '$(ArtifactPackagesPath)/Microsoft.NET.StringTools*.nupkg' + - name: ExternalAPIsPackagePattern + value: '$(ArtifactPackagesPath)/VS.ExternalAPIs.*.nupkg' + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + pool: + name: VSEngSS-MicroBuild2022-1ES + stages: + - stage: VSInsertion + displayName: VS insertion + variables: + VSDropPath: https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber) + VSManVersionSuffix: $(MSBuild_ExtApisPackageVersion)+$(MSBuild_CI_SourceVersion) + StandardVSManPath: Microsoft.Build.vsman{$(VSManVersionSuffix)}=$(VSDropPath);Microsoft.Build.vsman + Arm64VSManPath: Microsoft.Build.Arm64.vsman{$(VSManVersionSuffix)}=$(VSDropPath);Microsoft.Build.Arm64.vsman + UnGACVSManPath: Microsoft.Build.UnGAC.vsman=$(VSDropPath);Microsoft.Build.UnGAC.vsman + InsertJsonValues: $(StandardVSManPath),$(Arm64VSManPath),$(UnGACVSManPath) + InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion) + InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1 + InsertDescription: Insert MSBuild $(MSBuild_CI_BuildNumber) from the branch $(SourceBranchName) at commit $(MSBuild_CI_SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion) + InsertPayloadName: '[Experimental] [Skip-SymbolCheck] MSBuild $(SourceBranchName) $(MSBuild_ExtApisPackageVersion)' + jobs: + - job: PushPackagesAndInsert + displayName: Push Packages and Insert VS payload + condition: succeeded() + timeoutInMinutes: 0 + templateContext: + inputs: + - input: pipelineArtifact + pipeline: 'MSBuild' + artifactName: 'xsd' + targetPath: '$(Pipeline.Workspace)/xsd' + - input: pipelineArtifact + pipeline: 'MSBuild' + artifactName: 'PackageArtifacts' + targetPath: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + # the CI build creates a sourcebuild intermediate package that is not signed, remove it to avoid warning from Guardian + itemPattern: | + ** + !**/Microsoft.SourceBuild.Intermediate*.nupkg + steps: + - task: Powershell@2 + name: SetSourceBranch + displayName: Set source branch name + inputs: + targetType: inline + script: | + # Extract the last section after the last '/' + $fullBranch = "$(resources.pipeline.MSBuild.sourceBranch)" + $branchSegments = $fullBranch -split '/' + $branch = $branchSegments[-1] + Write-Host "Setting drops branch to '$branch'" + Write-Host "##vso[task.setvariable variable=SourceBranchName]$branch" + + - task: Powershell@2 + name: DetermineTargetBranch + displayName: Determine target branch + inputs: + targetType: inline + script: | + # Extract VS version from branch name if it follows exp/vsXX.Y-somename pattern + $fullBranch = "$(resources.pipeline.MSBuild.sourceBranch)" + $parameterTargetBranch = "${{ parameters.TargetBranch }}" + $detectedTarget = "main" # Default target branch + + # Try to match the pattern with regex + if ($fullBranch -match "exp/vs(\d+)\.(\d+).*") { + $major = $matches[1] + $minor = $matches[2] + $targetBranch = "rel/d$major.$minor" + Write-Host "Detected version pattern in branch: $major.$minor" + Write-Host "Setting target branch to $targetBranch" + $detectedTarget = $targetBranch + } else { + Write-Host "No version pattern detected in branch, using default target: main" + } + + # Determine which target branch to use based on build reason + $finalTargetBranch = $parameterTargetBranch + if ("$(Build.Reason)" -eq "ResourceTrigger" -or "$(Build.Reason)" -eq "PipelineCompletedTrigger") { + Write-Host "Build was triggered automatically, using detected target branch: $detectedTarget" + $finalTargetBranch = $detectedTarget + } else { + Write-Host "Build was triggered manually, using parameter target branch: $parameterTargetBranch" + } + + Write-Host "##vso[task.setvariable variable=FinalTargetBranch]$finalTargetBranch" + + - task: Powershell@2 + name: PwshMungeExternalAPIsPkgVersion + displayName: Munge ExternalAPIs package version + inputs: + targetType: inline + script: | + $folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts/VS.ExternalAPIs.*.nupkg" + $packageFile = Get-ChildItem -Path $folder -Filter VS.ExternalAPIs.*.nupkg | Select-Object -First 1 + $packageVersion = $packageFile.BaseName.TrimStart("VS.ExternalAPIs.MSBuild") + Write-Host "Setting MSBuild_ExtApisPackageVersion to '$packageVersion'" + Write-Host "##vso[task.setvariable variable=MSBuild_ExtApisPackageVersion]$($packageVersion)" + $folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts/Microsoft.NET.StringTools*.nupkg" + $packageFile = Get-ChildItem -Path $folder -Filter Microsoft.NET.StringTools*.nupkg | Select-Object -First 1 + $packageVersion = $packageFile.BaseName.TrimStart("Microsoft.NET.StringTools") + Write-Host "Setting MicrosoftNETStringToolsPackageVersion to '$packageVersion'" + Write-Host "##vso[task.setvariable variable=MicrosoftNETStringToolsPackageVersion]$($packageVersion)" + - task: 1ES.PublishNuGet@1 + displayName: 'Push MSBuild CoreXT packages' + inputs: + packageParentPath: '$(Build.ArtifactStagingDirectory)' + packagesToPush: $(MSBuildPackagePattern);$(StringToolsPackagePattern);$(ExternalAPIsPackagePattern) + nuGetFeedType: internal + publishVstsFeed: VS + allowPackageConflicts: true + - task: MicroBuildInsertVsPayload@4 + name: MicroBuildInsertVsPayload_4 + displayName: Insert VS Payload + inputs: + LinkWorkItemsToPR: true + TeamName: $(TeamName) + TeamEmail: $(TeamEmail) + TargetBranch: $(FinalTargetBranch) + InsertionPayloadName: $(InsertPayloadName) + PackagePropsValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion);Microsoft.Build=$(MicrosoftNETStringToolsPackageVersion);Microsoft.Build.Framework=$(MicrosoftNETStringToolsPackageVersion);Microsoft.Build.Tasks.Core=$(MicrosoftNETStringToolsPackageVersion);Microsoft.Build.Utilities.Core=$(MicrosoftNETStringToolsPackageVersion);Microsoft.NET.StringTools=$(MicrosoftNETStringToolsPackageVersion) + InsertionDescription: $(InsertDescription) + ComponentJsonValues: $(InsertJsonValues) + DefaultConfigValues: $(InsertConfigValues) + InsertionReviewers: MSBuild + CustomScriptExecutionCommand: $(InsertCustomScriptExecutionCommand) + InsertionBuildPolicy: Request Perf DDRITs diff --git a/eng/Versions.props b/eng/Versions.props index ee53a3bfc68..a5b40340562 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.8.22 + 17.8.23 release 17.7.0 15.1.0.0 From b46a62a9a9861ce314f4119f968caafedd85741e Mon Sep 17 00:00:00 2001 From: Gang Wang Date: Thu, 3 Apr 2025 17:43:05 +0800 Subject: [PATCH 3/5] Add the check on version bump up (#11469) --- .vsts-dotnet-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ eng/Versions.props | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml index d538f655a85..b999b6fd978 100644 --- a/.vsts-dotnet-ci.yml +++ b/.vsts-dotnet-ci.yml @@ -4,6 +4,42 @@ trigger: - vs* jobs: +- job: CheckVersionBumpOnReleaseBranches + condition: startsWith(variables['System.PullRequest.TargetBranch'], 'vs') + displayName: "Check Version Bump On Release Branches" + steps: + - powershell: | + $versionsFile = "eng/Versions.props" + $changedFiles = git diff --name-only HEAD HEAD~1 + $changedVersionsFile = $changedFiles | Where-Object { $_ -eq $versionsFile } + $isInitialCommit = $false + $isVersionBumped = $false + if ($changedVersionsFile -ne $null) { + $difference = git diff HEAD~1 $versionsFile + $changedContent = $difference -join "%" + # 'DotNetFinalVersionKind' is expected to be added only during the initial setup of the release branch + $initialCommitPattern = '-\s*\d+\.\d+\.\d+<\/VersionPrefix>%.*\+\s*\d+\.\d+\.\d+<\/VersionPrefix>release<\/DotNetFinalVersionKind>' + $isInitialCommit = $changedContent -match $initialCommitPattern + $pattern = '-\s*\d+\.\d+\.(?\d+)<\/VersionPrefix>.*%\+\s*\d+\.\d+\.(?\d+)<\/VersionPrefix>' + if (!($isInitialCommit) -and ($changedContent -match $pattern)) { + try { + $previousPatch = [Convert]::ToInt32($Matches.previous) + $currentPatch = [Convert]::ToInt32($Matches.current) + if ($currentPatch -gt $previousPatch) { + $isVersionBumped = $true + } + } catch { + Write-Host "An error occurred during conversion: $_" + } + } + } + + if (!($isInitialCommit -or $isVersionBumped)) { + throw "Hello! I noticed that you're targeting one of our servicing branches. You need to increase the revision version number (the last part) of 'VersionPrefix' in eng/Versions.props." + } + condition: startsWith(variables['System.PullRequest.TargetBranch'], 'vs') + displayName: "Check if patch version is bumped up" + - job: BootstrapMSBuildOnFullFrameworkWindows displayName: "Windows Full" pool: diff --git a/eng/Versions.props b/eng/Versions.props index a5b40340562..6a09c2bfb8e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.8.23 + 17.8.24 release 17.7.0 15.1.0.0 From 6c0a39c42fae7d690c791c390548da9e0223a7d1 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:57:43 +0200 Subject: [PATCH 4/5] Update VersionPrefix to 17.10.25 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6a09c2bfb8e..d421c75af1b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.8.24 + 17.10.25 release 17.7.0 15.1.0.0 From e0d72cb12538e1b8262ca03ee61f3d6e6dcd62af Mon Sep 17 00:00:00 2001 From: Gang Wang Date: Tue, 8 Apr 2025 01:58:15 +0000 Subject: [PATCH 5/5] Update VersionPrefix to 17.11.30 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 379966b1a7a..2bad5ffa915 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.11.29 + 17.11.30 release 17.10.4 15.1.0.0