File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -350,4 +350,11 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
350
350
| Ok () ->
351
351
match notification.event with
352
352
| Link_shared event -> process_link_shared_event ctx event
353
+
354
+ (* * debugging endpoint to return current in-memory repo config *)
355
+ let print_config (ctx : Context.t ) repo_url =
356
+ log#info " finding config for repo_url: %s" repo_url;
357
+ match Context. find_repo_config ctx repo_url with
358
+ | None -> Lwt. return_error (`Not_found , Printf. sprintf " repo_url not found: %s" repo_url)
359
+ | Some config -> Lwt. return_ok (Config_j. string_of_config config)
353
360
end
Original file line number Diff line number Diff line change 1
1
(executable
2
2
(libraries lib base base.caml cmdliner devkit devkit.core extlib lwt.unix
3
- stdio uri)
3
+ result stdio uri)
4
4
(preprocess
5
5
(pps lwt_ppx))
6
6
(public_name monorobot))
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ let setup_http ~ctx ~signature ~port ~ip =
34
34
in
35
35
match request.meth, List. map Web. urldecode path with
36
36
| _ , [ " stats" ] -> ret @@ Lwt. return (sprintf " %s %s uptime\n " signature Devkit.Action. uptime#get_str)
37
+ | `GET , [ " config" ] ->
38
+ let repo_url = Arg. str " repo" |> Web. urldecode in
39
+ ( match % lwt Action. print_config ctx repo_url with
40
+ | Error (code , msg ) -> ret_err code msg
41
+ | Ok res -> ret ~typ: " application/json" (Lwt. return res)
42
+ )
37
43
| _ , [ " github" ] ->
38
44
log#info " %s" request.body;
39
45
let % lwt () = Action. process_github_notification ctx request.headers request.body in
You can’t perform that action at this time.
0 commit comments