-
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
Add Pull Request Review Request API. #1588
Merged
ryangribble
merged 25 commits into
octokit:master
from
gdziadkiewicz:PullRequestReviewRequestAPI
May 14, 2017
Merged
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ce66988
Add Pull Request Review Request API.
gdziadkiewicz 1e3512f
Merge branch 'master' into PullRequestReviewRequestAPI
gdziadkiewicz 2624676
Add Reactive Pull Request Review Request API.
gdziadkiewicz 91ada35
Add PullRequestReviewRequestClient tests.
gdziadkiewicz 5169aec
Add ObservablePullRequestReviewRequestClient tests.
gdziadkiewicz 36e6f02
Fix sub-client property naming.
gdziadkiewicz 55deff2
Remove redundant model and update PullRequest model.
gdziadkiewicz 896cfae
Add repositoryId based methods and missing Observable documentation.
gdziadkiewicz 59056ec
Add missing parameter to PullRequest ctor.
cae3701
Merge branch 'master' into PullRequestReviewRequestAPI
gdziadkiewicz bc9a8d0
Add integration tests for PullRequestReviewRequest.
gdziadkiewicz 7cf3331
Upgrade PullRequestReviewRequest integration tests.
gdziadkiewicz 2ee3be3
Add integration tests for repositoryId methods and fix url bug.
gdziadkiewicz 0be9f19
Add missing unit tests and fix PR issues.
gdziadkiewicz 995d4d8
Add pagination support for PullRequestReviewRequst.GetAll and tests f…
gdziadkiewicz fab5a03
Merge branch 'master' into PullRequestReviewRequestAPI
gdziadkiewicz bfcd1de
Revert changes on `PullRequestReviewCommentsClientTests.cs`
gdziadkiewicz 4b348be
Small upgrades - remove unused using and compress property to express…
gdziadkiewicz b62601a
Revert use of expression body in property.
gdziadkiewicz 802022e
Add pagination tests for PullRequestReviewRequest.GetAll.
gdziadkiewicz d6b7161
Change pagination tests to use 2 users.
5c9d9da
Correct class/file name
ryangribble a093315
Reword the integration test names for consistency
ryangribble 57d0d49
Fix DebuggerDisplay of requested reviewers
ryangribble e194682
fix reviewRequestToCreate parameter to be consistent
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
45 changes: 45 additions & 0 deletions
45
Octokit.Reactive/Clients/IObservablePullRequestReviewRequestsClient.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,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reactive; | ||
using System.Threading.Tasks; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Pull Request Review Requests API. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/pulls/review_requests/">Review Requests API documentation</a> for more information. | ||
/// </remarks> | ||
public interface IObservablePullRequestReviewRequestsClient | ||
{ | ||
/// <summary> | ||
/// Gets review requests for a specified pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/review_requests/#list-review-requests</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<User> GetAll(string owner, string name, int number); | ||
|
||
/// <summary> | ||
/// Creates review requests on a pull request for specified users. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/review_requests/#create-a-review-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="users">List of logins of user will be requested for review</param> | ||
IObservable<PullRequest> Create(string owner, string name, int number, PullRequestReviewRequest users); | ||
|
||
/// <summary> | ||
/// Deletes review request for given users on a pull request. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/pulls/review_requests/#delete-a-review-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 review comment number</param> | ||
/// <param name="users">List of logins of users that will be not longer requested for review</param> | ||
IObservable<Unit> Delete(string owner, string name, int number, PullRequestReviewRequest users); | ||
} | ||
} |
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
47 changes: 47 additions & 0 deletions
47
Octokit.Reactive/Clients/ObservablePullRequestReviewRequestsClient.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,47 @@ | ||
using System; | ||
using System.Reactive; | ||
using System.Reactive.Threading.Tasks; | ||
using Octokit.Reactive.Internal; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
public class ObservablePullRequestReviewRequestsClient : IObservablePullRequestReviewRequestsClient | ||
{ | ||
readonly IPullRequestReviewRequestsClient _client; | ||
readonly IConnection _connection; | ||
|
||
public ObservablePullRequestReviewRequestsClient(IGitHubClient client) | ||
{ | ||
Ensure.ArgumentNotNull(client, "client"); | ||
|
||
_client = client.PullRequest.ReviewRequest; | ||
_connection = client.Connection; | ||
} | ||
|
||
public IObservable<User> GetAll(string owner, string name, int number) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
Ensure.ArgumentNotNullOrEmptyString(name, "name"); | ||
|
||
return _connection.GetAndFlattenAllPages<User>(ApiUrls.PullRequestReviewRequests(owner, name, number), null, AcceptHeaders.PullRequestReviewsApiPreview); | ||
} | ||
|
||
public IObservable<PullRequest> Create(string owner, string name, int number, PullRequestReviewRequest users) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
Ensure.ArgumentNotNullOrEmptyString(name, "name"); | ||
Ensure.ArgumentNotNull(users, "users"); | ||
|
||
return _client.Create(owner, name, number, users).ToObservable(); | ||
} | ||
|
||
public IObservable<Unit> Delete(string owner, string name, int number, PullRequestReviewRequest users) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
Ensure.ArgumentNotNullOrEmptyString(name, "name"); | ||
Ensure.ArgumentNotNull(users, "users"); | ||
|
||
return _client.Delete(owner, name, number, users).ToObservable(); | ||
} | ||
} | ||
} |
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.
Just FYI that we add the xmldoc comments to the interfaces and the client implementations, so once you are done with the changes please add the xmldoc comments to all the conrete methods as well 👍