@@ -3,10 +3,10 @@ use crate::bors::comment::{
33 CommentTag , append_workflow_links_to_comment, build_failed_comment, try_build_succeeded_comment,
44} ;
55use crate :: bors:: event:: { WorkflowRunCompleted , WorkflowRunStarted } ;
6- use crate :: bors:: handlers:: hide_try_build_started_comments;
76use crate :: bors:: handlers:: labels:: handle_label_trigger;
7+ use crate :: bors:: handlers:: { hide_try_build_started_comments, is_bors_observed_branch} ;
88use crate :: bors:: merge_queue:: MergeQueueSender ;
9- use crate :: bors:: { BuildKind , TRY_BRANCH_NAME , get_build_kind , is_bors_observed_branch } ;
9+ use crate :: bors:: { BuildKind , TRY_BRANCH_NAME } ;
1010use crate :: bors:: { FailedWorkflowRun , RepositoryState , WorkflowRun } ;
1111use crate :: database:: {
1212 BuildModel , BuildStatus , PullRequestModel , QueueStatus , WorkflowModel , WorkflowStatus ,
@@ -167,10 +167,6 @@ async fn maybe_complete_build(
167167 merge_queue_tx : & MergeQueueSender ,
168168 error_context : Option < String > ,
169169) -> anyhow:: Result < ( ) > {
170- let Some ( build_type) = get_build_kind ( & payload. branch ) else {
171- return Ok ( ( ) ) ;
172- } ;
173-
174170 let Some ( build) = db
175171 . find_build (
176172 & payload. repository ,
@@ -252,7 +248,7 @@ async fn maybe_complete_build(
252248 } else {
253249 BuildStatus :: Failure
254250 } ;
255- let trigger = match build_type {
251+ let trigger = match build . kind {
256252 BuildKind :: Try => {
257253 if !build_succeeded {
258254 Some ( LabelTrigger :: TryBuildFailed )
@@ -289,7 +285,7 @@ async fn maybe_complete_build(
289285 }
290286
291287 // Trigger merge queue when an auto build completes
292- if build_type == BuildKind :: Auto {
288+ if build . kind == BuildKind :: Auto {
293289 merge_queue_tx. notify ( ) . await ?;
294290 }
295291
@@ -298,7 +294,7 @@ async fn maybe_complete_build(
298294 let comment_opt = if build_succeeded {
299295 tracing:: info!( "Build succeeded for PR {pr_num}" ) ;
300296
301- if build_type == BuildKind :: Try {
297+ if build . kind == BuildKind :: Try {
302298 Some ( try_build_succeeded_comment (
303299 & db_workflow_runs,
304300 payload. commit_sha ,
@@ -338,7 +334,7 @@ async fn maybe_complete_build(
338334 ) )
339335 } ;
340336
341- if build_type == BuildKind :: Try {
337+ if build . kind == BuildKind :: Try {
342338 hide_try_build_started_comments ( repo, db, & pr) . await ?;
343339 }
344340
0 commit comments