@@ -63,15 +63,19 @@ pub(super) async fn command_approve(
6363 let priority = priority. or ( pr. db . priority . map ( |p| p as u32 ) ) ;
6464
6565 merge_queue_tx. notify ( ) . await ?;
66- handle_label_trigger (
67- & repo_state,
68- pr. number ( ) ,
69- Some ( pr. github ) ,
70- LabelTrigger :: Approved ,
71- )
72- . await ?;
7366
74- notify_of_approval ( ctx, & repo_state, pr, priority, approver. as_str ( ) ) . await
67+ if !repo_state. is_paused ( ) {
68+ handle_label_trigger (
69+ & repo_state,
70+ pr. number ( ) ,
71+ Some ( pr. github ) ,
72+ LabelTrigger :: Approved ,
73+ )
74+ . await ?;
75+
76+ notify_of_approval ( ctx, & repo_state, pr, priority, approver. as_str ( ) ) . await ?;
77+ }
78+ Ok ( ( ) )
7579}
7680
7781/// Keywords that will prevent an approval if they appear in the PR's title.
@@ -152,7 +156,10 @@ pub(super) async fn command_unapprove(
152156 )
153157 . await ?;
154158 unapprove_pr ( & repo_state, & db, pr. db , pr. github ) . await ?;
155- notify_of_unapproval ( & repo_state, pr, auto_build_cancel_message) . await ?;
159+
160+ if !repo_state. is_paused ( ) {
161+ notify_of_unapproval ( & repo_state, pr, auto_build_cancel_message) . await ?;
162+ }
156163
157164 Ok ( ( ) )
158165}
@@ -193,15 +200,19 @@ pub(super) async fn command_delegate(
193200 }
194201
195202 db. delegate ( pr. db , delegated_permission) . await ?;
196- notify_of_delegation (
197- & repo_state,
198- pr. number ( ) ,
199- & pr. github . author . username ,
200- & author. username ,
201- delegated_permission,
202- bot_prefix,
203- )
204- . await
203+
204+ if !repo_state. is_paused ( ) {
205+ notify_of_delegation (
206+ & repo_state,
207+ pr. number ( ) ,
208+ & pr. github . author . username ,
209+ & author. username ,
210+ delegated_permission,
211+ bot_prefix,
212+ )
213+ . await ?;
214+ }
215+ Ok ( ( ) )
205216}
206217
207218/// Revoke any previously granted delegation.
@@ -258,7 +269,11 @@ pub(super) async fn command_close_tree(
258269 . await ?;
259270
260271 merge_queue_tx. notify ( ) . await ?;
261- notify_of_tree_closed ( & repo_state, pr. number ( ) , priority) . await
272+
273+ if !repo_state. is_paused ( ) {
274+ notify_of_tree_closed ( & repo_state, pr. number ( ) , priority) . await ?;
275+ }
276+ Ok ( ( ) )
262277}
263278
264279pub ( super ) async fn command_open_tree (
@@ -277,7 +292,11 @@ pub(super) async fn command_open_tree(
277292 . await ?;
278293
279294 merge_queue_tx. notify ( ) . await ?;
280- notify_of_tree_open ( & repo_state, pr. number ( ) ) . await
295+
296+ if !repo_state. is_paused ( ) {
297+ notify_of_tree_open ( & repo_state, pr. number ( ) ) . await ?;
298+ }
299+ Ok ( ( ) )
281300}
282301
283302fn sufficient_approve_permission ( repo : Arc < RepositoryState > , author : & GithubUser ) -> bool {
@@ -1399,4 +1418,25 @@ labels_blocking_approval = ["proposed-final-comment-period", "final-comment-peri
13991418 } )
14001419 . await ;
14011420 }
1421+
1422+ #[ sqlx:: test]
1423+ async fn pause_resume ( pool : sqlx:: PgPool ) {
1424+ run_test ( pool, async |ctx : & mut BorsTester | {
1425+ ctx. post_comment ( "@bors pause" ) . await ?;
1426+ ctx. post_comment ( "@bors r+" ) . await ?;
1427+ ctx. wait_for_pr ( ( ) , |pr| pr. is_approved ( ) ) . await ?;
1428+ ctx. run_merge_queue_now ( ) . await ;
1429+ ctx. pr ( ( ) ) . await . expect_no_auto_build ( ) ;
1430+ ctx. post_comment ( "@bors resume" ) . await ?;
1431+
1432+ // Sync
1433+ ctx. post_comment ( "@bors info" ) . await ?;
1434+ ctx. expect_comments ( ( ) , 1 ) . await ;
1435+
1436+ ctx. start_and_finish_auto_build ( ( ) ) . await ?;
1437+
1438+ Ok ( ( ) )
1439+ } )
1440+ . await ;
1441+ }
14021442}
0 commit comments