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

Graduate review requests to what eventually shipped #2153

Merged
merged 2 commits into from
Mar 15, 2020

Conversation

shiftkey
Copy link
Member

Resolves #2122

This is a breaking change in several ways due to changes the API made while under preview:

  • requesting teams is now supported, so the response and requests payload had to change
  • pagination is no longer supported, so those overloads have been removed

To use the new API there are two static constructors to differentiate between "request users" and "request teams":

// request specific collaborators
var collaborators = new List<string> { "shiftkey", "ryangribble" };
var requestCollaborators = PullRequestReviewRequest.ForReviewers(collaborators);

// request specific teams
var teams = new List<string> { "frontend-reviewers", "backend-reviewers" };
var requestTeams = PullRequestReviewRequest.ForTeamReviewers(teams);

// request a mixture of both
var requestBothGroups = new PullRequestReviewRequest(collaborators, teams);

@codecov
Copy link

codecov bot commented Mar 15, 2020

Codecov Report

Merging #2153 into master will decrease coverage by 0.1%.
The diff coverage is 37.93%.

@@            Coverage Diff             @@
##           master    #2153      +/-   ##
==========================================
- Coverage   66.82%   66.71%   -0.11%     
==========================================
  Files         544      545       +1     
  Lines       14234    14233       -1     
==========================================
- Hits         9512     9496      -16     
- Misses       4722     4737      +15
Impacted Files Coverage Δ
Octokit/Helpers/AcceptHeaders.cs 100% <ø> (ø) ⬆️
Octokit/Models/Response/RequestedReviews.cs 0% <0%> (ø)
Octokit/Clients/PullRequestReviewRequestsClient.cs 100% <100%> (+11.76%) ⬆️
...ients/ObservablePullRequestReviewRequestsClient.cs 100% <100%> (ø) ⬆️
Octokit/Models/Request/PullRequestReviewRequest.cs 55.55% <50%> (-4.45%) ⬇️
Octokit.Reactive/Helpers/ObservableExtensions.cs 91.26% <0%> (-1.95%) ⬇️

@shiftkey shiftkey merged commit f6a9a47 into master Mar 15, 2020
@shiftkey shiftkey deleted the graduate-review-requests branch March 15, 2020 14:33
@ch1seL
Copy link
Contributor

ch1seL commented Mar 15, 2020

@shiftkey Thank you 👍

@shiftkey
Copy link
Member Author

release_notes: updated client.PullRequest.ReviewRequest to reflect what is currently supported

@shiftkey
Copy link
Member Author

shiftkey commented Mar 15, 2020

advisories: due to the Review Request API graduating from preview there are some breaking changes that will impact callers:

  • client.PullRequest.ReviewRequest.GetAll() has been removed in favour of client.PullRequest.ReviewRequest.Get() as there is no pagination support for the API
  • client.PullRequest.ReviewRequest.Get() now returns a RequestedReviews object that contains users and teams
  • PullRequestReviewRequest now accepts teams, and helper functions are added to make it clear whether a request review is for users or teams

Example code:

// request specific collaborators
var collaborators = new List<string> { "shiftkey", "ryangribble" };
var requestCollaborators = PullRequestReviewRequest.ForReviewers(collaborators);

var number = 123;

await client.PullRequest.ReviewRequest.Create("owner", "repo", number, requestCollaborators);

var reviewers = await client.PullRequest.ReviewRequest.Get("owner", "repo", number);

Console.WriteLine($"Review {number} has requested {reviewers.Users.Count} user reviews and {reviewers.Teams.Count} team reviews");

@nickfloyd nickfloyd added Type: Bug Something isn't working as documented and removed category: bug labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review request of teams is not supported
3 participants