1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,24 @@ fn postprocess_metrics(
150
150
return Ok ( ( ) ) ;
151
151
} ;
152
152
153
- let parent_metrics =
154
- download_job_metrics ( & job_name, & parent) . context ( "cannot download parent metrics" ) ?;
155
- let job_metrics =
156
- HashMap :: from ( [ ( job_name, JobMetrics { parent : Some ( parent_metrics) , current : metrics } ) ] ) ;
157
- output_test_diffs ( job_metrics) ;
153
+ // This command is executed also on PR builds, which might not have parent metrics
154
+ // available, because some PR jobs don't run on auto builds, and PR jobs do not upload metrics
155
+ // due to missing permissions.
156
+ // To avoid having to detect if this is a PR job, and to avoid having failed steps in PR jobs,
157
+ // we simply print an error if the parent metrics were not found, but otherwise exit
158
+ // successfully.
159
+ match download_job_metrics ( & job_name, & parent) . context ( "cannot download parent metrics" ) {
160
+ Ok ( parent_metrics) => {
161
+ let job_metrics = HashMap :: from ( [ (
162
+ job_name,
163
+ JobMetrics { parent : Some ( parent_metrics) , current : metrics } ,
164
+ ) ] ) ;
165
+ output_test_diffs ( job_metrics) ;
166
+ }
167
+ Err ( error) => {
168
+ eprintln ! ( "Metrics for job `{job_name}` and commit `{parent}` not found: {error:?}" ) ;
169
+ }
170
+ }
158
171
159
172
Ok ( ( ) )
160
173
}
0 commit comments