-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement Review API for Pull Requests #1648
Merged
Merged
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8b34c32
First Iteration Need to finish tests and docs
hartra344 e2476e0
Mostly Complete
55d7865
Fixing tests and adding review comments
07f75d6
Added tests for reactive client
6374837
Moved Reviews inside fo the Pull request client for better organizati…
526fb63
Fixing bad recursive function breaking tests
4a2ea0b
test fixes
e1eced9
Add paging support to review comments call
1dea68d
Fixing recursive function
0f67d12
Addressing comments from PR
hartra344 83c9fb5
fixing CI break
hartra344 88adff2
Typo build break
hartra344 f3f46cd
Fixing Convention Tests
d852b59
Adding correct nameof() usage in Ensure
da004be
Small consitancy changes
b2abae5
Trigger build
214555b
Address PR Comments
hartra344 ac46a77
Merge remote-tracking branch 'origin/master'
hartra344 c6f63a6
Fixup test naming
ryangribble f8c9fa7
Fix sub client ordering and incorrect URL
ryangribble 39883eb
Tidy up comments and remove StringEnum wrapper from Request models as…
ryangribble e30627c
Rename GetReview to Get
ryangribble d7952e5
tweak debugger display
ryangribble 071ee48
Rework integration tests - implement the easy Get/GetAll ones first...
ryangribble f647844
Implement integration tests for Create method.
ryangribble 418b132
Implement secondary account settings for integration tests and a new …
ryangribble 26c5092
Add integration tests for Delete, Dismiss and Submit methods
ryangribble 0628de8
Attempting to add comments as part of a review revealed that we cant …
ryangribble d4ec7c3
add second test account user/password to configure-integration-tests …
ryangribble 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
188 changes: 188 additions & 0 deletions
188
Octokit.Reactive/Clients/IObservablePullRequestReviewClient.cs
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 |
---|---|---|
@@ -0,0 +1,188 @@ | ||
using System; | ||
using System.Reactive; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Pull Request Review API. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/pulls/reviews/">Review API documentation</a> for more information. | ||
/// </remarks> | ||
public interface IObservablePullRequestReviewsClient | ||
{ | ||
/// <summary> | ||
/// Gets reviews for a specified pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
IObservable<PullRequestReview> GetAll(string owner, string name, int number); | ||
|
||
/// <summary> | ||
/// Gets reviews for a specified pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
IObservable<PullRequestReview> GetAll(long repositoryId, int number); | ||
|
||
/// <summary> | ||
/// Gets reviews for a specified pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
IObservable<PullRequestReview> GetAll(string owner, string name, int number, ApiOptions options); | ||
|
||
/// <summary> | ||
/// Gets reviews for a specified pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
IObservable<PullRequestReview> GetAll(long repositoryId, int number, ApiOptions options); | ||
|
||
/// <summary> | ||
/// Gets a single pull request review by ID. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-a-single-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReview> GetReview(string owner, string name, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Gets a single pull request review by ID. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-a-single-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReview> GetReview(long repositoryId, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Creates a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The Pull Request number</param> | ||
/// <param name="review">The review</param> | ||
IObservable<PullRequestReview> Create(string owner, string name, int number, PullRequestReviewCreate review); | ||
|
||
/// <summary> | ||
/// Creates a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The Pull Request number</param> | ||
/// <param name="review">The review</param> | ||
IObservable<PullRequestReview> Create(long repositoryId, int number, PullRequestReviewCreate review); | ||
|
||
/// <summary> | ||
/// Deletes a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<Unit> Delete(string owner, string name, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Deletes a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<Unit> Delete(long repositoryId, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Submits an event to a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
/// <param name="submitMessage">The message and event being submitted for the review</param> | ||
IObservable<PullRequestReview> Submit(string owner, string name, int number, long reviewId, PullRequestReviewSubmit submitMessage); | ||
|
||
/// <summary> | ||
/// Submits an event to a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
/// <param name="submitMessage">The message and event being submitted for the review</param> | ||
IObservable<PullRequestReview> Submit(long repositoryId, int number, long reviewId, PullRequestReviewSubmit submitMessage); | ||
|
||
/// <summary> | ||
/// Dismisses a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
/// <param name="dismissMessage">The message indicating why the review was dismissed</param> | ||
IObservable<PullRequestReview> Dismiss(string owner, string name, int number, long reviewId, PullRequestReviewDismiss dismissMessage); | ||
|
||
/// <summary> | ||
/// Dismisses a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
/// <param name="dismissMessage">The message indicating why the review was dismissed</param> | ||
IObservable<PullRequestReview> Dismiss(long repositoryId, int number, long reviewId, PullRequestReviewDismiss dismissMessage); | ||
|
||
/// <summary> | ||
/// Lists comments for a single review | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(string owner, string name, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Dismisses a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, int number, long reviewId); | ||
|
||
/// <summary> | ||
/// Lists comments for a single review | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review</remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="number">The pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(string owner, string name, int number, long reviewId, ApiOptions options); | ||
|
||
/// <summary> | ||
/// Dismisses a pull request review. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review</remarks> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="number">TThe pull request number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, int number, long reviewId, ApiOptions options); | ||
|
||
} | ||
} |
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.
remove extra whitespace line