Esempio n. 1
0
 public GitLabLinkTask(ILogger <GitLabLinkTask> logger, ChangeLogConfiguration configuration, IGitRepository repository, IGitLabClientFactory clientFactory)
 {
     m_Logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     m_Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     m_Repository    = repository ?? throw new ArgumentNullException(nameof(repository));
     m_ClientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
 }
Esempio n. 2
0
        public GitLabLinkTask(ILogger <GitLabLinkTask> logger, IGitRepository repository, IGitLabClientFactory clientFactory)
        {
            m_Logger        = logger ?? throw new ArgumentNullException(nameof(logger));
            m_Repository    = repository ?? throw new ArgumentNullException(nameof(repository));
            m_ClientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));

            // TODO: Allow configuration of remote name
            // TODO: Allow bypassing parsing by setting project info in the config file
            var remote = m_Repository.Remotes.FirstOrDefault(r => StringComparer.OrdinalIgnoreCase.Equals(r.Name, "origin"));

            if (remote != null && GitLabUrlParser.TryParseRemoteUrl(remote.Url, out var projectInfo))
            {
                m_ProjectInfo = projectInfo;
            }
            else
            {
                m_Logger.LogWarning("Failed to determine GitLab project path. Disabling GitLab integration");
            }
        }
Esempio n. 3
0
 public DeleteGitBranchesInBuildChainUseCase(ITeamCityClient client, IGitLabClientFactory gitLabClientFactory)
 {
     _client = client;
     _gitLabClientFactory = gitLabClientFactory;
 }
Esempio n. 4
0
 public VcsRootHelper(ITeamCityClient client, IGitRepositoryFactory gitRepositoryFactory, IGitLabClientFactory gitLabClientFactory)
 {
     _client = client;
     _gitRepositoryFactory = gitRepositoryFactory;
     _gitLabClientFactory  = gitLabClientFactory;
 }