@@ -5,6 +5,7 @@ open Bot_components.GitHub_GitLab_sync
55open Git_utils
66open Utils
77open Lwt.Infix
8+ open Repo_config
89
910let job_action ~bot_info ~repo_config_table
1011 ({build_name; common_info = {http_repo_url} } as job_info ) ~gitlab_mapping =
@@ -23,16 +24,49 @@ let job_action ~bot_info ~repo_config_table
2324 f " %s,projects/%d/jobs/%d" http_repo_url job_info.common_info.project_id
2425 job_info.build_id
2526 in
26- match (github_repo_full_name, job_info.build_name) with
27- | "rocq-prover/rocq" , "bench" ->
28- Bench. update_bench_status ~bot_info ~repo_config_table ~job_info
29- (gh_owner, gh_repo) ~external_id ~number: pr_num
30- | _ , _ -> (
27+ let repo_config =
28+ get_repo_config_opt ~owner: gh_owner ~repo: gh_repo repo_config_table
29+ in
30+ (* Original: hardcoded check for "rocq-prover/rocq", "bench"
31+ Now: use repo_config.jobs.bench if available, fallback to hardcoded check *)
32+ let is_bench_job =
33+ match repo_config with
34+ | Some config -> (
35+ match config.jobs with
36+ | Some jobs -> (
37+ match jobs.bench with
38+ | Some bench_job_name ->
39+ String. equal job_info.build_name bench_job_name
40+ | None ->
41+ false )
42+ | None ->
43+ false )
44+ | None ->
45+ false
46+ in
47+ let is_rocq_bench =
48+ String. equal github_repo_full_name " rocq-prover/rocq"
49+ && String. equal job_info.build_name " bench"
50+ in
51+ if is_bench_job || is_rocq_bench then
52+ Bench. update_bench_status ~bot_info ~repo_config_table ~job_info
53+ (gh_owner, gh_repo) ~external_id ~number: pr_num
54+ else
3155 match job_info.build_status with
3256 | "failed" ->
3357 let failure_reason = Option. value_exn job_info.failure_reason in
58+ (* Original: hardcoded check for "rocq-prover/rocq" for rocq-specific handling
59+ Now: use repo_config if available, fallback to hardcoded check *)
60+ let is_rocq_repo =
61+ match repo_config with
62+ | Some config ->
63+ String. equal config.github_owner " rocq-prover"
64+ && String. equal config.github_repo " rocq"
65+ | None ->
66+ String. equal github_repo_full_name " rocq-prover/rocq"
67+ in
3468 let summary_builder, allow_failure_handler =
35- if String. equal github_repo_full_name " rocq-prover/rocq " then
69+ if is_rocq_repo then
3670 ( Job_status_rocq. rocq_summary_builder
3771 , fun ~bot_info ~job_name ~job_url ~pr_num ~head_commit
3872 (gh_owner , gh_repo ) ~gitlab_repo_full_name ->
@@ -54,13 +88,8 @@ let job_action ~bot_info ~repo_config_table
5488 Job_status. job_success_or_pending ~bot_info (gh_owner, gh_repo)
5589 job_info ~github_repo_full_name ~gitlab_domain
5690 ~gitlab_repo_full_name ~context ~state ~external_id
57- < &>
58- let repo_config =
59- Repo_config. get_repo_config_opt ~owner: gh_owner ~repo: gh_repo
60- repo_config_table
61- in
62- Documentation. send_doc_url ~bot_info ~github_repo_full_name
63- ?repo_config job_info
91+ < &> Documentation. send_doc_url ~bot_info ~github_repo_full_name
92+ ?repo_config job_info
6493 | ("created" | "running" ) as state ->
6594 Job_status. job_success_or_pending ~bot_info (gh_owner, gh_repo)
6695 job_info ~github_repo_full_name ~gitlab_domain
@@ -73,4 +102,4 @@ let job_action ~bot_info ~repo_config_table
73102 request. *)
74103 Lwt. return_unit
75104 | unknown_state ->
76- Lwt_io. printlf " Unknown job status: %s" unknown_state ) )
105+ Lwt_io. printlf " Unknown job status: %s" unknown_state )
0 commit comments