Skip to content

Commit c80027e

Browse files
authored
[Rollout] Production rollout 2025-04-30-III (#4784)
#4774
2 parents f9b215d + 0a34f42 commit c80027e

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

src/Microsoft.DotNet.Darc/DarcLib/GitHubClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ private static void UpdateCheckRun(CheckRunUpdate newUpdateCheckRun, MergePolicy
592592
{
593593
newUpdateCheckRun.Status = CheckStatus.InProgress;
594594
}
595-
else if (result.Status == MergePolicyEvaluationStatus.DecisiveSuccess)
595+
else if (result.Status == MergePolicyEvaluationStatus.DecisiveSuccess || result.Status == MergePolicyEvaluationStatus.TransientSuccess)
596596
{
597597
newUpdateCheckRun.Conclusion = "success";
598598
newUpdateCheckRun.CompletedAt = DateTime.Now;

src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrRegistrations.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ public static IServiceCollection AddSingleVmrSupport(
5858
return AddVmrManagers(services, gitLocation, gitHubToken, azureDevOpsToken);
5959
}
6060

61+
/// <summary>
62+
/// Registers dependencies for GitNativeRepoCloner.
63+
/// It only supports Azure DevOps connections and it assumes that a dependency on IAzureDevOpsTokenProvider has been registered.
64+
/// </summary>
65+
public static IServiceCollection AddGitNativeRepoClonerSupport(this IServiceCollection services)
66+
{
67+
services.TryAddTransient<IGitRepoCloner, GitNativeRepoCloner>();
68+
services.TryAddSingleton<IRemoteTokenProvider>(sp =>
69+
{
70+
var azdoTokenProvider = sp.GetRequiredService<IAzureDevOpsTokenProvider>();
71+
return new RemoteTokenProvider(azdoTokenProvider, null);
72+
});
73+
services.TryAddTransient<ILocalGitClient, LocalGitClient>();
74+
services.TryAddTransient<IProcessManager>(sp => new ProcessManager(sp.GetRequiredService<ILogger<ProcessManager>>(), "git"));
75+
services.TryAddTransient<ILogger>(sp => sp.GetRequiredService<ILogger<VmrManagerBase>>());
76+
services.TryAddTransient<ITelemetryRecorder, NoTelemetryRecorder>();
77+
services.TryAddTransient<IFileSystem, FileSystem>();
78+
79+
return services;
80+
}
81+
6182
private static IServiceCollection AddVmrManagers(
6283
IServiceCollection services,
6384
string gitLocation,

test/Maestro.Data.Tests/DependencyRegistrationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ public void AreDependenciesRegistered()
2828
},
2929
out var message).Should().BeTrue(message);
3030
}
31-
3231
}

test/Microsoft.DotNet.DarcLib.Tests/Microsoft.DotNet.DarcLib.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9+
<PackageReference Include="Microsoft.DotNet.Internal.DependencyInjection.Testing" />
910
<PackageReference Include="Microsoft.EntityFrameworkCore" />
1011
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
1112
<PackageReference Include="Microsoft.DotNet.Internal.Testing.Utility" />
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using FluentAssertions;
5+
using Microsoft.DotNet.DarcLib.VirtualMonoRepo;
6+
using Microsoft.DotNet.Internal.DependencyInjection.Testing;
7+
using NUnit.Framework;
8+
9+
namespace Microsoft.DotNet.DarcLib.Tests.VirtualMonoRepo;
10+
11+
public class VmrRegistrationsTests
12+
{
13+
/// <summary>
14+
/// Tests registering of dependencies for GitNativeRepoCloner
15+
/// </summary>
16+
[Test]
17+
public void AddGitNativeRepoClonerSupportRegistrationIsCoherent()
18+
{
19+
DependencyInjectionValidation.IsDependencyResolutionCoherent(sc => sc.AddGitNativeRepoClonerSupport(),
20+
out var message).Should().BeTrue(message);
21+
}
22+
}

0 commit comments

Comments
 (0)