Spike: async Rust and async-process for the git and gh process layer

Aperta
#24 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, github, rust
Ambito
devtools

Direzione di ricerca

Start with crates/review-core/src/review/github.rs, where the gh pull-request lookup runs with a deadline and reader threads, and read CLAUDE.md for the synchronous-core rule. This is a spike: the outcome is a comparison of async-process against a tokio alternative on the gh lookup, not a merged rewrite. Done means a written result on line count, API spread and binary-size cost, with an ADR if the core is to become async.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

deferred

A spike, for later: try async Rust for the process and I/O layer, and adopt it only if the code gets simpler or gains something concrete.

Why

The engine spawns git and gh and waits on them. Some of that code is hand-rolled around blocking calls: the pull-request lookup runs gh with a deadline and threads that read its pipes (crates/review-core/src/review/github.rs), and a capture that is out of date runs its git commands to the end because nothing can cancel them. Async processes give timeouts, pipe draining and cancellation by dropping a future.

The design work for #19 concluded that async does not fix its refusals or blocking, so this is separate from it.

Try

  • async-process (runtime-agnostic, so it runs on gpui's executor in review-gui) with a lightweight executor such as smol in review-tui and the CLI, and tokio as the alternative to compare.
  • Start with the gh lookup, then a capture's git commands with cancellation of a superseded capture.
  • Keep CPU work (analysis, diffing, tree-sitter) and the event log's lock and appends synchronous; an append must run to a known outcome.

Decide

  • Lines and concepts removed or added, and how readable the result is.
  • Whether async spreads into review-core's public API; CLAUDE.md requires a synchronous core, so making it async needs an ADR that revisits that rule.
  • Dependency and binary size cost, and whether embedders would inherit a runtime.
Lingua principale
Rust
Stelle
1
Fork
0
Merge medio
2h 16m
PR unite (30g)
54

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di romnn/code-review

Tutte le issue di romnn/code-review

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.