@@ -112,10 +112,10 @@ let generate_pr_review_notification (ctx : Context.t) notification channel =
112
112
match action with
113
113
| Submitted -> New_message { channel; text = Some summary; attachments; blocks = None }
114
114
| Edited ->
115
- ( match State. get_review_map ctx.state repository.url review.id with
115
+ ( match State. get_review_msg ctx.state repository.url ~issue_num: number review.id with
116
116
| Some ({ channel; ts } : post_message_res ) ->
117
117
Update_message { channel; ts; text = Some summary; attachments; blocks = None }
118
- | None -> invalid_arg (sprintf " could not find comment %d in %s" review.id repository.url)
118
+ | None -> invalid_arg (sprintf " could not find review %d in %s for PR #%n " review.id repository.url number )
119
119
)
120
120
| _ -> invalid_arg " impossible"
121
121
@@ -155,10 +155,10 @@ let generate_pr_review_comment_notification (ctx : Context.t) notification chann
155
155
match action with
156
156
| Created -> New_message { channel; text = Some summary; attachments; blocks = None }
157
157
| Edited ->
158
- ( match State. get_comment_map ctx.state repository.url comment.id with
158
+ ( match State. get_comment_msg ctx.state repository.url ~issue_num: number comment.id with
159
159
| Some ({ channel; ts } : post_message_res ) ->
160
160
Update_message { channel; ts; text = Some summary; attachments; blocks = None }
161
- | None -> invalid_arg (sprintf " could not find comment %d in %s" comment.id repository.url)
161
+ | None -> invalid_arg (sprintf " could not find comment %d in %s for PR #%n " comment.id repository.url number )
162
162
)
163
163
| _ -> invalid_arg " impossible"
164
164
@@ -229,10 +229,10 @@ let generate_issue_comment_notification (ctx : Context.t) notification channel =
229
229
match action with
230
230
| Created -> New_message { channel; text = Some summary; attachments; blocks = None }
231
231
| Edited ->
232
- ( match State. get_comment_map ctx.state repository.url comment.id with
232
+ ( match State. get_comment_msg ctx.state repository.url ~issue_num: number comment.id with
233
233
| Some ({ channel; ts } : post_message_res ) ->
234
234
Update_message { channel; ts; text = Some summary; attachments; blocks = None }
235
- | None -> invalid_arg (sprintf " could not find comment %d in %s" comment.id repository.url)
235
+ | None -> invalid_arg (sprintf " could not find comment %d in %s for issue %n " comment.id repository.url number )
236
236
)
237
237
| _ -> invalid_arg " impossible"
238
238
@@ -371,9 +371,9 @@ let generate_status_notification (cfg : Config_t.config) (notification : status_
371
371
in
372
372
New_message { channel; text = Some summary; attachments = Some [ attachment ]; blocks = None }
373
373
374
- let generate_commit_comment_notification ( ctx : Context.t ) api_commit notification channel =
374
+ let generate_commit_comment_notification api_commit notification channel =
375
375
let { commit; _ } = api_commit in
376
- let { sender; comment; repository; action; _ } = notification in
376
+ let { sender; comment; repository; _ } = notification in
377
377
let commit_id =
378
378
match comment.commit_id with
379
379
| None -> invalid_arg " commit id not found"
@@ -398,15 +398,7 @@ let generate_commit_comment_notification (ctx : Context.t) api_commit notificati
398
398
text = Some (mrkdwn_of_markdown comment.body);
399
399
}
400
400
in
401
- match action with
402
- | Created -> New_message { channel; text = Some summary; attachments = Some [ attachment ]; blocks = None }
403
- | Edited ->
404
- ( match State. get_comment_map ctx.state repository.url comment.id with
405
- | Some ({ channel; ts } : post_message_res ) ->
406
- Update_message { channel; ts; text = Some summary; attachments = Some [ attachment ]; blocks = None }
407
- | None -> invalid_arg (sprintf " could not find comment %d in %s" comment.id repository.url)
408
- )
409
- | _ -> invalid_arg " impossible"
401
+ New_message { channel; text = Some summary; attachments = Some [ attachment ]; blocks = None }
410
402
411
403
let validate_signature ?(version = " v0" ) ?signing_key ~headers body =
412
404
match signing_key with
0 commit comments