From 00fbfd8650833fadfdcf6869f873fb80ed46da42 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 30 Oct 2023 08:47:31 -0700 Subject: [PATCH 1/7] [release/8.0.1xx] Stabilize package versions (#17614) Co-authored-by: Matt Thalman --- eng/Versions.props | 2 +- .../SourceBuiltArtifactsTests.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index f08343dc9..4367c47a7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,7 +13,7 @@ $(VersionMajor).$(VersionMinor) $(MajorMinorVersion).$(VersionSDKMinor) - false + true release rtm diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs index 8ab1a9600..d80eb8e54 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs +++ b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs @@ -58,7 +58,8 @@ public class SourceBuiltArtifactsTests : SdkTests string[] sdkVersionLines = File.ReadAllLines(Path.Combine(outputDir, sdkVersionPath)); string expectedSdkVersion = sdkVersionLines[1]; - Assert.Equal(expectedSdkVersion, sdkVersion); + // Disable due to https://github.com/dotnet/source-build/issues/3693 + // Assert.Equal(expectedSdkVersion, sdkVersion); } finally { From b5d77c4daf64e49f4c06d34e906a76e40d5df827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Mon, 30 Oct 2023 17:39:58 +0100 Subject: [PATCH 2/7] [release/8.0.1xx] Check out the correct target VMR branch (#17656) --- eng/pipelines/templates/jobs/vmr-build.yml | 5 ++++- eng/pipelines/templates/steps/vmr-prepare.yml | 12 +++++++----- eng/pipelines/templates/steps/vmr-pull-updates.yml | 6 ------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index 041a47580..9c5e58dbe 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -90,7 +90,10 @@ jobs: steps: - template: ../steps/vmr-prepare.yml parameters: - vmrBranch: ${{ parameters.vmrBranch }} + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + vmrBranch: $(System.PullRequest.TargetBranch) + ${{ else }}: + vmrBranch: ${{ parameters.vmrBranch }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} skipComponentGovernanceDetection: true diff --git a/eng/pipelines/templates/steps/vmr-prepare.yml b/eng/pipelines/templates/steps/vmr-prepare.yml index 08c40b646..d35686f99 100644 --- a/eng/pipelines/templates/steps/vmr-prepare.yml +++ b/eng/pipelines/templates/steps/vmr-prepare.yml @@ -28,11 +28,13 @@ steps: path: vmr clean: true -- ${{ if or(not(parameters.isBuiltFromVmr), eq(variables['System.TeamProject'], 'internal')) }}: - - script: | - git switch -c ${{ parameters.vmrBranch }} - displayName: Checkout ${{ parameters.vmrBranch }} - workingDirectory: $(Agent.BuildDirectory)/vmr +- script: | + set -euxo pipefail + git fetch --all + git checkout --track origin/${{ parameters.vmrBranch }} + echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}" + displayName: Check out ${{ parameters.vmrBranch }} + workingDirectory: $(Agent.BuildDirectory)/vmr # TODO (https://github.com/dotnet/arcade/issues/11332): Allow full CG? # Currently, we ignore dirs of individual repos - they have been scanned before diff --git a/eng/pipelines/templates/steps/vmr-pull-updates.yml b/eng/pipelines/templates/steps/vmr-pull-updates.yml index fc5bd98bc..673062c25 100644 --- a/eng/pipelines/templates/steps/vmr-pull-updates.yml +++ b/eng/pipelines/templates/steps/vmr-pull-updates.yml @@ -22,12 +22,6 @@ steps: displayName: Clone dotnet/installer path: installer -- script: | - git checkout -B ${{ parameters.vmrBranch }} - echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}" - displayName: Prepare branch ${{ parameters.vmrBranch }} - workingDirectory: ${{ parameters.vmrPath }} - - script: > ./eng/vmr-sync.sh --vmr ${{ parameters.vmrPath }} From 3e660e454496efc72f6316b411e7b4ea87a7bd59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Mon, 30 Oct 2023 19:18:45 +0100 Subject: [PATCH 3/7] Do not fetch again in VMR synchronization (#17658) --- eng/pipelines/templates/steps/vmr-prepare.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/pipelines/templates/steps/vmr-prepare.yml b/eng/pipelines/templates/steps/vmr-prepare.yml index d35686f99..644891799 100644 --- a/eng/pipelines/templates/steps/vmr-prepare.yml +++ b/eng/pipelines/templates/steps/vmr-prepare.yml @@ -29,8 +29,6 @@ steps: clean: true - script: | - set -euxo pipefail - git fetch --all git checkout --track origin/${{ parameters.vmrBranch }} echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}" displayName: Check out ${{ parameters.vmrBranch }} From 1e64f53bd8a82b1dc18ecb9f99a7548e603ae063 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Mon, 30 Oct 2023 13:52:31 -0500 Subject: [PATCH 4/7] Update SDK diff baseline (#17660) --- .../assets/baselines/MsftToSbSdkFiles.diff | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdkFiles.diff b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdkFiles.diff index 5749c4e82..434883537 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdkFiles.diff +++ b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/MsftToSbSdkFiles.diff @@ -48,7 +48,6 @@ index ------------ ./packs/NETStandard.Library.Ref/x.y.z/ref/netstandard2.1/System.Xml.XPath.XDocument.dll ./sdk-manifests/ ./sdk-manifests/x.y.z/ --./sdk-manifests/x.y.z/ -./sdk-manifests/x.y.z/ ./sdk-manifests/x.y.z/microsoft.net.workload.emscripten.current/ ./sdk-manifests/x.y.z/microsoft.net.workload.emscripten.current/x.y.z/ From ae28d5bc061eedfe863ef3e22d090054b69e7685 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:46:36 -0500 Subject: [PATCH 5/7] [release/8.0.1xx] Update source build pipeline triggers (#17659) Co-authored-by: Matt Thalman --- eng/pipelines/source-build-license-scan.yml | 7 ++++--- eng/pipelines/source-build-sdk-diff-tests.yml | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/source-build-license-scan.yml b/eng/pipelines/source-build-license-scan.yml index bcf7e84f1..ca70fd70c 100644 --- a/eng/pipelines/source-build-license-scan.yml +++ b/eng/pipelines/source-build-license-scan.yml @@ -1,12 +1,13 @@ # Pipeline documentation at https://github.com/dotnet/dotnet/blob/main/docs/license-scanning.md schedules: -- cron: "0 7 * * 1-5" - displayName: Run on weekdays at 7am UTC +- cron: "0 7 * * 1" + displayName: Run on Mondays at 7am UTC branches: include: - main - - release/* + - release/*.0.1xx* + - internal/release/*.0.1xx* pr: none trigger: none diff --git a/eng/pipelines/source-build-sdk-diff-tests.yml b/eng/pipelines/source-build-sdk-diff-tests.yml index 9b5a3f28e..daf6afefe 100644 --- a/eng/pipelines/source-build-sdk-diff-tests.yml +++ b/eng/pipelines/source-build-sdk-diff-tests.yml @@ -4,7 +4,8 @@ schedules: branches: include: - main - - release/* + - release/*.0.1xx* + - internal/release/*.0.1xx* pr: none trigger: none From c7ee8f18f4274dccfca8c01c34b388bdcf8f852e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Tue, 7 Nov 2023 16:05:56 +0100 Subject: [PATCH 6/7] [release/8.0.1xx] Bump `darc` to fix VMR sync (#17704) --- .config/dotnet-tools.json | 2 +- eng/Version.Details.xml | 8 +-- eng/Versions.props | 2 +- .../templates/steps/vmr-pull-updates.yml | 13 +++++ eng/vmr-sync.sh | 4 +- .../Tasks/GitFileManagerFactory.cs | 52 ------------------- .../Tasks/VirtualMonoRepo_Initialize.cs | 5 +- 7 files changed, 24 insertions(+), 62 deletions(-) delete mode 100644 src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2b7fecfce..eddbc806d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "microsoft.dotnet.darc": { - "version": "1.1.0-beta.23416.3", + "version": "1.1.0-beta.23551.2", "commands": [ "darc" ] diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 783b33db9..516265649 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -222,13 +222,13 @@ https://github.com/dotnet/arcade 39042b4048580366d35a7c1c4f4ce8fc0dbea4b4 - + https://github.com/dotnet/arcade-services - 5d63a226d022fda90cae2c239e882ad253baa758 + 88b0cbb096999d03068ddc9945465a3f5b6ba5da - + https://github.com/dotnet/arcade-services - 5d63a226d022fda90cae2c239e882ad253baa758 + 88b0cbb096999d03068ddc9945465a3f5b6ba5da https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 4367c47a7..0594bf69e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,7 +44,7 @@ - 1.1.0-beta.23416.3 + 1.1.0-beta.23551.2 diff --git a/eng/pipelines/templates/steps/vmr-pull-updates.yml b/eng/pipelines/templates/steps/vmr-pull-updates.yml index 673062c25..debe748e6 100644 --- a/eng/pipelines/templates/steps/vmr-pull-updates.yml +++ b/eng/pipelines/templates/steps/vmr-pull-updates.yml @@ -22,6 +22,19 @@ steps: displayName: Clone dotnet/installer path: installer +# This step is needed so that when we get a detached HEAD / shallow clone, +# we still pull the commit into the temporary installer clone to use it during the sync. +- script: | + git branch installer-head + displayName: Label PR commit + workingDirectory: $(Agent.BuildDirectory)/installer + +- script: | + git checkout -B ${{ parameters.vmrBranch }} + echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}" + displayName: Prepare branch ${{ parameters.vmrBranch }} + workingDirectory: ${{ parameters.vmrPath }} + - script: > ./eng/vmr-sync.sh --vmr ${{ parameters.vmrPath }} diff --git a/eng/vmr-sync.sh b/eng/vmr-sync.sh index a753efdd8..db0f704e2 100755 --- a/eng/vmr-sync.sh +++ b/eng/vmr-sync.sh @@ -135,7 +135,7 @@ while [[ $# -gt 0 ]]; do recursive=true ;; --remote) - additional_remotes="$additional_remotes,$2" + additional_remotes="$additional_remotes $2" shift ;; --readme-template) @@ -265,9 +265,9 @@ fi $azdev_pat \ --$verbosity \ $recursive_arg \ + $additional_remotes \ --readme-template "$readme_template" \ --tpn-template "$tpn_template" \ - $additional_remotes \ "$repository" if [[ $? == 0 ]]; then diff --git a/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs b/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs deleted file mode 100644 index 2da3d540b..000000000 --- a/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using Microsoft.DotNet.DarcLib; -using Microsoft.DotNet.DarcLib.Helpers; -using Microsoft.DotNet.DarcLib.VirtualMonoRepo; -using Microsoft.Extensions.Logging; - -namespace Microsoft.DotNet.VirtualMonoRepo.Tasks; - -public class GitFileManagerFactory : IGitFileManagerFactory -{ - private readonly IVmrInfo _vmrInfo; - private readonly VmrRemoteConfiguration _remoteConfiguration; - private readonly IProcessManager _processManager; - private readonly IVersionDetailsParser _versionDetailsParser; - private readonly ILoggerFactory _loggerFactory; - - public GitFileManagerFactory( - IVmrInfo vmrInfo, - VmrRemoteConfiguration remoteConfiguration, - IProcessManager processManager, - IVersionDetailsParser versionDetailsParser, - ILoggerFactory loggerFactory) - { - _vmrInfo = vmrInfo; - _remoteConfiguration = remoteConfiguration; - _processManager = processManager; - _versionDetailsParser = versionDetailsParser; - _loggerFactory = loggerFactory; - } - - public IGitFileManager Create(string repoUri) - => new GitFileManager(CreateGitRepo(repoUri), _versionDetailsParser, _loggerFactory.CreateLogger()); - - private IGitRepo CreateGitRepo(string repoUri) => GitRepoTypeParser.ParseFromUri(repoUri) switch - { - GitRepoType.AzureDevOps => throw new Exception("VMR initialization should not require Azure DevOps repositories"), - - GitRepoType.GitHub => new GitHubClient( - _processManager.GitExecutable, - _remoteConfiguration.GitHubToken, - _loggerFactory.CreateLogger(), - _vmrInfo.TmpPath, - // Caching not in use for Darc local client. - null), - - GitRepoType.Local => new LocalGitClient(_processManager.GitExecutable, _loggerFactory.CreateLogger()), - _ => throw new ArgumentException("Unknown git repository type", nameof(repoUri)), - }; -} diff --git a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs index eae76d532..2a8c1d726 100644 --- a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs +++ b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs @@ -74,6 +74,8 @@ public class VirtualMonoRepo_Initialize : Build.Utilities.Task, ICancelableTask additionalRemotes, ReadmeTemplatePath, TpnTemplatePath, + generateCodeowners: false, + discardPatches: true, _cancellationToken.Token); return true; } @@ -82,7 +84,6 @@ public class VirtualMonoRepo_Initialize : Build.Utilities.Task, ICancelableTask private IServiceProvider CreateServiceProvider() => new ServiceCollection() .AddLogging(b => b.AddConsole().AddFilter(l => l >= LogLevel.Information)) - .AddTransient() - .AddVmrManagers(sp => sp.GetRequiredService(), "git", VmrPath, TmpPath, null, null) + .AddVmrManagers("git", VmrPath, TmpPath, null, null) .BuildServiceProvider(); } From b7bae3f7ae72edd4055c37f386cbd437bccf3e5c Mon Sep 17 00:00:00 2001 From: Jason Zhai Date: Wed, 8 Nov 2023 01:56:05 -0800 Subject: [PATCH 7/7] Revert "stabilize package versions" --- eng/Versions.props | 2 +- .../SourceBuiltArtifactsTests.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 2635b91db..24b087e8d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -13,7 +13,7 @@ $(VersionMajor).$(VersionMinor) $(MajorMinorVersion).$(VersionSDKMinor) - true + false release preview diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs index d80eb8e54..8ab1a9600 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs +++ b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SourceBuiltArtifactsTests.cs @@ -58,8 +58,7 @@ public class SourceBuiltArtifactsTests : SdkTests string[] sdkVersionLines = File.ReadAllLines(Path.Combine(outputDir, sdkVersionPath)); string expectedSdkVersion = sdkVersionLines[1]; - // Disable due to https://github.com/dotnet/source-build/issues/3693 - // Assert.Equal(expectedSdkVersion, sdkVersion); + Assert.Equal(expectedSdkVersion, sdkVersion); } finally {