@@ -11,8 +11,12 @@ let gitlab_repo ~bot_info ~gitlab_domain ~gitlab_full_name =
11
11
|> Result. map ~f: (fun token ->
12
12
f " https://oauth2:%s@%s/%s.git" token gitlab_domain gitlab_full_name )
13
13
14
- let report_status command report code =
15
- Error (f {| Command " %s" % s % d\n| } command report code)
14
+ let report_status ?(mask = [] ) command report code =
15
+ Error
16
+ (List. fold_left
17
+ ~init: (f {| Command " %s" % s % d% s| } command report code " \n " )
18
+ ~f: (fun acc m -> Str. global_replace (Str. regexp_string m) " XXXXX" acc)
19
+ mask)
16
20
17
21
let gitlab_ref ~bot_info ~(issue : issue ) ~github_mapping ~gitlab_mapping =
18
22
let default_gitlab_domain = " gitlab.com" in
@@ -82,19 +86,19 @@ let gitlab_ref ~bot_info ~(issue : issue) ~github_mapping ~gitlab_mapping =
82
86
83
87
let ( |&& ) command1 command2 = command1 ^ " && " ^ command2
84
88
85
- let execute_cmd command =
89
+ let execute_cmd ?( mask = [] ) command =
86
90
Lwt_io. printf " Executing command: %s\n " command
87
91
>> = fun () ->
88
92
Lwt_unix. system command
89
93
> |= fun status ->
90
94
match status with
91
95
| Unix. WEXITED code ->
92
96
if Int. equal code 0 then Ok ()
93
- else report_status command " exited with status" code
97
+ else report_status ~mask command " exited with status" code
94
98
| Unix. WSIGNALED signal ->
95
- report_status command " was killed by signal number" signal
99
+ report_status ~mask command " was killed by signal number" signal
96
100
| Unix. WSTOPPED signal ->
97
- report_status command " was stopped by signal number" signal
101
+ report_status ~mask command " was stopped by signal number" signal
98
102
99
103
let git_fetch ?(force = true ) remote_ref local_branch_name =
100
104
f " git fetch --quiet -fu %s %s%s:%s" remote_ref.repo_url
@@ -166,7 +170,7 @@ let git_coq_bug_minimizer ~bot_info ~script ~comment_thread_id ~comment_author
166
170
; coq_version
167
171
; ocaml_version
168
172
; minimizer_extra_arguments |> String. concat ~sep: " " ]
169
- |> execute_cmd
173
+ |> execute_cmd ~mask: [bot_info.github_pat]
170
174
171
175
let git_run_ci_minimization ~bot_info ~comment_thread_id ~owner ~repo ~pr_number
172
176
~docker_image ~target ~opam_switch ~failing_urls ~passing_urls ~base ~head
@@ -192,14 +196,14 @@ let git_run_ci_minimization ~bot_info ~comment_thread_id ~owner ~repo ~pr_number
192
196
@
193
197
match bug_file_name with Some bug_file_name -> [bug_file_name] | None -> [] )
194
198
|> Stdlib.Filename. quote_command " ./run_ci_minimization.sh"
195
- |> execute_cmd
199
+ |> execute_cmd ~mask: [bot_info.github_pat]
196
200
197
201
let init_git_bare_repository ~bot_info =
198
202
let * () = Lwt_io. printl " Initializing repository..." in
199
203
" git init --bare"
200
204
|&& f {| git config user.email " %s" | } bot_info.email
201
205
|&& f {| git config user.name " %s" | } bot_info.github_name
202
- |> execute_cmd
206
+ |> execute_cmd ~mask: [bot_info.github_pat]
203
207
>> = function
204
208
| Ok _ ->
205
209
Lwt_io. printl " Bare repository initialized."
0 commit comments