Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 09da406

Browse files
Specifying the pull request node id
1 parent 27b2ed5 commit 09da406

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/GitHub.InlineReviews/Services/IPullRequestSessionService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
261261
/// </summary>
262262
/// <param name="localRepository">The local repository.</param>
263263
/// <param name="user">The user posting the comment.</param>
264-
/// <param name="pullRequestId">The pull request number.</param>
264+
/// <param name="pullRequestNodeId">The pull request node id.</param>
265265
/// <param name="body">The comment body.</param>
266266
/// <param name="commitId">THe SHA of the commit to comment on.</param>
267267
/// <param name="path">The relative path of the file to comment on.</param>
@@ -273,7 +273,7 @@ Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
273273
/// </remarks>
274274
Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(ILocalRepositoryModel localRepository,
275275
IAccount user,
276-
int pullRequestId,
276+
string pullRequestNodeId,
277277
string body,
278278
string commitId,
279279
string path,
@@ -284,13 +284,13 @@ Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(ILocalRepositor
284284
/// </summary>
285285
/// <param name="localRepository">The local repository.</param>
286286
/// <param name="user">The user posting the comment.</param>
287-
/// <param name="pullRequestId">The pull request number.</param>
287+
/// <param name="pullRequestNodeId">The pull request node id.</param>
288288
/// <param name="body">The comment body.</param>
289289
/// <param name="inReplyTo">The comment ID to reply to.</param>
290290
/// <returns>A model representing the posted comment.</returns>
291291
Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentReply(ILocalRepositoryModel localRepository,
292292
IAccount user,
293-
int pullRequestId,
293+
string pullRequestNodeId,
294294
string body,
295295
int inReplyTo);
296296

src/GitHub.InlineReviews/Services/PullRequestSession.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ public async Task<IPullRequestReviewCommentModel> PostReviewComment(
138138

139139
if (!HasPendingReview)
140140
{
141+
var pullRequestNodeId = await GetPullRequestNodeId();
141142
model = await service.PostStandaloneReviewComment(
142143
LocalRepository,
143144
User,
144-
PullRequest.Number,
145+
pullRequestNodeId,
145146
body,
146147
commitId,
147148
path,
@@ -200,10 +201,11 @@ public async Task<IPullRequestReviewCommentModel> PostReviewComment(
200201

201202
if (!HasPendingReview)
202203
{
204+
var pullRequestNodeId = await GetPullRequestNodeId();
203205
model = await service.PostStandaloneReviewCommentReply(
204206
LocalRepository,
205207
User,
206-
PullRequest.Number,
208+
pullRequestNodeId,
207209
body,
208210
inReplyTo);
209211
}

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public async Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
529529
public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
530530
ILocalRepositoryModel localRepository,
531531
IAccount user,
532-
int pullRequestId,
532+
string pullRequestNodeId,
533533
string body,
534534
string commitId,
535535
string path,
@@ -543,7 +543,7 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
543543
Body = body,
544544
CommitOID = commitId,
545545
Event = Octokit.GraphQL.Model.PullRequestReviewEvent.Comment,
546-
PullRequestId = pullRequestId.ToString(),
546+
PullRequestId = pullRequestNodeId,
547547
Comments = new[]
548548
{
549549
new DraftPullRequestReviewComment
@@ -586,11 +586,11 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
586586
public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentReply(
587587
ILocalRepositoryModel localRepository,
588588
IAccount user,
589-
int pullRequestId,
589+
string pullRequestNodeId,
590590
string body,
591591
int inReplyTo)
592592
{
593-
var review = await CreatePendingReview(localRepository, user, pullRequestId.ToString());
593+
var review = await CreatePendingReview(localRepository, user, pullRequestNodeId);
594594
var comment = await PostPendingReviewCommentReply(localRepository, user, review.Id.ToString(), body, inReplyTo.ToString());
595595
return comment;
596596
}

0 commit comments

Comments
 (0)