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

Đang mở
#24 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, github, rust
Lĩnh vực
devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Rust
Star
1
Fork
0
Merge trung bình
2 giờ 16 phút
Pull request đã merge (30 ngày)
54

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của romnn/code-review

Tất cả issue của romnn/code-review

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.