@@ -199,15 +199,17 @@ let callback _conn req body =
199199 (Request. headers req) body
200200 with
201201 | Ok
202- ( true
202+ ( Some install_id
203203 , PushEvent
204204 {owner= " coq" ; repo= " coq" ; base_ref; head_sha; commits_msg} ) ->
205205 (fun () ->
206206 init_git_bare_repository ~bot_info
207207 >> = fun () ->
208- action_as_github_app ~bot_info ~key ~app_id ~owner: " coq"
208+ action_as_github_app_from_install_id ~bot_info ~key ~app_id
209+ ~install_id
209210 (coq_push_action ~base_ref ~commits_msg )
210- < &> action_as_github_app ~bot_info ~key ~app_id ~owner: " coq"
211+ < &> action_as_github_app_from_install_id ~bot_info ~key ~app_id
212+ ~install_id
211213 (mirror_action ~gitlab_domain: " gitlab.inria.fr" ~owner: " coq"
212214 ~repo: " coq" ~base_ref ~head_sha () ) )
213215 |> Lwt. async ;
@@ -216,13 +218,15 @@ let callback _conn req body =
216218 " Processing push event on Coq repository: analyzing merge / \
217219 backporting info."
218220 ()
219- | Ok (true , PushEvent {owner; repo; base_ref; head_sha; _} ) -> (
221+ | Ok (Some install_id, PushEvent {owner; repo; base_ref; head_sha; _})
222+ -> (
220223 match (owner, repo) with
221224 | "coq-community" , ("docker-base" | "docker-coq" ) ->
222225 (fun () ->
223226 init_git_bare_repository ~bot_info
224227 >> = fun () ->
225- action_as_github_app ~bot_info ~key ~app_id ~owner
228+ action_as_github_app_from_install_id ~bot_info ~key ~app_id
229+ ~install_id
226230 (mirror_action ~gitlab_domain: " gitlab.com" ~owner ~repo
227231 ~base_ref ~head_sha () ) )
228232 |> Lwt. async ;
@@ -237,7 +241,8 @@ let callback _conn req body =
237241 (fun () ->
238242 init_git_bare_repository ~bot_info
239243 >> = fun () ->
240- action_as_github_app ~bot_info ~key ~app_id ~owner
244+ action_as_github_app_from_install_id ~bot_info ~key ~app_id
245+ ~install_id
241246 (mirror_action ~gitlab_domain: " gitlab.inria.fr" ~owner ~repo
242247 ~base_ref ~head_sha () ) )
243248 |> Lwt. async ;
@@ -333,7 +338,7 @@ let callback _conn req body =
333338 Server. respond_string ~status: `OK
334339 ~body: (f " Unhandled new issue: %s" body)
335340 () )
336- | Ok (signed , CommentCreated comment_info ) -> (
341+ | Ok (install_id , CommentCreated comment_info ) -> (
337342 let body =
338343 comment_info.body |> trim_comments
339344 |> strip_quoted_bot_name ~github_bot_name
@@ -394,7 +399,7 @@ let callback _conn req body =
394399 && comment_info.issue.pull_request
395400 && String. equal comment_info.issue.issue.owner " coq"
396401 && String. equal comment_info.issue.issue.repo " coq"
397- && signed
402+ && Option. is_some install_id
398403 then
399404 let full_ci =
400405 match Str. matched_group 1 body with
@@ -421,7 +426,7 @@ let callback _conn req body =
421426 && comment_info.issue.pull_request
422427 && String. equal comment_info.issue.issue.owner " coq"
423428 && String. equal comment_info.issue.issue.repo " coq"
424- && signed
429+ && Option. is_some install_id
425430 then (
426431 (fun () ->
427432 action_as_github_app ~bot_info ~key ~app_id
@@ -439,7 +444,7 @@ let callback _conn req body =
439444 && comment_info.issue.pull_request
440445 && String. equal comment_info.issue.issue.owner " coq"
441446 && String. equal comment_info.issue.issue.repo " coq"
442- && signed
447+ && Option. is_some install_id
443448 then (
444449 (fun () ->
445450 action_as_github_app ~bot_info ~key ~app_id
@@ -458,7 +463,7 @@ let callback _conn req body =
458463 && comment_info.issue.pull_request
459464 && String. equal comment_info.issue.issue.owner " coq"
460465 && String. equal comment_info.issue.issue.repo " coq"
461- && signed
466+ && Option. is_some install_id
462467 then (
463468 (fun () ->
464469 action_as_github_app ~bot_info ~key ~app_id
@@ -472,11 +477,11 @@ let callback _conn req body =
472477 Server. respond_string ~status: `OK
473478 ~body: (f " Unhandled comment: %s" body)
474479 () ) ) )
475- | Ok (signed , CheckRunReRequested {external_id} ) -> (
476- if not signed then
477- Server. respond_string ~status: ( Code. status_of_code 401 )
478- ~body: " Request to rerun check run must be signed. " ()
479- else if String. is_empty external_id then
480+ | Ok (None , CheckRunReRequested _ ) ->
481+ Server. respond_string ~status: ( Code. status_of_code 401 )
482+ ~body: " Request to rerun check run must be signed. " ( )
483+ | Ok (Some _ , CheckRunReRequested {external_id} ) -> (
484+ if String. is_empty external_id then
480485 Server. respond_string ~status: (Code. status_of_code 400 )
481486 ~body: " Request to rerun check run but empty external ID." ()
482487 else
0 commit comments