config: add per-repo TOML schema and parser - #371
Conversation
| gitlab_domain = "gitlab.inria.fr" | ||
| gitlab_owner = "coq" | ||
| gitlab_repo = "coq" | ||
| github_project_number = 11 |
There was a problem hiding this comment.
Can we make this more explicit, like backporting_github_project_number or even move it to a backporting subsection?
| team_name = "contributors" | ||
| pushers_team = "pushers" |
There was a problem hiding this comment.
Can we make this into something more generic like a section with a team_name field and a permission field which would be a free text string?
There was a problem hiding this comment.
I have split them into a section teams, this is the commit: 32632cf
| org_name = "rocq-prover" | ||
| team_name = "contributors" | ||
| pushers_team = "pushers" | ||
| maintainers_team = "coqbot-maintainers" |
There was a problem hiding this comment.
This one is a bit special, it's just to @-mention someone to alert them (IIRC). We could provide directly the full @-mention, that would be more flexible.
|
|
||
| [repositories.rocq.jobs] | ||
| bench = "bench" | ||
| custom_job_status = true |
There was a problem hiding this comment.
The jobs section is for the repo-specific CI behavior (it will be used by the job handling flow, including doc status handling).
in the job.ml, bench.ml, documentation.ml
bench_job: name of the CI job treated as the bench job. That job uses the bench-specific path (bench status / bench summary/comment)
match (github_repo_full_name, job_info.build_name) with
| "rocq-prover/rocq", "bench" -> ...
use_rocq_job_status: enables Rocq-specific failures/status formatting.trueuse Rocq custom failure handling, andfalseuse the generic failure/status messages.
match job_info.build_status with
| "failed" ->
let failure_reason = Option.value_exn job_info.failure_reason in
let summary_builder, allow_failure_handler =
if String.equal github_repo_full_name "rocq-prover/rocq" then
...
it can be config as:
| "failed" ->
let use_rocq =
Option.value_map repo_cfg ~default:false
~f:(fun cfg -> cfg.jobs.use_rocq_job_status)
in
let summary_builder, allow_failure_handler =
if use_rocq then
( Job_status_rocq.rocq_summary_builder
, Job_status_rocq.handle_rocq_allow_failure )
else
(generic_summary_builder, generic_allow_failure_handler)
in
doc_artifact_jobs: list of doc jobs that should publish documentation (in thedocumentation.ml)
Co-authored-by: Théo Zimmermann <theo.zimmermann@telecom-paris.fr>
Zimmi48
left a comment
There was a problem hiding this comment.
All your PRs are good to merge for me. I let you do it in the order that you prefer, because there might be some merge conflicts.
Summary
[repositories.*]config for per-repo settings (project number, teams, jobs, minimizer URL, etc.)Repo_configparser + lookup helpers, and load the table at bot startupNo behavior change yet: hardcoded repo checks are unchanged. Later PRs will switch actions/webhooks to this config.
Test plan
dune builddune exec tests/test_repo_config.exe(full/minimal/bad github/missing section/find miss)coqbot-config.toml