/// <summary>
        /// Marks resolved comment threads created by this logic with active issues as active.
        /// </summary>
        /// <param name="discussionThreadsCapability">Pull request system capability for working with discussion threads.</param>
        /// <param name="existingThreads">Existing discussion threads on the pull request.</param>
        /// <param name="issueComments">Issues and their related existing comments on the pull request.</param>
        /// <param name="reportIssuesToPullRequestSettings">Settings for posting the issues.</param>
        private void ReopenExistingComments(
            ISupportDiscussionThreads discussionThreadsCapability,
            IReadOnlyCollection <IPullRequestDiscussionThread> existingThreads,
            IDictionary <IIssue, IssueCommentInfo> issueComments,
            IReportIssuesToPullRequestSettings reportIssuesToPullRequestSettings)
        {
            existingThreads.NotNull(nameof(existingThreads));
            issueComments.NotNull(nameof(issueComments));
            reportIssuesToPullRequestSettings.NotNull(nameof(reportIssuesToPullRequestSettings));

            if (!existingThreads.Any())
            {
                this.log.Verbose("No existings threads to reopen.");
                return;
            }

            var threadsToReopen =
                this.GetThreadsToReopen(existingThreads, issueComments, reportIssuesToPullRequestSettings).ToList();

            this.log.Verbose("Reopen {0} threads...", threadsToReopen.Count);
            discussionThreadsCapability.ReopenDiscussionThreads(threadsToReopen);
        }
Beispiel #2
0
        /// <summary>
        /// Marks comment threads created by this logic but without active issues as resolved.
        /// </summary>
        /// <param name="discussionThreadsCapability">Pull request system capability for working with discussion threads.</param>
        /// <param name="existingThreads">Existing discussion threads on the pull request.</param>
        /// <param name="issueComments">Issues and their related existing comments on the pull request.</param>
        /// <param name="reportIssuesToPullRequestSettings">Settings for posting the issues.</param>
        private void ResolveExistingComments(
            ISupportDiscussionThreads discussionThreadsCapability,
            IList <IPullRequestDiscussionThread> existingThreads,
            IDictionary <IIssue, IssueCommentInfo> issueComments,
            ReportIssuesToPullRequestSettings reportIssuesToPullRequestSettings)
        {
            existingThreads.NotNull(nameof(existingThreads));
            issueComments.NotNull(nameof(issueComments));
            reportIssuesToPullRequestSettings.NotNull(nameof(reportIssuesToPullRequestSettings));

            if (!existingThreads.Any())
            {
                this.log.Verbose("No existings threads to resolve.");
                return;
            }

            var threadsToResolve =
                this.GetThreadsToResolve(existingThreads, issueComments, reportIssuesToPullRequestSettings).ToList();

            this.log.Verbose("Mark {0} threads as fixed...", threadsToResolve.Count);
            discussionThreadsCapability.ResolveDiscussionThreads(threadsToResolve);
        }