File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ fn postprocess_metrics(
180180}
181181
182182fn post_merge_report ( db : JobDatabase , current : String , parent : String ) -> anyhow:: Result < ( ) > {
183- let metrics = download_auto_job_metrics ( & db, & parent, & current) ?;
183+ let metrics = download_auto_job_metrics ( & db, Some ( & parent) , & current) ?;
184184
185185 println ! ( "\n Comparing {parent} (parent) -> {current} (this PR)\n " ) ;
186186
Original file line number Diff line number Diff line change @@ -46,24 +46,25 @@ pub struct JobMetrics {
4646/// `parent` and `current` should be commit SHAs.
4747pub fn download_auto_job_metrics (
4848 job_db : & JobDatabase ,
49- parent : & str ,
49+ parent : Option < & str > ,
5050 current : & str ,
5151) -> anyhow:: Result < HashMap < JobName , JobMetrics > > {
5252 let mut jobs = HashMap :: default ( ) ;
5353
5454 for job in & job_db. auto_jobs {
5555 eprintln ! ( "Downloading metrics of job {}" , job. name) ;
56- let metrics_parent = match download_job_metrics ( & job. name , parent) {
57- Ok ( metrics) => Some ( metrics) ,
58- Err ( error) => {
59- eprintln ! (
60- r#"Did not find metrics for job `{}` at `{parent}`: {error:?}.
56+ let metrics_parent =
57+ parent. and_then ( |parent| match download_job_metrics ( & job. name , parent) {
58+ Ok ( metrics) => Some ( metrics) ,
59+ Err ( error) => {
60+ eprintln ! (
61+ r#"Did not find metrics for job `{}` at `{parent}`: {error:?}.
6162Maybe it was newly added?"# ,
62- job. name
63- ) ;
64- None
65- }
66- } ;
63+ job. name
64+ ) ;
65+ None
66+ }
67+ } ) ;
6768 let metrics_current = download_job_metrics ( & job. name , current) ?;
6869 jobs. insert (
6970 job. name . clone ( ) ,
You can’t perform that action at this time.
0 commit comments