-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the read half of the PR Review API #139
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3db6512
Initial pass to add the read-only PR review API.
mscharley 80839bb
Add inline docs
mscharley a6bf4a3
Remove defunct object
mscharley 71e9b89
Add a getReview endpoint
mscharley da817c3
Add the rest of the tests for this issue
mscharley 11408bc
Review state case class => case object
mscharley ea2934a
Add documentation for this PR
mscharley ec8fd76
Fix various issues with the PR
mscharley 3fe4cf2
Fix derp in the links
mscharley 04eb6e4
Fixes ghost users associated with pull requests, issues and comments
juanpedromoreno 48bb78a
Fix model to allow for ghostly users
mscharley 7ac88b5
Merge branch 'jp-fix-null-users' of github.com:47deg/github4s into GH…
mscharley abb7a87
Fix copy paste woes
mscharley 8c59b89
Merge branch 'master' of github.com:47deg/github4s into GH-133
mscharley 9784ec6
Another minor testing fix
mscharley dbbb7b9
Fix a regression that somehow made it in
mscharley 8652b4b
More minor fixes
mscharley 737ac9f
Fix regression
mscharley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -598,29 +598,57 @@ trait MockGithubApiServer extends MockServerService with FakeResponses with Test | |
""".stripMargin))) | ||
.respond(response.withStatusCode(createdStatusCode).withBody(validCreatePullRequest)) | ||
|
||
//Issues >> list | ||
//PullRequests >> listReviews | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I screwed something up big here. |
||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath(s"/repos/$validRepoOwner/$validRepoName/issues") | ||
.withPath(s"/repos/$validRepoOwner/$validRepoName/pulls/$validPullRequestNumber/reviews") | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(okStatusCode).withBody(listIssuesValidResponse)) | ||
.respond(response.withStatusCode(okStatusCode).withBody(listReviewsValidResponse)) | ||
|
||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath(s"/repos/$validRepoOwner/$invalidRepoName/pulls/$validPullRequestNumber/reviews") | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(notFoundStatusCode).withBody(notFoundResponse)) | ||
|
||
//PullRequests >> getReview | ||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath( | ||
s"/repos/$validRepoOwner/$validRepoName/pulls/$validPullRequestNumber/reviews/$validPullRequestReviewNumber") | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(okStatusCode).withBody(getReviewValidResponse)) | ||
|
||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath( | ||
s"/repos/$validRepoOwner/$invalidRepoName/pulls/$validPullRequestNumber/reviews/$validPullRequestReviewNumber") | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(notFoundStatusCode).withBody(notFoundResponse)) | ||
|
||
//Issues >> list | ||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath(s"/repos/$validRepoOwner/$validRepoName/issues") | ||
.withHeader(not("Authorization"))) | ||
.respond(response.withStatusCode(unauthorizedStatusCode).withBody(unauthorizedResponse)) | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(okStatusCode).withBody(listIssuesValidResponse)) | ||
|
||
mockServer | ||
.when( | ||
request | ||
.withMethod("GET") | ||
.withPath(s"/repos/$validRepoOwner/$invalidRepoName/issues") | ||
.withHeader(not("Authorization"))) | ||
.withHeader("Authorization", tokenHeader)) | ||
.respond(response.withStatusCode(notFoundStatusCode).withBody(notFoundResponse)) | ||
|
||
//Issues >> create | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Since Reviews are a "sub-API" of the pull request API, we usually do subsections, so you'll end up with:
Pull request
List pull requests
...
Reviews
List reviews
Get an individual review