Skip to content
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 29 commits into from
Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from all 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 Aug 3, 2017
e2476e0
Mostly Complete
Aug 3, 2017
55d7865
Fixing tests and adding review comments
Aug 3, 2017
07f75d6
Added tests for reactive client
Aug 4, 2017
6374837
Moved Reviews inside fo the Pull request client for better organizati…
Aug 4, 2017
526fb63
Fixing bad recursive function breaking tests
Aug 4, 2017
4a2ea0b
test fixes
Aug 4, 2017
e1eced9
Add paging support to review comments call
Aug 4, 2017
1dea68d
Fixing recursive function
Aug 4, 2017
0f67d12
Addressing comments from PR
hartra344 Aug 7, 2017
83c9fb5
fixing CI break
hartra344 Aug 7, 2017
88adff2
Typo build break
hartra344 Aug 7, 2017
f3f46cd
Fixing Convention Tests
Aug 7, 2017
d852b59
Adding correct nameof() usage in Ensure
Aug 7, 2017
da004be
Small consitancy changes
Aug 7, 2017
b2abae5
Trigger build
Aug 8, 2017
214555b
Address PR Comments
hartra344 Aug 8, 2017
ac46a77
Merge remote-tracking branch 'origin/master'
hartra344 Aug 8, 2017
c6f63a6
Fixup test naming
ryangribble Aug 14, 2017
f8c9fa7
Fix sub client ordering and incorrect URL
ryangribble Aug 14, 2017
39883eb
Tidy up comments and remove StringEnum wrapper from Request models as…
ryangribble Aug 14, 2017
e30627c
Rename GetReview to Get
ryangribble Aug 14, 2017
d7952e5
tweak debugger display
ryangribble Aug 15, 2017
071ee48
Rework integration tests - implement the easy Get/GetAll ones first...
ryangribble Aug 15, 2017
f647844
Implement integration tests for Create method.
ryangribble Aug 15, 2017
418b132
Implement secondary account settings for integration tests and a new …
ryangribble Aug 15, 2017
26c5092
Add integration tests for Delete, Dismiss and Submit methods
ryangribble Aug 15, 2017
0628de8
Attempting to add comments as part of a review revealed that we cant …
ryangribble Aug 15, 2017
d4ec7c3
add second test account user/password to configure-integration-tests …
ryangribble Aug 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 187 additions & 0 deletions Octokit.Reactive/Clients/IObservablePullRequestReviewsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
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> Get(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> Get(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 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 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">The pull request number</param>
/// <param name="reviewId">The pull request review number</param>
IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, int number, long reviewId, ApiOptions options);
}
}
5 changes: 5 additions & 0 deletions Octokit.Reactive/Clients/IObservablePullRequestsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public interface IObservablePullRequestsClient
[Obsolete("Please use IObservablePullRequestsClient.ReviewComment. This will be removed in a future version")]
IObservablePullRequestReviewCommentsClient Comment { get; }

/// <summary>
/// Client for managing reviews.
/// </summary>
IObservablePullRequestReviewsClient Review { get; }

/// <summary>
/// Client for managing review comments.
/// </summary>
Expand Down
Loading