Skip to content

Commit 0509528

Browse files
committed
Remove unused FindReviewerError variants
We will add them back once we start taking review preferences into account when determining review candidates.
1 parent 9e04ab7 commit 0509528

File tree

1 file changed

+2
-66
lines changed

1 file changed

+2
-66
lines changed

src/handlers/assign.rs

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,6 @@ Please choose another assignee."
7878
)
7979
}
8080

81-
pub const SELF_ASSIGN_HAS_NO_CAPACITY: &str = "
82-
You have insufficient capacity to be assigned the pull request at this time. PR assignment has been reverted.
83-
84-
Please choose another assignee or increase your assignment limit.
85-
86-
(see [documentation](https://forge.rust-lang.org/triagebot/pr-assignment-tracking.html))";
87-
88-
pub const REVIEWER_HAS_NO_CAPACITY: &str = "
89-
`{username}` has insufficient capacity to be assigned the pull request at this time. PR assignment has been reverted.
90-
91-
Please choose another assignee.
92-
93-
(see [documentation](https://forge.rust-lang.org/triagebot/pr-assignment-tracking.html))";
94-
95-
const NO_REVIEWER_HAS_CAPACITY: &str = "
96-
Could not find a reviewer with enough capacity to be assigned at this time. This is a problem.
97-
98-
Please contact us on [#t-infra](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra) on Zulip.
99-
100-
cc: @jackh726 @apiraino";
101-
10281
const REVIEWER_IS_PR_AUTHOR: &str = "Pull request author cannot be assigned as reviewer.
10382
10483
Please choose another assignee.";
@@ -308,22 +287,13 @@ async fn determine_assignee(
308287
),
309288
Err(
310289
e @ FindReviewerError::NoReviewer { .. }
311-
| e @ FindReviewerError::AllReviewersFiltered { .. }
312-
| e @ FindReviewerError::NoReviewerHasCapacity
313-
| e @ FindReviewerError::ReviewerHasNoCapacity { .. }
314290
| e @ FindReviewerError::ReviewerIsPrAuthor { .. }
315-
| e @ FindReviewerError::ReviewerAlreadyAssigned { .. },
291+
| e @ FindReviewerError::ReviewerAlreadyAssigned { .. }
292+
| e @ FindReviewerError::ReviewerOnVacation { .. },
316293
) => log::trace!(
317294
"no reviewer could be determined for PR {}: {e}",
318295
event.issue.global_id()
319296
),
320-
Err(e @ FindReviewerError::ReviewerOnVacation { .. }) => {
321-
// TODO: post a comment on the PR if the reviewer(s) were filtered due to being on vacation
322-
log::trace!(
323-
"no reviewer could be determined for PR {}: {e}",
324-
event.issue.global_id()
325-
)
326-
}
327297
}
328298
}
329299
// If no owners matched the diff, fall-through.
@@ -623,20 +593,6 @@ pub enum FindReviewerError {
623593
/// This could happen if there is a cyclical group or other misconfiguration.
624594
/// `initial` is the initial list of candidate names.
625595
NoReviewer { initial: Vec<String> },
626-
/// All potential candidates were excluded. `initial` is the list of
627-
/// candidate names that were used to seed the selection. `filtered` is
628-
/// the users who were prevented from being assigned. One example where
629-
/// this happens is if the given name was for a team where the PR author
630-
/// is the only member.
631-
AllReviewersFiltered {
632-
initial: Vec<String>,
633-
filtered: Vec<String>,
634-
},
635-
/// No reviewer has capacity to accept a pull request assignment at this time
636-
NoReviewerHasCapacity,
637-
/// The requested reviewer has no capacity to accept a pull request
638-
/// assignment at this time
639-
ReviewerHasNoCapacity { username: String },
640596
/// Requested reviewer is on vacation
641597
/// (i.e. username is in [users_on_vacation] in the triagebot.toml)
642598
ReviewerOnVacation { username: String },
@@ -669,26 +625,6 @@ impl fmt::Display for FindReviewerError {
669625
initial.join(",")
670626
)
671627
}
672-
FindReviewerError::AllReviewersFiltered { initial, filtered } => {
673-
write!(
674-
f,
675-
"Could not assign reviewer from: `{}`.\n\
676-
User(s) `{}` are either the PR author, already assigned, or on vacation. \
677-
Please use `r?` to specify someone else to assign.",
678-
initial.join(","),
679-
filtered.join(","),
680-
)
681-
}
682-
FindReviewerError::ReviewerHasNoCapacity { username } => {
683-
write!(
684-
f,
685-
"{}",
686-
REVIEWER_HAS_NO_CAPACITY.replace("{username}", username)
687-
)
688-
}
689-
FindReviewerError::NoReviewerHasCapacity => {
690-
write!(f, "{}", NO_REVIEWER_HAS_CAPACITY)
691-
}
692628
FindReviewerError::ReviewerOnVacation { username } => {
693629
write!(f, "{}", on_vacation_warning(username))
694630
}

0 commit comments

Comments
 (0)