Skip to content

Commit f1b6b9b

Browse files
authored
[Rollout] Production rollout 2025-01-22 (#4356)
2 parents 5528392 + 4dd55c0 commit f1b6b9b

File tree

34 files changed

+795
-596
lines changed

34 files changed

+795
-596
lines changed

src/Microsoft.DotNet.Darc/DarcLib/Conflicts/BackFlowConflictResolver.cs

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/Microsoft.DotNet.Darc/DarcLib/Conflicts/CodeFlowConflictResolver.cs

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/Microsoft.DotNet.Darc/DarcLib/Conflicts/ForwardFlowConflictResolver.cs

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/Microsoft.DotNet.Darc/DarcLib/Helpers/IDependencyFileManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Task<GitFileContentContainer> UpdateDependencyFiles(
5454
IEnumerable<DependencyDetail> itemsToUpdate,
5555
SourceDependency? sourceDependency,
5656
string repoUri,
57-
string branch,
57+
string? branch,
5858
IEnumerable<DependencyDetail> oldDependencies,
5959
SemanticVersion? incomingDotNetSdkVersion);
6060

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task AddDependencyAsync(DependencyDetail dependency)
5757
/// Updates existing dependencies in the dependency files
5858
/// </summary>
5959
/// <param name="dependencies">Dependencies that need updates.</param>
60-
public async Task UpdateDependenciesAsync(List<DependencyDetail> dependencies, IRemoteFactory remoteFactory, IGitRepoFactory gitRepoFactory, IBarApiClient barClient)
60+
public async Task UpdateDependenciesAsync(List<DependencyDetail> dependencies, IRemoteFactory remoteFactory, IGitRepoFactory gitRepoFactory, IBasicBarClient barClient)
6161
{
6262
// Read the current dependency files and grab their locations so that nuget.config can be updated appropriately.
6363
// Update the incoming dependencies with locations.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public LocalGitClient(
4242
_logger = logger;
4343
}
4444

45-
public async Task<string> GetFileContentsAsync(string relativeFilePath, string repoPath, string branch)
45+
public async Task<string> GetFileContentsAsync(string relativeFilePath, string repoPath, string? branch)
4646
{
4747
// Load non-working-tree version
4848
if (!string.IsNullOrEmpty(branch))

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ protected async Task<ILocalGitRepo> PrepareCloneInternalAsync(
5656
IReadOnlyCollection<string> remoteUris,
5757
IReadOnlyCollection<string> requestedRefs,
5858
string checkoutRef,
59-
CancellationToken cancellationToken)
59+
bool resetToRemote = false,
60+
CancellationToken cancellationToken = default)
6061
{
6162
if (remoteUris.Count == 0)
6263
{
@@ -104,6 +105,19 @@ protected async Task<ILocalGitRepo> PrepareCloneInternalAsync(
104105

105106
var repo = _localGitRepoFactory.Create(path);
106107
await repo.CheckoutAsync(checkoutRef);
108+
109+
if (resetToRemote)
110+
{
111+
// get the upstream branch for the currently checked out branch
112+
var result = await _localGitRepo.RunGitCommandAsync(path, ["for-each-ref", "--format=%(upstream:short)", $"refs/heads/{checkoutRef}"]);
113+
result.ThrowIfFailed("Couldn't get upstream branch for the current branch");
114+
var upstream = result.StandardOutput.Trim();
115+
116+
// reset the branch to the remote one
117+
result = await _localGitRepo.RunGitCommandAsync(path, ["reset", "--hard", upstream]);
118+
result.ThrowIfFailed($"Couldn't reset to remote ref {upstream}");
119+
}
120+
107121
return repo;
108122
}
109123

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ Task<bool> UpdateRepository(
4242
bool reapplyVmrPatches,
4343
bool lookUpBuilds,
4444
CancellationToken cancellationToken,
45-
bool amendReapplyCommit = false);
45+
bool amendReapplyCommit = false,
46+
bool resetToRemoteWhenCloningRepo = false);
4647
}

0 commit comments

Comments
 (0)