mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
* First Iteration Need to finish tests and docs * Mostly Complete * Fixing tests and adding review comments * Added tests for reactive client * Moved Reviews inside fo the Pull request client for better organization and began initial intigration testing * Fixing bad recursive function breaking tests * test fixes * Add paging support to review comments call * Fixing recursive function * Addressing comments from PR * fixing CI break * Typo build break * Fixing Convention Tests * Adding correct nameof() usage in Ensure * Small consitancy changes * Trigger build * Address PR Comments * Fixup test naming * Fix sub client ordering and incorrect URL * Tidy up comments and remove StringEnum wrapper from Request models as it is only for Response models * Rename GetReview to Get * tweak debugger display * Rework integration tests - implement the easy Get/GetAll ones first... * Implement integration tests for Create method. Move helpers to create PR/review into SetupHelper class Fixed up review status enum to contain correct values Tests for Approve/RequestChanges currently failing as a user cant approve/request changes on their own PR * Implement secondary account settings for integration tests and a new [DualAccountTest] attribute for discovery when configured Change integration test to create PR from the 2nd account, so the main test account is able to perform review actions on the PR * Add integration tests for Delete, Dismiss and Submit methods Fixed up API client implementation for delete (was looking for incorrect 201 http status) Removed unnecessary await/async calls from client implementations that dont need to do anything with the result * Attempting to add comments as part of a review revealed that we cant use the existing PullRequestReviewCommentCreate class as the API throws a validation error due to the CommitId field These newer review APIs need a DraftPullRequestReviewComment (that doesnt have a commitId) instead * add second test account user/password to configure-integration-tests script
189 lines
10 KiB
C#
189 lines
10 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Octokit
|
|
{
|
|
/// <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 IPullRequestReviewsClient
|
|
{
|
|
/// <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>
|
|
Task<IReadOnlyList<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>
|
|
Task<IReadOnlyList<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>
|
|
Task<IReadOnlyList<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>
|
|
Task<IReadOnlyList<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>
|
|
Task<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>
|
|
Task<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>
|
|
Task<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>
|
|
Task<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>
|
|
Task 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>
|
|
Task 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>
|
|
Task<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>
|
|
Task<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>
|
|
Task<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>
|
|
Task<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>
|
|
Task<IReadOnlyList<PullRequestReviewComment>> GetAllComments(string owner, string name, 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="repositoryId">The Id of the repository</param>
|
|
/// <param name="number">The pull request number</param>
|
|
/// <param name="reviewId">The pull request review number</param>
|
|
Task<IReadOnlyList<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>
|
|
/// <param name="options">Options for changing the API response</param>
|
|
Task<IReadOnlyList<PullRequestReviewComment>> GetAllComments(string owner, string name, int number, long reviewId, ApiOptions options);
|
|
|
|
/// <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="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="options">Options for changing the API response</param>
|
|
Task<IReadOnlyList<PullRequestReviewComment>> GetAllComments(long repositoryId, int number, long reviewId, ApiOptions options);
|
|
}
|
|
} |