-
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
Changes from 9 commits
8b34c32
e2476e0
55d7865
07f75d6
6374837
526fb63
4a2ea0b
e1eced9
1dea68d
0f67d12
83c9fb5
88adff2
f3f46cd
d852b59
da004be
b2abae5
214555b
ac46a77
c6f63a6
f8c9fa7
39883eb
e30627c
d7952e5
071ee48
f647844
418b132
26c5092
0628de8
d4ec7c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
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 IObservablePullRequestReviewClient | ||
{ | ||
/// <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="pullRequestId">The pull request number</param> | ||
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. please name the variable This comment applies to multiple files on the PR - if you can please fixup all references to pull request numbers to be called |
||
IObservable<PullRequestReview> GetAll(string owner, string name, int pullRequestId); | ||
|
||
/// <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="pullRequestId">The pull request number</param> | ||
IObservable<PullRequestReview> GetAll(long repositoryId, int pullRequestId); | ||
|
||
/// <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="pullRequestId">The pull request number</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
IObservable<PullRequestReview> GetAll(string owner, string name, int pullRequestId, 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="pullRequestId">The pull request number</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
IObservable<PullRequestReview> GetAll(long repositoryId, int pullRequestId, 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReview> GetReview(string owner, string name, int pullRequestId, int 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReview> GetReview(long repositoryId, int pullRequestId, int reviewId); | ||
|
||
/// <summary> | ||
/// Creates a comment on a pull review. | ||
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. Is this right? This method actually creates the pull request review (not just a comment), right? |
||
/// </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="pullRequestId">The Pull Request number</param> | ||
/// <param name="review">The review</param> | ||
IObservable<PullRequestReview> Create(string owner, string name, int pullRequestId, PullRequestReviewCreate review); | ||
|
||
/// <summary> | ||
/// Creates a comment on a pull 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="pullRequestId">The Pull Request number</param> | ||
/// <param name="review">The review</param> | ||
IObservable<PullRequestReview> Create(long repositoryId, int pullRequestId, 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<Unit> Delete(string owner, string name, int pullRequestId, int 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<Unit> Delete(long repositoryId, int pullRequestId, int 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="pullRequestId">The pull request review comment 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 pullRequestId, int 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="pullRequestId">The pull request review comment 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 pullRequestId, int 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="pullRequestId">The pull request review comment 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 pullRequestId, int 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="pullRequestId">The pull request review comment 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 pullRequestId, int 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(string owner, string name, int pullRequestId, int reviewId); | ||
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. We will need to poke the API to see whether this GetAllComments method needs to support 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. |
||
|
||
/// <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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, int pullRequestId, int 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(string owner, string name, int pullRequestId, int 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="pullRequestId">The pull request review comment number</param> | ||
/// <param name="reviewId">The pull request review number</param> | ||
IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, int pullRequestId, int reviewId, ApiOptions options); | ||
|
||
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. remove extra whitespace line |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ public interface IObservablePullRequestsClient | |
/// </summary> | ||
IObservablePullRequestReviewRequestsClient ReviewRequest { get; } | ||
|
||
|
||
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. whitespace 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. Missing XmlDoc comment |
||
IObservablePullRequestReviewClient PullRequestReview { get; } | ||
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. Since we are already in the Similar to how eg we have I also like to place it in the class in the same location that the API doc structure/tree indicate, so in this case it should be above |
||
/// <summary> | ||
/// Gets a single Pull Request by number. | ||
/// </summary> | ||
|
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.
From a "naming things" perspective we have a convention where we name the classes/interfaces as a plural - eg in this case
IObservablePullRequestReviewsClient
if you are able to rename the classes/interfaces and files?