Merge branch 'release/8.0.1xx' into release/8.0.2xx

This commit is contained in:
Jason Zhai 2023-11-08 00:44:27 -08:00
commit e552fd48f3
13 changed files with 36 additions and 75 deletions

View file

@ -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
{

View file

@ -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/

View file

@ -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<GitFileManager>());
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<GitHubClient>(),
_vmrInfo.TmpPath,
// Caching not in use for Darc local client.
null),
GitRepoType.Local => new LocalGitClient(_processManager.GitExecutable, _loggerFactory.CreateLogger<LocalGitClient>()),
_ => throw new ArgumentException("Unknown git repository type", nameof(repoUri)),
};
}

View file

@ -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<GitFileManagerFactory>()
.AddVmrManagers(sp => sp.GetRequiredService<GitFileManagerFactory>(), "git", VmrPath, TmpPath, null, null)
.AddVmrManagers("git", VmrPath, TmpPath, null, null)
.BuildServiceProvider();
}