@@ -12,7 +12,7 @@ open Lwt.Syntax
12
12
13
13
type coq_job_info =
14
14
{ docker_image : string
15
- ; build_dependency : string
15
+ ; dependencies : string list
16
16
; compiler : string
17
17
; opam_variant : string }
18
18
@@ -77,27 +77,33 @@ let send_status_check ~bot_info job_info ~pr_num (gh_owner, gh_repo)
77
77
if string_match ~regexp line then Some (Str. matched_group 1 line)
78
78
else None ) )
79
79
in
80
+ let find_all regexps =
81
+ List. filter_map trace_lines ~f: (fun line ->
82
+ List. find_map regexps ~f: (fun regexp ->
83
+ if string_match ~regexp line then Some (Str. matched_group 1 line)
84
+ else None ) )
85
+ in
80
86
find
81
87
[ " ^Using Docker executor with image \\ ([^ ]+\\ )"
82
88
; " options=Options(docker='\\ ([^']+\\ )')" ]
83
89
>> = fun docker_image ->
84
- find [" ^Downloading artifacts for \\ (build:[^ ]+\\ )" ]
85
- >> = fun build_dependency ->
90
+ let dependencies = find_all [" ^Downloading artifacts for \\ ([^ ]+\\ )" ] in
86
91
find [" ^COMPILER=\\ (.*\\ )" ]
87
92
>> = fun compiler ->
88
93
find [" ^OPAM_VARIANT=\\ (.*\\ )" ]
89
94
>> = fun opam_variant ->
90
- Some {docker_image; build_dependency ; compiler; opam_variant}
95
+ Some {docker_image; dependencies ; compiler; opam_variant}
91
96
in
92
97
let * summary_tail_prefix =
93
98
match coq_job_info with
94
- | Some {docker_image; build_dependency ; compiler; opam_variant} ->
99
+ | Some {docker_image; dependencies ; compiler; opam_variant} ->
95
100
let switch_name = compiler ^ opam_variant in
101
+ let dependencies = String. concat ~sep: " ` `" dependencies in
96
102
Lwt. return
97
103
(f
98
- " This job ran on the Docker image `%s`, depended on the build job \
99
- `%s` with OCaml `%s` .\n\n "
100
- docker_image build_dependency switch_name )
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 )
101
107
| None ->
102
108
Lwt. return " "
103
109
in
@@ -911,15 +917,16 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
911
917
if
912
918
string_match
913
919
~regexp:
914
- " This job ran on the Docker image `\\ ([^`]+\\ )`, depended on the \
915
- build job ` \\ ([^`]+\\ )` with OCaml ` \\ ([^`] +\\ )` .\n\n "
920
+ " This job ran on the Docker image `\\ ([^`]+\\ )` with OCaml ` \\ ([^`]+ \\ )` and depended on jobs \
921
+ \\ (\\ (` [^`]+` ? \\ ) +\\ ) .\n\n "
916
922
summary
917
923
then
918
- let docker_image, build_job, opam_switch =
924
+ let docker_image, opam_switch, dependencies =
919
925
( Str. matched_group 1 summary
920
926
, Str. matched_group 2 summary
921
927
, Str. matched_group 3 summary )
922
928
in
929
+ let dependencies = Str. split (Str. regexp " [ `]+" ) dependencies in
923
930
let missing_error, non_v_file =
924
931
if
925
932
string_match
@@ -935,16 +942,19 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
935
942
else Some filename )
936
943
else (true , None )
937
944
in
945
+ let extract_artifacts url =
946
+ List. partition_map ~f: (fun name ->
947
+ match extract_artifact_url name url with
948
+ | Some v -> First v
949
+ | None -> Second name)
950
+ (name::dependencies)
951
+ in
938
952
match
939
- ( extract_artifact_url build_job base_pipeline_summary
940
- , extract_artifact_url build_job head_pipeline_summary
941
- , extract_artifact_url name base_pipeline_summary
942
- , extract_artifact_url name head_pipeline_summary )
953
+ ( extract_artifacts base_pipeline_summary
954
+ , extract_artifacts head_pipeline_summary )
943
955
with
944
- | ( Some base_build_url
945
- , Some head_build_url
946
- , Some base_job_url
947
- , Some head_job_url ) ->
956
+ | ( (base_urls, [] )
957
+ , (head_urls, [] ) ) ->
948
958
Ok
949
959
( { base_job_failed
950
960
; base_job_errored
@@ -957,26 +967,18 @@ let ci_minimization_extract_job_specific_info ~head_pipeline_summary
957
967
; full_target= name
958
968
; docker_image
959
969
; opam_switch
960
- ; failing_urls= head_build_url ^ " " ^ head_job_url
961
- ; passing_urls= base_build_url ^ " " ^ base_job_url } )
962
- | None , _ , _ , _ ->
963
- Error
964
- (f " Could not find base build job url for %s in:\n %s" build_job
965
- (collapse_summary " Base Pipeline Summary"
966
- base_pipeline_summary ) )
967
- | _ , None , _ , _ ->
968
- Error
969
- (f " Could not find head build job url for %s in:\n %s" build_job
970
- (collapse_summary " Head Pipeline Summary"
971
- head_pipeline_summary ) )
972
- | _ , _ , None , _ ->
970
+ ; failing_urls= String. concat ~sep: " " head_urls
971
+ ; passing_urls= String. concat ~sep: " " base_urls } )
972
+ | (_ , ((_ :: _ ) as base_failed )), _ ->
973
973
Error
974
- (f " Could not find base job url for %s in:\n %s" name
974
+ (f " Could not find base dependencies artifacts for %s in:\n %s"
975
+ (String. concat ~sep: " " base_failed)
975
976
(collapse_summary " Base Pipeline Summary"
976
977
base_pipeline_summary ) )
977
- | _ , _ , _ , None ->
978
+ | _ , ( _ , (( _ :: _ ) as head_failed )) ->
978
979
Error
979
- (f " Could not find head job url for %s in:\n %s" name
980
+ (f " Could not find head dependencies artifacts for %s in:\n %s"
981
+ (String. concat ~sep: " " head_failed)
980
982
(collapse_summary " Head Pipeline Summary"
981
983
head_pipeline_summary ) )
982
984
else
0 commit comments