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