@@ -13,6 +13,7 @@ open Lwt.Syntax
13
13
type coq_job_info =
14
14
{ docker_image : string
15
15
; dependencies : string list
16
+ ; targets : string list
16
17
; compiler : string
17
18
; opam_variant : string }
18
19
@@ -88,22 +89,29 @@ let send_status_check ~bot_info job_info ~pr_num (gh_owner, gh_repo)
88
89
; " options=Options(docker='\\ ([^']+\\ )')" ]
89
90
>> = fun docker_image ->
90
91
let dependencies = find_all [" ^Downloading artifacts for \\ ([^ ]+\\ )" ] in
92
+ (* The CI script prints "CI_TARGETS=foo bar" through "env" if it is non-default,
93
+ then "CI_TARGETS = foo bar" even if it is the default (from job name).
94
+ We use the later. *)
95
+ find [" ^CI_TARGETS = \\ (.*\\ )" ]
96
+ >> = fun targets ->
97
+ let targets = String. split ~on: ' ' targets in
91
98
find [" ^COMPILER=\\ (.*\\ )" ]
92
99
>> = fun compiler ->
93
100
find [" ^OPAM_VARIANT=\\ (.*\\ )" ]
94
101
>> = fun opam_variant ->
95
- Some {docker_image; dependencies; compiler; opam_variant}
102
+ Some {docker_image; dependencies; targets; compiler; opam_variant}
96
103
in
97
104
let * summary_tail_prefix =
98
105
match coq_job_info with
99
- | Some {docker_image; dependencies; compiler; opam_variant} ->
106
+ | Some {docker_image; dependencies; targets; compiler; opam_variant} ->
100
107
let switch_name = compiler ^ opam_variant in
101
108
let dependencies = String. concat ~sep: " ` `" dependencies in
109
+ let targets = String. concat ~sep: " ` `" targets in
102
110
Lwt. return
103
111
(f
104
- " This job ran on the Docker image `%s` with OCaml `%s` and depended on jobs \
105
- `%s` .\n\n "
106
- docker_image switch_name dependencies )
112
+ " This job ran on the Docker image `%s` with OCaml `%s` and \
113
+ depended on jobs `%s`. It built targets `%s` .\n\n "
114
+ docker_image switch_name dependencies targets )
107
115
| None ->
108
116
Lwt. return " "
109
117
in
@@ -734,6 +742,7 @@ let create_pipeline_summary ?summary_top pipeline_info pipeline_url =
734
742
type ci_minimization_info =
735
743
{ target : string
736
744
; full_target : string
745
+ ; ci_targets : string list
737
746
; docker_image : string
738
747
; opam_switch : string
739
748
; failing_urls : string
@@ -857,10 +866,16 @@ let run_ci_minimization ~bot_info ~comment_thread_id ~owner ~repo ~pr_number
857
866
>> = fun () ->
858
867
let bug_file_name = Option. map ~f: (fun _ -> bug_file_name) bug_file in
859
868
Lwt_list. map_s
860
- (fun {target; opam_switch; failing_urls; passing_urls; docker_image} ->
869
+ (fun { target
870
+ ; ci_targets
871
+ ; opam_switch
872
+ ; failing_urls
873
+ ; passing_urls
874
+ ; docker_image } ->
861
875
git_run_ci_minimization ~bot_info ~comment_thread_id ~owner ~repo
862
- ~pr_number ~docker_image ~target ~opam_switch ~failing_urls
863
- ~passing_urls ~base ~head ~minimizer_extra_arguments ~bug_file_name
876
+ ~pr_number ~docker_image ~ci_targets ~target ~opam_switch
877
+ ~failing_urls ~passing_urls ~base ~head ~minimizer_extra_arguments
878
+ ~bug_file_name
864
879
>> = fun result -> Lwt. return (target, result) )
865
880
ci_minimization_infos
866
881
>> = Lwt. return_ok )
@@ -917,16 +932,19 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
917
932
if
918
933
string_match
919
934
~regexp:
920
- " This job ran on the Docker image `\\ ([^`]+\\ )` with OCaml `\\ ([^`]+\\ )` and depended on jobs \
921
- \\ (\\ (`[^`]+` ?\\ )+\\ ) .\n\n "
935
+ " This job ran on the Docker image `\\ ([^`]+\\ )` with OCaml \
936
+ `\\ ([^`]+\\ )` and depended on jobs \\ (\\ (`[^`]+` ?\\ )+\\ ). It \
937
+ built targets \\ (\\ (`[^`]+` ?\\ )+\\ ).\n\n "
922
938
summary
923
939
then
924
- let docker_image, opam_switch, dependencies =
940
+ let docker_image, opam_switch, dependencies, targets =
925
941
( Str. matched_group 1 summary
926
942
, Str. matched_group 2 summary
927
- , Str. matched_group 3 summary )
943
+ , Str. matched_group 3 summary
944
+ , Str. matched_group 4 summary )
928
945
in
929
946
let dependencies = Str. split (Str. regexp " [ `]+" ) dependencies in
947
+ let ci_targets = Str. split (Str. regexp " [ `]+" ) targets in
930
948
let missing_error, non_v_file =
931
949
if
932
950
string_match
@@ -943,18 +961,20 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
943
961
else (true , None )
944
962
in
945
963
let extract_artifacts url =
946
- List. partition_map ~f: (fun name ->
964
+ List. partition_map
965
+ ~f: (fun name ->
947
966
match extract_artifact_url name url with
948
- | Some v -> First v
949
- | None -> Second name)
950
- (name::dependencies)
967
+ | Some v ->
968
+ First v
969
+ | None ->
970
+ Second name )
971
+ (name :: dependencies)
951
972
in
952
973
match
953
974
( extract_artifacts base_pipeline_summary
954
975
, extract_artifacts head_pipeline_summary )
955
976
with
956
- | ( (base_urls, [] )
957
- , (head_urls, [] ) ) ->
977
+ | (base_urls , [] ), (head_urls , [] ) ->
958
978
Ok
959
979
( { base_job_failed
960
980
; base_job_errored
@@ -965,17 +985,18 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
965
985
; job_target= target (* ; overlayed= false (* XXX FIXME *) *) }
966
986
, { target
967
987
; full_target= name
988
+ ; ci_targets
968
989
; docker_image
969
990
; opam_switch
970
991
; failing_urls= String. concat ~sep: " " head_urls
971
992
; passing_urls= String. concat ~sep: " " base_urls } )
972
- | (_ , (( _ :: _ ) as base_failed )), _ ->
993
+ | (_ , (_ :: _ as base_failed )), _ ->
973
994
Error
974
995
(f " Could not find base dependencies artifacts for %s in:\n %s"
975
996
(String. concat ~sep: " " base_failed)
976
997
(collapse_summary " Base Pipeline Summary"
977
998
base_pipeline_summary ) )
978
- | _ , (_ , (( _ :: _ ) as head_failed )) ->
999
+ | _ , (_ , (_ :: _ as head_failed )) ->
979
1000
Error
980
1001
(f " Could not find head dependencies artifacts for %s in:\n %s"
981
1002
(String. concat ~sep: " " head_failed)
@@ -2156,11 +2177,13 @@ let coq_bug_minimizer_resume_ci_minimization_action ~bot_info ~key ~app_id body
2156
2177
; pr_number ] -> (
2157
2178
message |> String. split ~on: '\n'
2158
2179
|> function
2159
- | docker_image :: target :: opam_switch :: failing_urls :: passing_urls
2160
- :: base :: head :: extra_arguments_joined :: bug_file_lines ->
2180
+ | docker_image :: target :: ci_targets_joined :: opam_switch
2181
+ :: failing_urls :: passing_urls :: base :: head
2182
+ :: extra_arguments_joined :: bug_file_lines ->
2161
2183
(let minimizer_extra_arguments =
2162
2184
String. split ~on: ' ' extra_arguments_joined
2163
2185
in
2186
+ let ci_targets = String. split ~on: ' ' ci_targets_joined in
2164
2187
let bug_file_contents = String. concat ~sep: " \n " bug_file_lines in
2165
2188
fun () ->
2166
2189
init_git_bare_repository ~bot_info
@@ -2173,6 +2196,7 @@ let coq_bug_minimizer_resume_ci_minimization_action ~bot_info ~key ~app_id body
2173
2196
~minimizer_extra_arguments
2174
2197
~ci_minimization_infos:
2175
2198
[ { target
2199
+ ; ci_targets
2176
2200
; opam_switch
2177
2201
; failing_urls
2178
2202
; passing_urls
0 commit comments