@@ -16,8 +16,8 @@ use std::sync::Arc;
16
16
use anyhow:: Context ;
17
17
use chrono:: { Duration , Utc } ;
18
18
use parking_lot:: Mutex ;
19
- use serde:: { Deserialize , Serialize } ;
20
19
use reqwest:: Client ;
20
+ use serde:: { Deserialize , Serialize } ;
21
21
22
22
use crate :: git;
23
23
use crate :: util;
@@ -479,7 +479,9 @@ impl InputData {
479
479
480
480
let persistent = Persistent :: load ( ) ;
481
481
Ok ( InputData {
482
- missing_commits : Self :: missing_commits ( & data, & config, & persistent) . await . unwrap ( ) ,
482
+ missing_commits : Self :: missing_commits ( & data, & config, & persistent)
483
+ . await
484
+ . unwrap ( ) ,
483
485
stats_list : stats_list. into_iter ( ) . collect ( ) ,
484
486
interpolated,
485
487
last_date : last_date,
@@ -496,11 +498,18 @@ impl InputData {
496
498
config : & Config ,
497
499
persistent : & Persistent ,
498
500
) -> anyhow:: Result < Vec < ( Commit , MissingReason ) > > {
501
+ let github_token = match config. keys . github . as_deref ( ) {
502
+ Some ( token) => token,
503
+ None => {
504
+ println ! ( "Skipping collection of missing commits, no github token configured" ) ;
505
+ return Ok ( Vec :: new ( ) ) ;
506
+ }
507
+ } ;
499
508
println ! ( "Updating rust.git clone..." ) ;
500
- let commits = rustc_artifacts:: master_commits (
501
- & Client :: new ( ) ,
502
- Some ( config . keys . github . as_deref ( ) . expect ( "needs rust-timer token" ) ) ,
503
- ) . await . map_err ( |e| anyhow :: anyhow! ( "{:?}" , e ) ) . context ( "getting master commit list" ) ?;
509
+ let commits = rustc_artifacts:: master_commits ( & Client :: new ( ) , Some ( github_token ) )
510
+ . await
511
+ . map_err ( |e| anyhow :: anyhow! ( "{:?}" , e ) )
512
+ . context ( "getting master commit list" ) ?;
504
513
println ! ( "Update of rust.git complete" ) ;
505
514
506
515
let have = data
@@ -568,12 +577,18 @@ impl InputData {
568
577
}
569
578
}
570
579
571
- Ok ( commits. into_iter ( ) . map ( |( c, mr) | {
572
- ( Commit {
573
- sha : c. sha . as_str ( ) . into ( ) ,
574
- date : Date ( c. date ) ,
575
- } , mr)
576
- } ) . collect ( ) )
580
+ Ok ( commits
581
+ . into_iter ( )
582
+ . map ( |( c, mr) | {
583
+ (
584
+ Commit {
585
+ sha : c. sha . as_str ( ) . into ( ) ,
586
+ date : Date ( c. date ) ,
587
+ } ,
588
+ mr,
589
+ )
590
+ } )
591
+ . collect ( ) )
577
592
}
578
593
}
579
594
0 commit comments