@@ -199,15 +199,17 @@ let callback _conn req body =
199
199
(Request. headers req) body
200
200
with
201
201
| Ok
202
- ( true
202
+ ( Some install_id
203
203
, PushEvent
204
204
{owner= " coq" ; repo= " coq" ; base_ref; head_sha; commits_msg} ) ->
205
205
(fun () ->
206
206
init_git_bare_repository ~bot_info
207
207
>> = 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
209
210
(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
211
213
(mirror_action ~gitlab_domain: " gitlab.inria.fr" ~owner: " coq"
212
214
~repo: " coq" ~base_ref ~head_sha () ) )
213
215
|> Lwt. async ;
@@ -216,13 +218,15 @@ let callback _conn req body =
216
218
" Processing push event on Coq repository: analyzing merge / \
217
219
backporting info."
218
220
()
219
- | Ok (true , PushEvent {owner; repo; base_ref; head_sha; _} ) -> (
221
+ | Ok (Some install_id, PushEvent {owner; repo; base_ref; head_sha; _})
222
+ -> (
220
223
match (owner, repo) with
221
224
| "coq-community" , ("docker-base" | "docker-coq" ) ->
222
225
(fun () ->
223
226
init_git_bare_repository ~bot_info
224
227
>> = 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
226
230
(mirror_action ~gitlab_domain: " gitlab.com" ~owner ~repo
227
231
~base_ref ~head_sha () ) )
228
232
|> Lwt. async ;
@@ -237,7 +241,8 @@ let callback _conn req body =
237
241
(fun () ->
238
242
init_git_bare_repository ~bot_info
239
243
>> = 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
241
246
(mirror_action ~gitlab_domain: " gitlab.inria.fr" ~owner ~repo
242
247
~base_ref ~head_sha () ) )
243
248
|> Lwt. async ;
@@ -333,7 +338,7 @@ let callback _conn req body =
333
338
Server. respond_string ~status: `OK
334
339
~body: (f " Unhandled new issue: %s" body)
335
340
() )
336
- | Ok (signed , CommentCreated comment_info ) -> (
341
+ | Ok (install_id , CommentCreated comment_info ) -> (
337
342
let body =
338
343
comment_info.body |> trim_comments
339
344
|> strip_quoted_bot_name ~github_bot_name
@@ -394,7 +399,7 @@ let callback _conn req body =
394
399
&& comment_info.issue.pull_request
395
400
&& String. equal comment_info.issue.issue.owner " coq"
396
401
&& String. equal comment_info.issue.issue.repo " coq"
397
- && signed
402
+ && Option. is_some install_id
398
403
then
399
404
let full_ci =
400
405
match Str. matched_group 1 body with
@@ -421,7 +426,7 @@ let callback _conn req body =
421
426
&& comment_info.issue.pull_request
422
427
&& String. equal comment_info.issue.issue.owner " coq"
423
428
&& String. equal comment_info.issue.issue.repo " coq"
424
- && signed
429
+ && Option. is_some install_id
425
430
then (
426
431
(fun () ->
427
432
action_as_github_app ~bot_info ~key ~app_id
@@ -439,7 +444,7 @@ let callback _conn req body =
439
444
&& comment_info.issue.pull_request
440
445
&& String. equal comment_info.issue.issue.owner " coq"
441
446
&& String. equal comment_info.issue.issue.repo " coq"
442
- && signed
447
+ && Option. is_some install_id
443
448
then (
444
449
(fun () ->
445
450
action_as_github_app ~bot_info ~key ~app_id
@@ -458,7 +463,7 @@ let callback _conn req body =
458
463
&& comment_info.issue.pull_request
459
464
&& String. equal comment_info.issue.issue.owner " coq"
460
465
&& String. equal comment_info.issue.issue.repo " coq"
461
- && signed
466
+ && Option. is_some install_id
462
467
then (
463
468
(fun () ->
464
469
action_as_github_app ~bot_info ~key ~app_id
@@ -472,11 +477,11 @@ let callback _conn req body =
472
477
Server. respond_string ~status: `OK
473
478
~body: (f " Unhandled comment: %s" body)
474
479
() ) ) )
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
480
485
Server. respond_string ~status: (Code. status_of_code 400 )
481
486
~body: " Request to rerun check run but empty external ID." ()
482
487
else
0 commit comments