Skip to content

Commit 5212d20

Browse files
committed
Test minimization resumption first
Otherwise, resumption will be parsed as an option.
1 parent 697bb55 commit 5212d20

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/bot.ml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,34 +305,38 @@ let callback _conn req body =
305305
Server.respond_string ~status:`OK ~body:"Handling minimization."
306306
()
307307
| None -> (
308-
match coqbot_ci_minimize_text_of_body body with
309-
| Some (options, requests) ->
308+
(* Since both ci minimization resumption and ci
309+
minimization will match the resumption string, and we
310+
don't want to parse "resume" as an option, we test
311+
resumption first *)
312+
match coqbot_resume_ci_minimize_text_of_body body with
313+
| Some (options, requests, bug_file_contents) ->
310314
(fun () ->
311315
init_git_bare_repository ~bot_info
312316
>>= fun () ->
313317
action_as_github_app ~bot_info ~key ~app_id
314318
~owner:comment_info.issue.issue.owner
315319
~repo:comment_info.issue.issue.repo
316320
(ci_minimize ~comment_info ~requests ~comment_on_error:true
317-
~options ~bug_file_contents:None ) )
321+
~options ~bug_file_contents:(Some bug_file_contents) ) )
318322
|> Lwt.async ;
319323
Server.respond_string ~status:`OK
320-
~body:"Handling CI minimization." ()
324+
~body:"Handling CI minimization resumption." ()
321325
| None -> (
322-
match coqbot_resume_ci_minimize_text_of_body body with
323-
| Some (options, requests, bug_file_contents) ->
326+
match coqbot_ci_minimize_text_of_body body with
327+
| Some (options, requests) ->
324328
(fun () ->
325329
init_git_bare_repository ~bot_info
326330
>>= fun () ->
327331
action_as_github_app ~bot_info ~key ~app_id
328332
~owner:comment_info.issue.issue.owner
329333
~repo:comment_info.issue.issue.repo
330334
(ci_minimize ~comment_info ~requests
331-
~comment_on_error:true ~options
332-
~bug_file_contents:(Some bug_file_contents) ) )
335+
~comment_on_error:true ~options ~bug_file_contents:None )
336+
)
333337
|> Lwt.async ;
334338
Server.respond_string ~status:`OK
335-
~body:"Handling CI minimization resumption." ()
339+
~body:"Handling CI minimization." ()
336340
| None ->
337341
if
338342
string_match

0 commit comments

Comments
 (0)