Skip to content

config: add per-repo TOML schema and parser - #371

Open
lykimq wants to merge 8 commits into
masterfrom
quyen@bot_generic_pr1
Open

config: add per-repo TOML schema and parser#371
lykimq wants to merge 8 commits into
masterfrom
quyen@bot_generic_pr1

Conversation

@lykimq

@lykimq lykimq commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add [repositories.*] config for per-repo settings (project number, teams, jobs, minimizer URL, etc.)
  • Add Repo_config parser + lookup helpers, and load the table at bot startup
  • Extend Utils with TOML helpers for nested tables, ints, bools, and string arrays

No behavior change yet: hardcoded repo checks are unchanged. Later PRs will switch actions/webhooks to this config.

Test plan

  • dune build
  • dune exec tests/test_repo_config.exe (full/minimal/bad github/missing section/find miss)
  • Confirm existing bot startup still works with the updated coqbot-config.toml

@Zimmi48 Zimmi48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks promising!

Comment thread tests/test_repo_config.ml Outdated
gitlab_domain = "gitlab.inria.fr"
gitlab_owner = "coq"
gitlab_repo = "coq"
github_project_number = 11

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this more explicit, like backporting_github_project_number or even move it to a backporting subsection?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have update it in the commit 32632cf

Comment thread tests/test_repo_config.ml Outdated
Comment on lines +17 to +18
team_name = "contributors"
pushers_team = "pushers"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have split them into a section teams, this is the commit: 32632cf

Comment thread tests/test_repo_config.ml Outdated
org_name = "rocq-prover"
team_name = "contributors"
pushers_team = "pushers"
maintainers_team = "coqbot-maintainers"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to alert_mention. 32632cf

Comment thread tests/test_repo_config.ml Outdated

[repositories.rocq.jobs]
bench = "bench"
custom_job_status = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. true use Rocq custom failure handling, and false use 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 the documentation.ml)

@lykimq
lykimq requested a review from Zimmi48 July 30, 2026 09:40
Comment thread coqbot-config.toml Outdated
Co-authored-by: Théo Zimmermann <theo.zimmermann@telecom-paris.fr>
@lykimq
lykimq requested a review from Zimmi48 July 31, 2026 07:31

@Zimmi48 Zimmi48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants