44using System . Threading . Tasks ;
55using GitHub . Models ;
66using Microsoft . VisualStudio . Text ;
7+ using Octokit ;
78
89namespace GitHub . InlineReviews . Services
910{
@@ -142,6 +143,18 @@ Task<byte[]> ExtractFileFromGit(
142143 /// </returns>
143144 Task < string > GetPullRequestMergeBase ( ILocalRepositoryModel repository , IPullRequestModel pullRequest ) ;
144145
146+ /// <summary>
147+ /// Gets the GraphQL ID for a pull request.
148+ /// </summary>
149+ /// <param name="repository">The local repository.</param>
150+ /// <param name="repositoryOwner">The owner of the remote fork.</param>
151+ /// <param name="number">The pull request number.</param>
152+ /// <returns></returns>
153+ Task < string > GetGraphQLPullRequestId (
154+ ILocalRepositoryModel localRepository ,
155+ string repositoryOwner ,
156+ int number ) ;
157+
145158 /// <summary>
146159 /// Creates a rebuild signal subject for a <see cref="IPullRequestSessionLiveFile"/>.
147160 /// </summary>
@@ -157,7 +170,84 @@ Task<byte[]> ExtractFileFromGit(
157170 ISubject < ITextSnapshot , ITextSnapshot > CreateRebuildSignal ( ) ;
158171
159172 /// <summary>
160- /// Posts a new PR review comment.
173+ /// Creates a new pending review on the server.
174+ /// </summary>
175+ /// <param name="localRepository">The local repository.</param>
176+ /// <param name="user">The user posting the review.</param>
177+ /// <param name="pullRequestId">The GraphQL ID of the pull request.</param>
178+ /// <returns></returns>
179+ Task < IPullRequestReviewModel > CreatePendingReview (
180+ ILocalRepositoryModel localRepository ,
181+ IAccount user ,
182+ string pullRequestId ) ;
183+
184+ /// <summary>
185+ /// Posts PR review with no comments.
186+ /// </summary>
187+ /// <param name="localRepository">The local repository.</param>
188+ /// <param name="remoteRepositoryOwner">The owner of the repository fork to post to.</param>
189+ /// <param name="user">The user posting the review.</param>
190+ /// <param name="number">The pull request number.</param>
191+ /// <param name="commitId">The SHA of the commit being reviewed.</param>
192+ /// <param name="body">The review body.</param>
193+ /// <param name="e">The review event.</param>
194+ Task < IPullRequestReviewModel > PostReview (
195+ ILocalRepositoryModel localRepository ,
196+ string remoteRepositoryOwner ,
197+ IAccount user ,
198+ int number ,
199+ string commitId ,
200+ string body ,
201+ PullRequestReviewEvent e ) ;
202+
203+ /// <summary>
204+ /// Submits a pending PR review.
205+ /// </summary>
206+ /// <param name="localRepository">The local repository.</param>
207+ /// <param name="user">The user posting the review.</param>
208+ /// <param name="pendingReviewId">The GraphQL ID of the pending review.</param>
209+ /// <param name="body">The review body.</param>
210+ /// <param name="e">The review event.</param>
211+ Task < IPullRequestReviewModel > SubmitPendingReview (
212+ ILocalRepositoryModel localRepository ,
213+ IAccount user ,
214+ string pendingReviewId ,
215+ string body ,
216+ PullRequestReviewEvent e ) ;
217+
218+ /// <summary>
219+ /// Posts a new pending PR review comment.
220+ /// </summary>
221+ /// <param name="localRepository">The local repository.</param>
222+ /// <param name="user">The user posting the comment.</param>
223+ /// <param name="pendingReviewId">The GraphQL ID of the pending review.</param>
224+ /// <param name="body">The comment body.</param>
225+ /// <param name="commitId">THe SHA of the commit to comment on.</param>
226+ /// <param name="path">The relative path of the file to comment on.</param>
227+ /// <param name="position">The line index in the diff to comment on.</param>
228+ /// <returns>A model representing the posted comment.</returns>
229+ /// <remarks>
230+ /// The method posts a new pull request comment to a pending review started by
231+ /// <see cref="CreatePendingReview(ILocalRepositoryModel, IAccount, string)"/>.
232+ /// </remarks>
233+ Task < IPullRequestReviewCommentModel > PostPendingReviewComment (
234+ ILocalRepositoryModel localRepository ,
235+ IAccount user ,
236+ string pendingReviewId ,
237+ string body ,
238+ string commitId ,
239+ string path ,
240+ int position ) ;
241+
242+ Task < IPullRequestReviewCommentModel > PostPendingReviewCommentReply (
243+ ILocalRepositoryModel localRepository ,
244+ IAccount user ,
245+ string pendingReviewId ,
246+ string body ,
247+ string inReplyTo ) ;
248+
249+ /// <summary>
250+ /// Posts a new standalone PR review comment.
161251 /// </summary>
162252 /// <param name="localRepository">The local repository.</param>
163253 /// <param name="remoteRepositoryOwner">The owner of the repository fork to post to.</param>
@@ -168,7 +258,11 @@ Task<byte[]> ExtractFileFromGit(
168258 /// <param name="path">The relative path of the file to comment on.</param>
169259 /// <param name="position">The line index in the diff to comment on.</param>
170260 /// <returns>A model representing the posted comment.</returns>
171- Task < IPullRequestReviewCommentModel > PostReviewComment (
261+ /// <remarks>
262+ /// The method posts a new standalone pull request comment that is not attached to a pending
263+ /// pull request review.
264+ /// </remarks>
265+ Task < IPullRequestReviewCommentModel > PostStandaloneReviewComment (
172266 ILocalRepositoryModel localRepository ,
173267 string remoteRepositoryOwner ,
174268 IAccount user ,
@@ -188,7 +282,7 @@ Task<IPullRequestReviewCommentModel> PostReviewComment(
188282 /// <param name="body">The comment body.</param>
189283 /// <param name="inReplyTo">The comment ID to reply to.</param>
190284 /// <returns>A model representing the posted comment.</returns>
191- Task < IPullRequestReviewCommentModel > PostReviewComment (
285+ Task < IPullRequestReviewCommentModel > PostStandaloneReviewCommentRepy (
192286 ILocalRepositoryModel localRepository ,
193287 string remoteRepositoryOwner ,
194288 IAccount user ,
0 commit comments