Skip to content

Commit 27ea491

Browse files
committed
Revert "Allow ghost GH user to skip PR workqueue check"
This reverts commit a3f67b7.
1 parent 5e55888 commit 27ea491

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

src/handlers/assign.rs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -766,22 +766,16 @@ async fn find_reviewer_from_names(
766766
// These are all ideas for improving the selection here. However, I'm not
767767
// sure they are really worth the effort.
768768

769-
// If we are trying to assign to the ghost GitHub user, bypass every check
770-
let mut filtered_candidates: HashSet<String> = HashSet::new();
771-
if candidates.contains("ghost") {
772-
filtered_candidates.insert("ghost".to_string());
773-
} else {
774-
// filter out team members without capacity
775-
filtered_candidates = filter_by_capacity(db, &candidates)
776-
.await
777-
.expect("Error while filtering out team members");
778-
779-
if filtered_candidates.is_empty() {
780-
return Err(FindReviewerError::AllReviewersFiltered {
781-
initial: names.to_vec(),
782-
filtered: names.to_vec(),
783-
});
784-
}
769+
// filter out team members without capacity
770+
let filtered_candidates = filter_by_capacity(db, &candidates)
771+
.await
772+
.expect("Error while filtering out team members");
773+
774+
if filtered_candidates.is_empty() {
775+
return Err(FindReviewerError::AllReviewersFiltered {
776+
initial: names.to_vec(),
777+
filtered: names.to_vec(),
778+
});
785779
}
786780

787781
log::debug!("Filtered list of candidates: {:?}", filtered_candidates);
@@ -793,7 +787,6 @@ async fn find_reviewer_from_names(
793787
.to_string())
794788
}
795789

796-
// FIXME: this query probably needs to take into account when max_assigned_prs is null
797790
/// Filter out candidates not having review capacity
798791
async fn filter_by_capacity(
799792
db: &DbClient,

0 commit comments

Comments
 (0)