@@ -766,22 +766,16 @@ async fn find_reviewer_from_names(
766
766
// These are all ideas for improving the selection here. However, I'm not
767
767
// sure they are really worth the effort.
768
768
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
+ } ) ;
785
779
}
786
780
787
781
log:: debug!( "Filtered list of candidates: {:?}" , filtered_candidates) ;
@@ -793,7 +787,6 @@ async fn find_reviewer_from_names(
793
787
. to_string ( ) )
794
788
}
795
789
796
- // FIXME: this query probably needs to take into account when max_assigned_prs is null
797
790
/// Filter out candidates not having review capacity
798
791
async fn filter_by_capacity (
799
792
db : & DbClient ,
0 commit comments