@@ -49,23 +49,19 @@ let generate_pull_request_notification notification channel =
49
49
)
50
50
in
51
51
let summary =
52
- Some
53
- (sprintf " <%s|[%s]> Pull request #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title
54
- action sender.login
55
- )
52
+ sprintf " <%s|[%s]> Pull request #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title
53
+ action sender.login
56
54
in
57
55
{
58
56
channel;
59
- text = None ;
57
+ text = Some summary ;
60
58
attachments =
61
59
Some
62
60
[
63
61
{
64
62
empty_attachments with
65
63
mrkdwn_in = Some [ " text" ];
66
- fallback = summary;
67
64
color = Some " #ccc" ;
68
- pretext = summary;
69
65
text = mrkdwn_of_markdown_opt body;
70
66
};
71
67
];
@@ -91,23 +87,19 @@ let generate_pr_review_notification notification channel =
91
87
)
92
88
in
93
89
let summary =
94
- Some
95
- (sprintf " <%s|[%s]> *%s* <%s|%s> #%d <%s|%s>" repository.url repository.full_name sender.login review.html_url
96
- action_str number html_url title
97
- )
90
+ sprintf " <%s|[%s]> *%s* <%s|%s> #%d <%s|%s>" repository.url repository.full_name sender.login review.html_url
91
+ action_str number html_url title
98
92
in
99
93
{
100
94
channel;
101
- text = None ;
95
+ text = Some summary ;
102
96
attachments =
103
97
Some
104
98
[
105
99
{
106
100
empty_attachments with
107
101
mrkdwn_in = Some [ " text" ];
108
- fallback = summary;
109
102
color = Some " #ccc" ;
110
- pretext = summary;
111
103
text = mrkdwn_of_markdown_opt review.body;
112
104
};
113
105
];
@@ -127,10 +119,8 @@ let generate_pr_review_comment_notification notification channel =
127
119
)
128
120
in
129
121
let summary =
130
- Some
131
- (sprintf " <%s|[%s]> *%s* %s on #%d <%s|%s>" repository.url repository.full_name sender.login action_str number
132
- html_url title
133
- )
122
+ sprintf " <%s|[%s]> *%s* %s on #%d <%s|%s>" repository.url repository.full_name sender.login action_str number
123
+ html_url title
134
124
in
135
125
let file =
136
126
match comment.path with
@@ -139,16 +129,14 @@ let generate_pr_review_comment_notification notification channel =
139
129
in
140
130
{
141
131
channel;
142
- text = None ;
132
+ text = Some summary ;
143
133
attachments =
144
134
Some
145
135
[
146
136
{
147
137
empty_attachments with
148
138
mrkdwn_in = Some [ " text" ];
149
- fallback = summary;
150
139
color = Some " #ccc" ;
151
- pretext = summary;
152
140
footer = file;
153
141
text = Some (mrkdwn_of_markdown comment.body);
154
142
};
@@ -172,23 +160,19 @@ let generate_issue_notification notification channel =
172
160
)
173
161
in
174
162
let summary =
175
- Some
176
- (sprintf " <%s|[%s]> Issue #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title action
177
- sender.login
178
- )
163
+ sprintf " <%s|[%s]> Issue #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title action
164
+ sender.login
179
165
in
180
166
{
181
167
channel;
182
- text = None ;
168
+ text = Some summary ;
183
169
attachments =
184
170
Some
185
171
[
186
172
{
187
173
empty_attachments with
188
174
mrkdwn_in = Some [ " text" ];
189
- fallback = summary;
190
175
color = Some " #ccc" ;
191
- pretext = summary;
192
176
text = mrkdwn_of_markdown_opt body;
193
177
};
194
178
];
@@ -209,23 +193,19 @@ let generate_issue_comment_notification notification channel =
209
193
)
210
194
in
211
195
let summary =
212
- Some
213
- (sprintf " <%s|[%s]> *%s* <%s|%s> on #%d <%s|%s>" repository.url repository.full_name sender.login comment.html_url
214
- action_str number issue.html_url title
215
- )
196
+ sprintf " <%s|[%s]> *%s* <%s|%s> on #%d <%s|%s>" repository.url repository.full_name sender.login comment.html_url
197
+ action_str number issue.html_url title
216
198
in
217
199
{
218
200
channel;
219
- text = None ;
201
+ text = Some summary ;
220
202
attachments =
221
203
Some
222
204
[
223
205
{
224
206
empty_attachments with
225
207
mrkdwn_in = Some [ " text" ];
226
- fallback = summary;
227
208
color = Some " #ccc" ;
228
- pretext = summary;
229
209
text = Some (mrkdwn_of_markdown comment.body);
230
210
};
231
211
];
@@ -283,7 +263,6 @@ let generate_push_notification notification channel =
283
263
{
284
264
empty_attachments with
285
265
mrkdwn_in = Some [ " fields" ];
286
- fallback = Some " Commit pushed notification" ;
287
266
color = Some " #ccc" ;
288
267
fields = Some [ { value = String. concat ~sep: " \n " commits; title = None ; short = false } ];
289
268
};
@@ -335,27 +314,23 @@ let generate_status_notification (cfg : Config_t.config) (notification : status_
335
314
let summary =
336
315
match target_url with
337
316
| None ->
338
- Some ( sprintf " <%s|[%s]> CI Build Status notification: %s" repository.url repository.full_name state_info)
317
+ sprintf " <%s|[%s]> CI Build Status notification: %s" repository.url repository.full_name state_info
339
318
(* in case the CI run is not using buildkite *)
340
- | Some t ->
341
- Some
342
- (sprintf " <%s|[%s]> CI Build Status notification for <%s|%s>: %s" repository.url repository.full_name t context
343
- state_info
344
- )
319
+ | Some target_url ->
320
+ sprintf " <%s|[%s]> CI Build Status notification for <%s|%s>: %s" repository.url repository.full_name target_url
321
+ context state_info
345
322
in
346
323
let msg = String. concat ~sep: " \n " @@ List. concat [ commit_info; branches_info ] in
347
324
let attachment =
348
325
{
349
326
empty_attachments with
350
327
mrkdwn_in = Some [ " fields" ; " text" ];
351
- fallback = summary;
352
- pretext = summary;
353
328
color = Some color_info;
354
329
text = description_info;
355
330
fields = Some [ { title = None ; value = msg; short = false } ];
356
331
}
357
332
in
358
- { channel; text = None ; attachments = Some [ attachment ]; blocks = None }
333
+ { channel; text = Some summary ; attachments = Some [ attachment ]; blocks = None }
359
334
360
335
let generate_commit_comment_notification api_commit notification channel =
361
336
let { commit; _ } = api_commit in
@@ -366,10 +341,8 @@ let generate_commit_comment_notification api_commit notification channel =
366
341
| Some c -> c
367
342
in
368
343
let summary =
369
- Some
370
- (sprintf " <%s|[%s]> *%s* commented on `<%s|%s>` %s" repository.url repository.full_name sender.login
371
- comment.html_url (git_short_sha_hash commit_id) (first_line commit.message)
372
- )
344
+ sprintf " <%s|[%s]> *%s* commented on `<%s|%s>` %s" repository.url repository.full_name sender.login comment.html_url
345
+ (git_short_sha_hash commit_id) (first_line commit.message)
373
346
in
374
347
let path =
375
348
match comment.path with
@@ -380,14 +353,12 @@ let generate_commit_comment_notification api_commit notification channel =
380
353
{
381
354
empty_attachments with
382
355
mrkdwn_in = Some [ " pretext" ; " text" ];
383
- fallback = summary;
384
356
color = Some " #ccc" ;
385
- pretext = summary;
386
357
footer = path;
387
358
text = Some (mrkdwn_of_markdown comment.body);
388
359
}
389
360
in
390
- { channel; text = None ; attachments = Some [ attachment ]; blocks = None }
361
+ { channel; text = Some summary ; attachments = Some [ attachment ]; blocks = None }
391
362
392
363
let validate_signature ?(version = " v0" ) ?signing_key ~headers body =
393
364
match signing_key with
0 commit comments