request reviews one at a time

if a batch of review requests contains any users who are not members of the organization, the entire request fails.
This commit is contained in:
Graham Christensen 2019-01-16 08:32:03 -05:00
parent 22e7d0ae8d
commit f151c71ebb
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -737,18 +737,16 @@ fn request_reviews(
) {
if let Ok(ref maint) = m {
if maint.maintainers().len() < 10 {
if let Err(e) =
pull.review_requests()
.create(&hubcaps::review_requests::ReviewRequestOptions {
reviewers: maint.maintainers(),
team_reviewers: vec![],
})
{
println!(
"Failure adding review requests for maintainers ({:?}): {:#?}",
maint.maintainers(),
e,
);
for maintainer in maint.maintainers() {
if let Err(e) =
pull.review_requests()
.create(&hubcaps::review_requests::ReviewRequestOptions {
reviewers: vec![maintainer.clone()],
team_reviewers: vec![],
})
{
println!("Failure requesting a review from {}: {:#?}", maintainer, e,);
}
}
}
}