coq/bot

ci minimization is broken due to change in format of reporting results

Closed this issue · 4 comments

Did the CI recently stop reporting on job configuration information?
image
https://github.com/coq/coq/pull/17937/checks?check_run_id=16164573704

Compare with
https://github.com/coq/coq/pull/17811/checks?check_run_id=14777475244
image


I was unable to minimize any of the CI targets that you requested.
library:ci-fiat_crypto could not be minimized (Could not find needed parameters for job library:ci-fiat_crypto in summary:

Summary

This job has failed. If you need to, you can restart it directly in the GitHub interface using the "Re-run" button.

We show below an excerpt from the trace from GitLab starting around the last detected "Error" (the complete trace is available here).

)

Originally posted by @coqbot-app[bot] in coq/coq#17937 (comment)

Looking at the code constructing the missing message, it parses the trace of the job to find the information it needs, and it prints the missing line only if it finds it all, so as soon as some information is missing, none is printed:

bot/src/actions.ml

Lines 74 to 130 in 7c4fbb6

let coq_job_info =
let open Option in
let find regexp =
List.find_map trace_lines ~f:(fun line ->
if string_match ~regexp line then Some (Str.matched_group 1 line)
else None )
in
find "^Using Docker executor with image \\([^ ]+\\)"
>>= fun docker_image ->
find "^Downloading artifacts for \\(build:[^ ]+\\)"
>>= fun build_dependency ->
find "^COMPILER=\\(.*\\)"
>>= fun compiler ->
find "^COMPILER_EDGE=\\(.*\\)"
>>= fun compiler_edge ->
find "^OPAM_VARIANT=\\(.*\\)"
>>= fun opam_variant ->
find "^OPAM_SWITCH=\\(.*\\)"
>>= fun opam_switch ->
Some
{ docker_image
; build_dependency
; compiler
; compiler_edge
; opam_variant
; opam_switch }
in
let* summary_tail_prefix =
match coq_job_info with
| Some
{ docker_image
; build_dependency
; compiler
; compiler_edge
; opam_variant
; opam_switch= ("base" | "edge") as opam_switch } ->
let switch_name =
( match opam_switch with
| "base" ->
compiler
| "edge" ->
compiler_edge
| _ ->
failwith "opam_switch was already determined to be base or edge"
)
^ opam_variant
in
Lwt.return
(f
"This job ran on the Docker image `%s`, depended on the build job \
`%s` with OCaml `%s`.\n\n"
docker_image build_dependency switch_name )
| Some {opam_switch} ->
let* () = Lwt_io.printlf "Unrecognized OPAM_SWITCH: %s." opam_switch in
Lwt.return ""
| None ->
Lwt.return ""

I have one very likely candidate responsible for breaking this trace parsing: coq/coq#17785

EDIT: I confirm that the missing line started missing when this PR was merged (August 4th).

Indeed, this PR removed the OPAM_SWITCH and the COMPILER_EDGE variables. So not just the parsing will need to be adapted, but also the run-bug-minimizer scripts. EDIT: no, they didn't use these variables directly.

Now the script should always use: "${COMPILER}${OPAM_VARIANT}". See coq/coq@6072527#diff-037ea159eb0a7cb0ac23b851e66bee30fb838ee8d0d99fa331a1ba65283d37f7L53-L56.

I believe this issue to be entirely resolved, but this will need to be confirmed in the next minimization attempts. At least, the reporting of where jobs ran is back to normal.