This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
WIP: Read PR details using GraphQL #1648
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Changed files not yet exposed by GraphQL - we're still going to need to read that using REST for now.
Via REST as not yet exposed via GraphQL. Also read UpdatedAt.
Contributor
Author
|
Marked this as WIP because now Octokit.GraphQL has auto-paging need to update it to use that. |
Which should always return the same singleton empty array.
Contributor
Author
|
Superseded by #1712 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Use GraphQL to read the PR details in
ModelService.GetPullRequestinstead of using the ugly mix of REST and GraphQL that we were using before.NOTE: The list of changed files in a PR are not exposed yet via GraphQL so we still need to use REST for these.
Implementation Notes
The query currently only reads the first 100 comments of the first 100 reviews for each PR. Will this be a problem? Paging with GraphQL is hard currently, we need to add support for automatic paging to Octokit.GraphQL.
Added a default constructor to
PullRequestModeland made itsNumberproperty read/write so that all properties can be set from an initializer rather than requiring a mix of ctor parameters and initializers.Testing
Nothing user-visible should change, or more precisely nothing should break, when interacting with the Pull Request detail view and PR reviews..
Depends on #1613