Skip to content

Commit b27cdfa

Browse files
strip setup info from failed steps logs
1 parent 088b8a6 commit b27cdfa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/slack.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ let generate_status_notification ~(job_log : (string * string) list) ~(cfg : Con
414414
in
415415
let text = Some (String.concat "\n" @@ List.concat [ commit_info; branches_info ]) in
416416
let attachment = { empty_attachments with mrkdwn_in = Some [ "fields"; "text" ]; color = Some color_info; text } in
417-
let reply_of_log log = log |> Text_cleanup.cleanup |> String.split_on_char '\r' |> String.concat "\n" in
418417
let handler =
419418
match job_log with
420419
| [] ->
@@ -425,7 +424,10 @@ let generate_status_notification ~(job_log : (string * string) list) ~(cfg : Con
425424
let files =
426425
job_log
427426
|> List.map (fun (job_name, job_log) ->
428-
{ name = job_name; title = None; alt_txt = None; content = reply_of_log job_log })
427+
let clean = job_log |> Text_cleanup.cleanup |> String.split_on_char '\r' |> String.concat "\n" in
428+
(* Buildkite has different "sections" on their builds logs. The commands we run come only after this line. *)
429+
let content = Stre.after clean "~~~ Running commands\n\n" in
430+
{ name = job_name; title = None; alt_txt = None; content })
429431
in
430432
Some
431433
(fun (send_file : file:file_req -> (unit, string) result Lwt.t) (res : Slack_t.post_message_res) ->

0 commit comments

Comments
 (0)