public static async Task <RepositoryImportResult> ImportAsync(string projectName, string sourceRepoUrl, SourceCodeRepositoryType repoType, AppConfiguration appConfiguration, IRepositoryAuthenticationInfo authInfo, ReadOnlyCollection <IRepositoryImportStrategy> strategies) { if (authInfo != null) { if (await authInfo.Validate()) { Log.Information($"Validation for {nameof(authInfo)} did not pass."); return(new RepositoryImportResult(string.Empty, true)); } } var strategy = strategies.FirstOrDefault(x => x.Type == repoType); if (strategy == null) { Log.Error($"Unknown Source Code Import type: {repoType}"); return(default);
public AuthInfo(string username, string password, SourceCodeRepositoryType type) { Username = username; Password = password; Type = type; }