-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Nest review comments under reviews. #1613
Conversation
Previously we were loading a flat list of PR review comments into the `PullRequestModel`. GraphQL nests review comments under their relevant review. Reflect this in our models as it makes more sense.
268a230 to
48ca7c7
Compare
StanleyGoldman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is just a spelling thing that I found.
Otherwise looks good.
Gonna test some.
| /// <returns>A model representing the posted comment.</returns> | ||
| Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentRepy( | ||
| /// <returns>A model representing the review for the posted comment.</returns> | ||
| Task<IPullRequestReviewModel> PostStandaloneReviewCommentRepy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repy should probably be Reply
jcansdale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good and working well. Just one minor suggestion re: use of arrays.
|
|
||
| public IReadOnlyList<IPullRequestReviewCommentModel> Comments | ||
| { | ||
| get { return comments ?? (comments = new IPullRequestReviewCommentModel[0]); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use:
get { return comments ?? Array.Empty<IPullRequestReviewCommentModel>(); }
Which I believe always returns the same singleton empty array.
Which should always return the same singleton empty array.
|
@StanleyGoldman could I get a 👍 on this? Fixed the misspelling. |
| } | ||
| } | ||
|
|
||
| IAccount assignee; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove that?
drguthals
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing
|
Tested and LGTM 👍 |
|
Superseded by #1712. |
Previously we were loading a flat list of PR review comments into the
PullRequestModel.ReviewCommentsproperty because this is how they were exposed in the REST API.GraphQL nests review comments under their relevant review, which makes a lot more sense, so this PR removes
PullRequestModel.ReviewCommentsand moves them toPullRequestReviewModel.Comments.This is the first step towards GraphQL-ification of Pull Requests; in upcoming PRs I intend to further this process by reading pull request models using purely GraphQL. At this point there are still a few hacks in place, and paging of PR reviews and review comments is not implemented. This will be addressed in upcoming PRs.