@@ -2,11 +2,8 @@ use anyhow::{anyhow, Context};
2
2
use async_trait:: async_trait;
3
3
use bytes:: Bytes ;
4
4
use chrono:: { DateTime , FixedOffset , Utc } ;
5
- use futures:: { future:: BoxFuture , FutureExt , TryStreamExt } ;
5
+ use futures:: { future:: BoxFuture , FutureExt } ;
6
6
use hyper:: header:: HeaderValue ;
7
- use octocrab:: params:: pulls:: Sort ;
8
- use octocrab:: params:: { Direction , State } ;
9
- use octocrab:: Octocrab ;
10
7
use regex:: Regex ;
11
8
use reqwest:: header:: { AUTHORIZATION , USER_AGENT } ;
12
9
use reqwest:: { Client , Request , RequestBuilder , Response , StatusCode } ;
@@ -3057,57 +3054,6 @@ async fn project_items_by_status(
3057
3054
Ok ( all_items)
3058
3055
}
3059
3056
3060
- /// Retrieve tuples of (user, PR number) where
3061
- /// the given user is assigned as a reviewer for that PR.
3062
- /// Only non-draft, non-rollup and open PRs are taken into account.
3063
- pub async fn retrieve_pull_request_assignments (
3064
- owner : & str ,
3065
- repository : & str ,
3066
- client : & Octocrab ,
3067
- ) -> anyhow:: Result < Vec < ( User , PullRequestNumber ) > > {
3068
- let mut assignments = vec ! [ ] ;
3069
-
3070
- // We use the REST API to fetch open pull requests, as it is much (~5-10x)
3071
- // faster than using GraphQL here.
3072
- let stream = client
3073
- . pulls ( owner, repository)
3074
- . list ( )
3075
- . state ( State :: Open )
3076
- . direction ( Direction :: Ascending )
3077
- . sort ( Sort :: Created )
3078
- . per_page ( 100 )
3079
- . send ( )
3080
- . await ?
3081
- . into_stream ( client) ;
3082
- let mut stream = std:: pin:: pin!( stream) ;
3083
- while let Some ( pr) = stream. try_next ( ) . await ? {
3084
- if pr. draft == Some ( true ) {
3085
- continue ;
3086
- }
3087
- // exclude rollup PRs
3088
- if pr
3089
- . labels
3090
- . unwrap_or_default ( )
3091
- . iter ( )
3092
- . any ( |label| label. name == "rollup" )
3093
- {
3094
- continue ;
3095
- }
3096
- for user in pr. assignees . unwrap_or_default ( ) {
3097
- assignments. push ( (
3098
- User {
3099
- login : user. login ,
3100
- id : ( * user. id ) . into ( ) ,
3101
- } ,
3102
- pr. number ,
3103
- ) ) ;
3104
- }
3105
- }
3106
- assignments. sort_by ( |a, b| a. 0 . id . cmp ( & b. 0 . id ) ) ;
3107
-
3108
- Ok ( assignments)
3109
- }
3110
-
3111
3057
pub enum DesignMeetingStatus {
3112
3058
Proposed ,
3113
3059
Scheduled ,
0 commit comments