Skip to content

Commit

Permalink
Add fallback for backwards compatibility (and hide state)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmandrew committed Jun 27, 2023
1 parent bb4b245 commit 12ad1a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/slack_channel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)

0 comments on commit 12ad1a2

Please sign in to comment.