List view
Note: **We can propose this as a topic for a Master’s internship** ([draft proposal](https://github.com/rocq-prover/bot/blob/quyen%40proposal_ocaml5/internship_proposal_m2.md)) LWT is currently used throughout the codebase for HTTP requests (Cohttp_lwt), Git operations (Lwt_process, Lwt_io), GraphQL queries, webhook handling, and all I/O operations. OCaml 5 introduces effect handlers that enable direct-style concurrency without monads. The main alternative to LWT is **Eio** (Effect-based I/O), which provides non-local control flow, direct-style code (no monadic bind operators), and fiber-based concurrency similar to async/await. **Risks**: - This will touch nearly every file - HTTP and webhook handling are ciritcal - Eio's ecosystem is still maturing # Migration plan **LWT -> Eio** - `Cohttp_lwt` -> `piaf` or `cohttp-eio` - `Lwt_process` -> `eio.process` - `Lwt_io` -> `eio.flow` - ... ## Migrate strategy One module at a time, complete with test passed. We can try the `Lwt_eio` approach, which allows running [Lwt code](https://github.com/ocaml-multicore/lwt_eio) from within Eio.
No due dateGoal: Transform the bot into a modular, testable, and maintainable system (keep all existing functionality). # Checklist ## Modularization and move `src` to `bot-components` - [x] `src/git_utils.ml` [#PR 349](https://github.com/rocq-prover/bot/pull/349) - [x] `src/github_installations.ml` [#PR 350](https://github.com/rocq-prover/bot/pull/350) - [x] `src/helpers.ml` move all functions in helpers to bot-components, merge them with the `Utils` or `Git_utils`, etc. [#PR 351](https://github.com/rocq-prover/bot/pull/351) - [ ] `src/actions.ml`, `src/bot.ml`, `src/config.ml` move functions not bot-specific to `bot-components`, refactor `src`, etc. [#PR 352](https://github.com/rocq-prover/bot/pull/352) What stays in `src`: - Bot-specific ## Remove use user account [legacy](https://github.com/rocq-prover/bot) - [ ] Feature remove [#PR 354](https://github.com/rocq-prover/bot/pull/354) ## Phase 2 remove `rocq` hardcoded in bot - [ ] Refactor `src` [#PR 358](https://github.com/rocq-prover/bot/pull/358) - [ ] TOML configuration [#PR 357](https://github.com/rocq-prover/bot/pull/357) - [ ] Generic bot configuration system [#PR 359](https://github.com/rocq-prover/bot/pull/359) ## Testing - [ ] Add unit test (Alcotest) - [ ] Create test suite for all moved components (HTTP client/server, Git operations, webhook handling, GraphQL client, etc.) - design for easy migration to OCaml 5 later ## New features (all in `bot-components`) - [ ] Error handling `errors.ml` ([#264](https://github.com/coq/bot/issues/264) - structured error types, [#223](https://github.com/coq/bot/issues/223) - replace `result` with `Result.t`) - [ ] Logging handling `logger.ml` ([#227](https://github.com/coq/bot/issues/227) - logs lack context, [#323](https://github.com/coq/bot/issues/323) - secret leak in logs, [#280](https://github.com/coq/bot/issues/280) - git output overflows log sinks, [#275](https://github.com/coq/bot/issues/275) - log GraphQL warning) ## OCaml 5 Migration (details in [milestone 4](https://github.com/rocq-prover/bot/milestone/4))
No due date- No due date•31/31 issues closed