Beispiel #1
0
        /// <summary>
        /// Creates a report from a list of issues.
        /// </summary>
        /// <param name="issueProviders">Issue providers which should be used to get the issues.</param>
        /// <param name="reportFormat">Report format to use.</param>
        /// <returns>Path to the created report or <c>null</c> if report could not be created.</returns>
        public FilePath CreateReport(IEnumerable <IIssueProvider> issueProviders, IIssueReportFormat reportFormat)
        {
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));
            reportFormat.NotNull(nameof(reportFormat));

            var issuesReader = new IssuesReader(this.log, issueProviders, this.settings);
            var issues       = issuesReader.ReadIssues(IssueCommentFormat.PlainText);

            return(this.CreateReport(issues, reportFormat));
        }
Beispiel #2
0
        /// <summary>
        /// Runs the orchestrator.
        /// Posts new issues, ignoring duplicate comments and resolves comments that were open in an old iteration
        /// of the pull request.
        /// </summary>
        /// <param name="issueProviders">List of issue providers to use.</param>
        /// <returns>Information about the reported and written issues.</returns>
        public PullRequestIssueResult Run(IEnumerable <IIssueProvider> issueProviders)
        {
            // ReSharper disable once PossibleMultipleEnumeration
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));

            // ReSharper disable once PossibleMultipleEnumeration
            var issuesReader =
                new IssuesReader(this.log, issueProviders, this.settings);

            return(this.Run(issuesReader.ReadIssues()));
        }
        /// <summary>
        /// Creates a report from a list of issues.
        /// </summary>
        /// <param name="issueProviders">Issue providers which should be used to get the issues.</param>
        /// <param name="reportFormat">Report format to use.</param>
        /// <param name="settings">Settings to use.</param>
        /// <returns>Path to the created report or <c>null</c> if report could not be created.</returns>
        public FilePath CreateReport(
            IEnumerable <IIssueProvider> issueProviders,
            IIssueReportFormat reportFormat,
            ICreateIssueReportFromIssueProviderSettings settings)
        {
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));
            reportFormat.NotNull(nameof(reportFormat));
            settings.NotNull(nameof(settings));

            var issuesReader = new IssuesReader(this.log, issueProviders, settings);
            var issues       = issuesReader.ReadIssues();

            return(this.CreateReport(issues, reportFormat, settings));
        }
Beispiel #4
0
        /// <summary>
        /// Runs the orchestrator.
        /// Posts new issues, ignoring duplicate comments and resolves comments that were open in an old iteration
        /// of the pull request.
        /// </summary>
        /// <param name="issueProviders">List of issue providers to use.</param>
        /// <returns>Information about the reported and written issues.</returns>
        public PullRequestIssueResult Run(IEnumerable <IIssueProvider> issueProviders)
        {
            // ReSharper disable once PossibleMultipleEnumeration
            issueProviders.NotNullOrEmptyOrEmptyElement(nameof(issueProviders));

            var format = IssueCommentFormat.Undefined;

            if (this.pullRequestSystemInitialized)
            {
                format = this.pullRequestSystem.GetPreferredCommentFormat();
                this.log.Verbose("Pull request system prefers comments in {0} format.", format);
            }

            // ReSharper disable once PossibleMultipleEnumeration
            var issuesReader =
                new IssuesReader(this.log, issueProviders, this.settings);

            return(this.Run(issuesReader.ReadIssues(format)));
        }
Beispiel #5
0
        public IEnumerable <IIssue> ReadIssues()
        {
            var issueReader = new IssuesReader(this.Log, this.IssueProviders, this.Settings);

            return(issueReader.ReadIssues());
        }
Beispiel #6
0
        public IEnumerable <IIssue> ReadIssues(IssueCommentFormat format)
        {
            var issueReader = new IssuesReader(this.Log, this.IssueProviders, this.Settings);

            return(issueReader.ReadIssues(format));
        }