From 12ad1a22b30343ea3b65acea6811f975d0caaad5 Mon Sep 17 00:00:00 2001 From: benmandrew Date: Mon, 12 Jun 2023 17:22:18 +0200 Subject: [PATCH] Add fallback for backwards compatibility (and hide state) --- src/build.ml | 2 +- src/slack_channel.ml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/build.ml b/src/build.ml index 39d9bf0..19bfb81 100644 --- a/src/build.ml +++ b/src/build.ml @@ -31,7 +31,7 @@ let notify ?channel ~web_ui ~service ~commit ~repo x = | None -> x | Some { Slack_channel.uri; mode; repositories = _ } -> let s = - let+ state = Current.state x + let+ state = Current.state ~hidden:true x and+ commit in match state, mode with | Error (`Msg _), Slack_channel.Failure diff --git a/src/slack_channel.ml b/src/slack_channel.ml index 49fea0c..f02a368 100644 --- a/src/slack_channel.ml +++ b/src/slack_channel.ml @@ -40,5 +40,7 @@ let parse_json s = in try from_string s |> Util.to_list |> List.map read_channel - with ex -> - Fmt.failwith "Failed to parse slack URIs '%S': %a" s Fmt.exn ex + with _ -> + let uri = Current_slack.channel @@ Uri.of_string @@ String.trim s in + [ { uri; mode = All; repositories = All_repos } ] + (* Fmt.failwith "Failed to parse slack URIs '%S': %a" s Fmt.exn e *)