Skip to content

Commit

Permalink
Test minimization resumption first
Browse files Browse the repository at this point in the history
Otherwise, resumption will be parsed as an option.
  • Loading branch information
JasonGross committed Jan 24, 2023
1 parent 697bb55 commit 5212d20
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/bot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -305,34 +305,38 @@ let callback _conn req body =
Server.respond_string ~status:`OK ~body:"Handling minimization."
()
| None -> (
match coqbot_ci_minimize_text_of_body body with
| Some (options, requests) ->
(* Since both ci minimization resumption and ci
minimization will match the resumption string, and we
don't want to parse "resume" as an option, we test
resumption first *)
match coqbot_resume_ci_minimize_text_of_body body with
| Some (options, requests, bug_file_contents) ->
(fun () ->
init_git_bare_repository ~bot_info
>>= fun () ->
action_as_github_app ~bot_info ~key ~app_id
~owner:comment_info.issue.issue.owner
~repo:comment_info.issue.issue.repo
(ci_minimize ~comment_info ~requests ~comment_on_error:true
~options ~bug_file_contents:None ) )
~options ~bug_file_contents:(Some bug_file_contents) ) )
|> Lwt.async ;
Server.respond_string ~status:`OK
~body:"Handling CI minimization." ()
~body:"Handling CI minimization resumption." ()
| None -> (
match coqbot_resume_ci_minimize_text_of_body body with
| Some (options, requests, bug_file_contents) ->
match coqbot_ci_minimize_text_of_body body with
| Some (options, requests) ->
(fun () ->
init_git_bare_repository ~bot_info
>>= fun () ->
action_as_github_app ~bot_info ~key ~app_id
~owner:comment_info.issue.issue.owner
~repo:comment_info.issue.issue.repo
(ci_minimize ~comment_info ~requests
~comment_on_error:true ~options
~bug_file_contents:(Some bug_file_contents) ) )
~comment_on_error:true ~options ~bug_file_contents:None )
)
|> Lwt.async ;
Server.respond_string ~status:`OK
~body:"Handling CI minimization resumption." ()
~body:"Handling CI minimization." ()
| None ->
if
string_match
Expand Down

0 comments on commit 5212d20

Please sign in to comment.