1
1
use std:: sync:: Arc ;
2
2
3
- use anyhow:: { Context , anyhow} ;
4
- use octocrab:: params:: checks:: CheckRunOutput ;
5
- use octocrab:: params:: checks:: CheckRunStatus ;
6
-
7
3
use crate :: PgDbClient ;
8
4
use crate :: bors:: RepositoryState ;
9
5
use crate :: bors:: command:: Parent ;
@@ -22,6 +18,10 @@ use crate::github::api::operations::ForcePush;
22
18
use crate :: github:: { CommitSha , GithubUser , LabelTrigger , MergeError , PullRequestNumber } ;
23
19
use crate :: permissions:: PermissionType ;
24
20
use crate :: utils:: text:: suppress_github_mentions;
21
+ use anyhow:: { Context , anyhow} ;
22
+ use octocrab:: params:: checks:: CheckRunOutput ;
23
+ use octocrab:: params:: checks:: CheckRunStatus ;
24
+ use tracing:: log;
25
25
26
26
use super :: has_permission;
27
27
use super :: { PullRequestData , deny_request} ;
@@ -100,7 +100,7 @@ pub(super) async fn command_try_build(
100
100
// Create a check run to track the try build status in GitHub's UI.
101
101
// This gets added to the PR's head SHA so GitHub shows UI in the checks tab and
102
102
// the bottom of the PR.
103
- let check_run = repo
103
+ match repo
104
104
. client
105
105
. create_check_run (
106
106
TRY_BUILD_CHECK_RUN_NAME ,
@@ -115,10 +115,17 @@ pub(super) async fn command_try_build(
115
115
} ,
116
116
& build_id. to_string ( ) ,
117
117
)
118
- . await ?;
119
-
120
- db. update_build_check_run_id ( build_id, check_run. id . into_inner ( ) as i64 )
121
- . await ?;
118
+ . await
119
+ {
120
+ Ok ( check_run) => {
121
+ db. update_build_check_run_id ( build_id, check_run. id . into_inner ( ) as i64 )
122
+ . await ?;
123
+ }
124
+ Err ( error) => {
125
+ // Check runs aren't critical, don't block progress if they fail
126
+ log:: error!( "Cannot create check run: {error:?}" ) ;
127
+ }
128
+ }
122
129
123
130
repo. client
124
131
. post_comment (
0 commit comments