Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Maestro/Maestro.DataProviders/RemoteFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class RemoteFactory : IRemoteFactory
private readonly IGitHubTokenProvider _gitHubTokenProvider;
private readonly IAzureDevOpsTokenProvider _azdoTokenProvider;
private readonly IServiceProvider _serviceProvider;
private readonly IRedisCacheClient _redisCacheClient;

public RemoteFactory(
BuildAssetRegistryContext context,
Expand All @@ -34,6 +35,7 @@ public RemoteFactory(
DarcRemoteMemoryCache memoryCache,
OperationManager operations,
IProcessManager processManager,
IRedisCacheClient redisCacheClient,
ILoggerFactory loggerFactory,
IServiceProvider serviceProvider)
{
Expand All @@ -45,6 +47,7 @@ public RemoteFactory(
_azdoTokenProvider = azdoTokenProvider;
_cache = memoryCache;
_serviceProvider = serviceProvider;
_redisCacheClient = redisCacheClient;
}

public async Task<IRemote> CreateRemoteAsync(string repoUrl)
Expand Down Expand Up @@ -88,7 +91,8 @@ private async Task<IRemoteGitRepo> GetRemoteGitClient(string repoUrl)
new Microsoft.DotNet.DarcLib.GitHubTokenProvider(_gitHubTokenProvider),
_processManager,
_loggerFactory.CreateLogger<GitHubClient>(),
_cache.Cache),
_cache.Cache,
_redisCacheClient),

GitRepoType.AzureDevOps => new AzureDevOpsClient(
_azdoTokenProvider,
Expand Down
11 changes: 7 additions & 4 deletions src/Microsoft.DotNet.Darc/Darc/Helpers/RemoteFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ internal class RemoteFactory : IRemoteFactory
private readonly ILoggerFactory _loggerFactory;
private readonly ICommandLineOptions _options;
private readonly IServiceProvider _serviceProvider;
private readonly IRedisCacheClient _redisCacheClient;

public RemoteFactory(
ILoggerFactory loggerFactory,
ICommandLineOptions options,
IServiceProvider serviceProvider)
IServiceProvider serviceProvider,
IRedisCacheClient redisCacheClient)
{
_loggerFactory = loggerFactory;
_options = options;
_serviceProvider = serviceProvider;
_redisCacheClient = redisCacheClient;
}

public Task<IRemote> CreateRemoteAsync(string repoUrl)
Expand All @@ -53,10 +56,10 @@ private IRemoteGitRepo CreateRemoteGitClient(ICommandLineOptions options, string
new GitHubClient(
options.GetGitHubTokenProvider(),
new ProcessManager(_loggerFactory.CreateLogger<IProcessManager>(), options.GitLocation),
_loggerFactory.CreateLogger<GitHubClient>(),
temporaryRepositoryRoot,
// Caching not in use for Darc local client.
null),
null, // Memory Caching not in use for Darc local client.
_redisCacheClient,
_loggerFactory.CreateLogger<GitHubClient>()),

GitRepoType.AzureDevOps =>
new AzureDevOpsClient(
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.DotNet.Darc/DarcLib/AzureDevOpsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public async Task<PullRequest> GetPullRequestAsync(string pullRequestUrl)
_ => PrStatus.None,
},
UpdatedAt = DateTimeOffset.UtcNow,
TargetBranchCommitSha = pr.LastMergeTargetCommit.CommitId,
HeadBranchCommitSha = pr.LastMergeSourceCommit.CommitId,
};
}

Expand Down
Loading