@@ -8,8 +8,7 @@ use crate::{
8
8
bors:: {
9
9
PullRequestStatus , RepositoryState ,
10
10
comment:: {
11
- auto_build_base_moved_comment, auto_build_push_failed_comment,
12
- auto_build_started_comment, merge_conflict_comment,
11
+ auto_build_push_failed_comment, auto_build_started_comment, merge_conflict_comment,
13
12
} ,
14
13
handlers:: labels:: handle_label_trigger,
15
14
} ,
@@ -85,55 +84,35 @@ pub async fn handle_merge_queue(ctx: Arc<BorsContext>) -> anyhow::Result<()> {
85
84
. await ?;
86
85
}
87
86
Err ( error) => {
88
- let current_base_sha =
89
- repo. client . get_branch_sha ( & pr. base_branch ) . await ?;
90
- let build_time_base_sha = CommitSha ( auto_build. parent . clone ( ) ) ;
91
-
92
- if current_base_sha != build_time_base_sha {
93
- tracing:: info!(
94
- "Base branch has moved for PR {pr_num} (was: {}, now: {}). Deleting auto build." ,
95
- build_time_base_sha,
96
- current_base_sha
97
- ) ;
98
-
99
- let comment = auto_build_base_moved_comment (
100
- & pr. base_branch ,
101
- & build_time_base_sha,
102
- & current_base_sha,
103
- ) ;
104
- repo. client . post_comment ( pr. number , comment) . await ?;
105
-
106
- ctx. db . delete_auto_build ( & pr) . await ?;
107
- } else {
108
- tracing:: error!(
109
- "Failed to push PR {pr_num} to base branch: {:?}" ,
110
- error
111
- ) ;
112
-
113
- let gh_pr = repo. client . get_pull_request ( pr_num) . await ?;
114
-
115
- let desc = format ! (
116
- "Test was successful, but fast-forwarding failed: {}" ,
117
- & error. to_string( )
118
- ) ;
119
- repo. client
120
- . create_commit_status (
121
- & gh_pr. head . sha ,
122
- StatusState :: Error ,
123
- None ,
124
- Some ( & desc) ,
125
- Some ( "bors" ) ,
126
- )
127
- . await ?;
128
-
129
- let comment =
130
- auto_build_push_failed_comment ( & error. to_string ( ) ) ;
131
- repo. client . post_comment ( pr. number , comment) . await ?;
132
- }
87
+ tracing:: error!(
88
+ "Failed to push PR {pr_num} to base branch: {:?}" ,
89
+ error
90
+ ) ;
91
+
92
+ let gh_pr = repo. client . get_pull_request ( pr_num) . await ?;
93
+
94
+ let desc = format ! (
95
+ "Test was successful, but fast-forwarding failed: {}" ,
96
+ & error. to_string( )
97
+ ) ;
98
+ repo. client
99
+ . create_commit_status (
100
+ & gh_pr. head . sha ,
101
+ StatusState :: Error ,
102
+ None ,
103
+ Some ( & desc) ,
104
+ Some ( "bors" ) ,
105
+ )
106
+ . await ?;
107
+
108
+ let comment = auto_build_push_failed_comment ( & error. to_string ( ) ) ;
109
+ repo. client . post_comment ( pr. number , comment) . await ?;
133
110
}
134
111
} ;
135
112
136
- continue ;
113
+ // We break rather than continue to give GitHub time to update the base
114
+ // branch.
115
+ break ;
137
116
}
138
117
// Build in progress - stop queue. We can only have one PR built at a time.
139
118
BuildStatus :: Pending => {
0 commit comments