@@ -7,7 +7,6 @@ use crate::PgDbClient;
7
7
use crate :: bors:: CheckSuiteStatus ;
8
8
use crate :: bors:: RepositoryState ;
9
9
use crate :: bors:: comment:: auto_build_failed_comment;
10
- use crate :: bors:: comment:: auto_build_succeeded_comment;
11
10
use crate :: bors:: comment:: { try_build_succeeded_comment, workflow_failed_comment} ;
12
11
use crate :: bors:: event:: { CheckSuiteCompleted , WorkflowCompleted , WorkflowStarted } ;
13
12
use crate :: bors:: handlers:: TRY_BRANCH_NAME ;
@@ -205,7 +204,7 @@ async fn try_complete_build(
205
204
complete_try_build ( repo, pr, build, workflows, has_failure, payload) . await ?
206
205
}
207
206
AUTO_BRANCH_NAME => {
208
- complete_auto_build ( repo, pr, workflows, has_failure, payload ) . await ?;
207
+ complete_auto_build ( repo, pr, workflows, has_failure) . await ?;
209
208
}
210
209
_ => unreachable ! ( "Branch should only be bors-observed branch" ) ,
211
210
}
@@ -248,21 +247,14 @@ async fn complete_auto_build(
248
247
pr : PullRequestModel ,
249
248
workflows : Vec < WorkflowModel > ,
250
249
has_failure : bool ,
251
- payload : CheckSuiteCompleted ,
252
250
) -> anyhow:: Result < ( ) > {
253
- let comment = if !has_failure {
254
- tracing:: info!( "Auto build succeeded for PR {}" , pr. number) ;
255
- auto_build_succeeded_comment (
256
- & workflows,
257
- pr. approver ( ) . unwrap_or ( "<unknown>" ) ,
258
- & payload. commit_sha ,
259
- & pr. base_branch ,
260
- )
261
- } else {
251
+ if has_failure {
262
252
tracing:: info!( "Auto build failed for PR {}" , pr. number) ;
263
- auto_build_failed_comment ( & workflows)
264
- } ;
265
- repo. client . post_comment ( pr. number , comment) . await ?;
253
+ let comment = auto_build_failed_comment ( & workflows) ;
254
+ repo. client . post_comment ( pr. number , comment) . await ?;
255
+ } else {
256
+ tracing:: info!( "Auto build succeeded for PR {}" , pr. number) ;
257
+ }
266
258
267
259
let ( status, conclusion, desc) = if !has_failure {
268
260
(
0 commit comments