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

Commit 5de66ad

Browse files
Correcting the remaining usages of node ids
1 parent b58ae5b commit 5de66ad

File tree

8 files changed

+13
-17
lines changed

8 files changed

+13
-17
lines changed

src/GitHub.Exports.Reactive/Services/IPullRequestSession.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,10 @@ Task<IPullRequestReviewCommentModel> PostReviewComment(
109109
/// Posts a PR review comment reply.
110110
/// </summary>
111111
/// <param name="body">The comment body.</param>
112-
/// <param name="inReplyTo">The REST ID of the comment to reply to.</param>
113112
/// <param name="inReplyToNodeId">The GraphQL ID of the comment to reply to.</param>
114113
/// <returns>A comment model.</returns>
115114
Task<IPullRequestReviewCommentModel> PostReviewComment(
116115
string body,
117-
int inReplyTo,
118116
string inReplyToNodeId);
119117

120118
/// <summary>

src/GitHub.InlineReviews/Services/IPullRequestSessionService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(ILocalRepositor
286286
/// <param name="user">The user posting the comment.</param>
287287
/// <param name="pullRequestNodeId">The pull request node id.</param>
288288
/// <param name="body">The comment body.</param>
289-
/// <param name="inReplyTo">The comment ID to reply to.</param>
289+
/// <param name="inReplyToNodeId">The comment node id to reply to.</param>
290290
/// <returns>A model representing the posted comment.</returns>
291291
Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentReply(ILocalRepositoryModel localRepository,
292292
IAccount user,
293293
string pullRequestNodeId,
294294
string body,
295-
int inReplyTo);
295+
string inReplyToNodeId);
296296

297297
/// <summary>
298298
/// Delete a PR review comment.

src/GitHub.InlineReviews/Services/PullRequestSession.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,18 @@ public async Task<IPullRequestReviewCommentModel> EditComment(string commentNode
194194
/// <inheritdoc/>
195195
public async Task<IPullRequestReviewCommentModel> PostReviewComment(
196196
string body,
197-
int inReplyTo,
198197
string inReplyToNodeId)
199198
{
200199
IPullRequestReviewCommentModel model;
201200

202201
if (!HasPendingReview)
203202
{
204-
var pullRequestNodeId = await GetPullRequestNodeId();
205203
model = await service.PostStandaloneReviewCommentReply(
206204
LocalRepository,
207205
User,
208206
pullRequestNodeId,
209207
body,
210-
inReplyTo);
208+
inReplyToNodeId);
211209
}
212210
else
213211
{

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
574574
OriginalCommitId = x.OriginalCommit.Oid,
575575
PullRequestReviewId = x.PullRequestReview.DatabaseId.Value,
576576
User = user,
577-
IsPending = true,
577+
IsPending = false
578578
}));
579579

580580
var result = (await graphql.Run(mutation)).First();
@@ -588,10 +588,11 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentRep
588588
IAccount user,
589589
string pullRequestNodeId,
590590
string body,
591-
int inReplyTo)
591+
string inReplyToNodeId)
592592
{
593593
var review = await CreatePendingReview(localRepository, user, pullRequestNodeId);
594-
var comment = await PostPendingReviewCommentReply(localRepository, user, review.Id.ToString(), body, inReplyTo.ToString());
594+
var comment = await PostPendingReviewCommentReply(localRepository, user, review.NodeId, body, inReplyToNodeId);
595+
await SubmitPendingReview(localRepository, user, review.NodeId, null, PullRequestReviewEvent.Comment);
595596
return comment;
596597
}
597598

src/GitHub.InlineReviews/ViewModels/InlineCommentThreadViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ async Task<ICommentModel> DoPostComment(object parameter)
7272
Guard.ArgumentNotNull(parameter, nameof(parameter));
7373

7474
var body = (string)parameter;
75-
var replyId = Comments[0].Id;
7675
var nodeId = Comments[0].NodeId;
77-
return await Session.PostReviewComment(body, replyId, nodeId);
76+
return await Session.PostReviewComment(body, nodeId);
7877
}
7978

8079
async Task<ICommentModel> DoEditComment(object parameter)

test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,14 @@ public async Task PostsReplyToCorrectForkWithNoPendingReview()
536536
var service = CreateService();
537537
var target = CreateTarget(service, "fork", "owner", false);
538538

539-
await target.PostReviewComment("New Comment", 1, "node1");
539+
await target.PostReviewComment("New Comment", "node1");
540540

541541
await service.Received(1).PostStandaloneReviewCommentReply(
542542
target.LocalRepository,
543543
target.User,
544544
PullRequestNodeId,
545545
"New Comment",
546-
1);
546+
"node1");
547547
}
548548

549549
[Test]
@@ -570,7 +570,7 @@ public async Task PostsReplyToCorrectForkWithPendingReview()
570570
var service = CreateService();
571571
var target = CreateTarget(service, "fork", "owner", true);
572572

573-
await target.PostReviewComment("New Comment", 1, "node1");
573+
await target.PostReviewComment("New Comment", "node1");
574574

575575
await service.Received(1).PostPendingReviewCommentReply(
576576
target.LocalRepository,

test/GitHub.InlineReviews.UnitTests/ViewModels/InlineCommentPeekViewModelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public async Task CommittingEditDoesntRetainSubmittedCommentInPlaceholderAfterPo
210210

211211
Assert.That(2, Is.EqualTo(target.Thread.Comments.Count));
212212

213-
sessionManager.CurrentSession.PostReviewComment(null, 0, null)
213+
sessionManager.CurrentSession.PostReviewComment(null, null)
214214
.ReturnsForAnyArgs(async x =>
215215
{
216216
var file = await sessionManager.GetLiveFile(

test/GitHub.InlineReviews.UnitTests/ViewModels/InlineCommentThreadViewModelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void PostsCommentInReplyToCorrectComment()
6565
target.Comments[2].Body = "New Comment";
6666
target.Comments[2].CommitEdit.Execute(null);
6767

68-
session.Received(1).PostReviewComment("New Comment", 1, "node1");
68+
session.Received(1).PostReviewComment("New Comment", "node1");
6969
}
7070

7171
IApiClient CreateApiClient()

0 commit comments

Comments
 (0)