File tree Expand file tree Collapse file tree 14 files changed +3
-37
lines changed Expand file tree Collapse file tree 14 files changed +3
-37
lines changed Original file line number Diff line number Diff line change 35
35
36
36
- run : opam install . --deps-only --with-doc --with-test
37
37
38
- - run : opam install ocamlformat.0.19.0
38
+ - run : opam install ocamlformat.0.20.1
39
39
40
40
- name : compile
41
41
run : opam exec -- make
Original file line number Diff line number Diff line change 1
- # version=0.19.0
1
+ version=0.20.1
2
2
break-cases=toplevel
3
3
break-infix-before-func=false
4
4
break-infix=fit-or-vertical
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ open Github_j
8
8
exception Action_error of string
9
9
10
10
let action_error msg = raise (Action_error msg)
11
-
12
11
let log = Log. from " action"
13
12
14
13
module Action (Github_api : Api.Github ) (Slack_api : Api.Slack ) = struct
Original file line number Diff line number Diff line change @@ -4,11 +4,8 @@ open Slack_t
4
4
5
5
module type Github = sig
6
6
val get_config : ctx :Context .t -> repo :repository -> (Config_t .config , string ) Result .t Lwt .t
7
-
8
7
val get_api_commit : ctx :Context .t -> repo :repository -> sha :string -> (api_commit , string ) Result .t Lwt .t
9
-
10
8
val get_pull_request : ctx :Context .t -> repo :repository -> number :int -> (pull_request , string ) Result .t Lwt .t
11
-
12
9
val get_issue : ctx :Context .t -> repo :repository -> number :int -> (issue , string ) Result .t Lwt .t
13
10
14
11
val request_reviewers
21
18
22
19
module type Slack = sig
23
20
val send_notification : ctx :Context .t -> msg :post_message_req -> unit slack_response Lwt .t
24
-
25
21
val send_chat_unfurl : ctx :Context .t -> chat_unfurl_req -> unit slack_response Lwt .t
26
-
27
22
val send_auth_test : ctx :Context .t -> unit -> auth_test_res slack_response Lwt .t
28
23
end
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ open Common
3
3
open Devkit
4
4
5
5
let cwd = Caml.Sys. getcwd ()
6
-
7
6
let cache_dir = Caml.Filename. concat cwd " github-api-cache"
8
7
9
8
module Github : Api .Github = struct
@@ -20,17 +19,13 @@ module Github : Api.Github = struct
20
19
| Ok file -> Lwt. return @@ Ok (Github_j. api_commit_of_string file)
21
20
22
21
let get_pull_request ~ctx :_ ~repo :_ ~number :_ = Lwt. return @@ Error " undefined for local setup"
23
-
24
22
let get_issue ~ctx :_ ~repo :_ ~number :_ = Lwt. return @@ Error " undefined for local setup"
25
-
26
23
let request_reviewers ~ctx :_ ~repo :_ ~number :_ ~reviewers :_ = Lwt. return @@ Error " undefined for local setup"
27
24
end
28
25
29
26
module Slack_base : Api .Slack = struct
30
27
let send_notification ~ctx :_ ~msg :_ = Lwt. return @@ Error " undefined for local setup"
31
-
32
28
let send_chat_unfurl ~ctx :_ _ = Lwt. return @@ Error " undefined for local setup"
33
-
34
29
let send_auth_test ~ctx :_ () = Lwt. return @@ Error " undefined for local setup"
35
30
end
36
31
Original file line number Diff line number Diff line change 78
78
79
79
module Slack : Api .Slack = struct
80
80
let log = Log. from " slack"
81
-
82
81
let query_error_msg url e = sprintf " error while querying %s: %s" url e
83
82
84
83
let slack_api_request ?headers ?body meth url read =
Original file line number Diff line number Diff line change @@ -40,11 +40,7 @@ module List_or_default_field = struct
40
40
end
41
41
42
42
module Branch_filters_adapter = List_or_default_field. Make (struct
43
- let field_name = " branch_filters"
44
-
45
- let default_alias = " any"
46
-
47
- let default_value = `List []
43
+ let field_name = " branch_filters" let default_alias = " any" let default_value = `List []
48
44
end )
49
45
50
46
(* * Error detection in Slack API response. The web API communicates errors using
Original file line number Diff line number Diff line change 1
1
(* https://styleguide.github.com/primer/utilities/colors/#background-colors *)
2
2
3
3
let gray = " #f6f8fa"
4
-
5
4
let blue = " #0366d6"
6
-
7
5
let yellow = " #ffd33d"
8
-
9
6
let red = " #d73a49"
10
-
11
7
let green = " #28a745"
12
-
13
8
let purple = " #6f42c1"
Original file line number Diff line number Diff line change @@ -5,21 +5,16 @@ module StringMap = struct
5
5
type 'a t = 'a Map .M (String ).t
6
6
7
7
let empty : 'a t = Map. empty (module String )
8
-
9
8
let to_list (l : 'a t ) : (string * 'a) list = Map. to_alist l
10
-
11
9
let of_list (m : (string * 'a) list ) : 'a t = Map. of_alist_exn (module String ) m
12
-
13
10
let wrap = of_list
14
-
15
11
let unwrap = to_list
16
12
end
17
13
18
14
module Re2 = struct
19
15
include Re2
20
16
21
17
let wrap s = create_exn s
22
-
23
18
let unwrap = Re2. to_string
24
19
end
25
20
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ type gh_link =
93
93
| Commit of repository * commit_hash
94
94
95
95
let gh_link_re = Re2. create_exn {|^ (.* )/ (.+ )/ (.+ )/ (commit| pull| issues)/ ([a- z0-9 ]+ )/?$| }
96
-
97
96
let gh_org_team_re = Re2. create_exn {| [a- zA- Z0 -9 \- ]+/ ([a- zA- Z0 -9 \- ]+ )| }
98
97
99
98
(* * [gh_link_of_string s] parses a URL string [s] to try to match a supported
You can’t perform that action at this time.
0 commit comments