refactor(core): split typed_api.rs and move its inline tests out
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with aimdb-core/src/typed_api.rs and its inline tests, then inspect aimdb-core/src/typed_record.rs and aimdb-core/src/session/client.rs to understand the module conventions and feature gates. Split the typed API concerns into the suggested modules, preserve public paths, and reorganize the tests around shared mocks; assess whether typed_record's gated blocks can use internal helpers. Done when the files are easier to navigate and the refactor introduces no behavior change.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A few aimdb-core modules have grown well past the size where they are easy to navigate or review.
aimdb-core/src/typed_api.rs— 3,748 lines. The non-test part (lines 1–1783) holds five separate concerns:Producer<T>(104),Consumer<T>(226),RecordRegistrar(468),OutboundLinkBuilder(917) andInboundLinkBuilder(1241). The remaining ~1,960 lines are one inlinemod testscontaining five hand-written mock trait impls whose methods areunimplemented!("not needed for … tests")(lines 1837, 1861, 2968, 3062, 3261).aimdb-core/src/typed_record.rs— 1,726 lines, 54cfg(feature …)gates, the highest gate density in the workspace, plus four#[allow(unused_mut)](858, 1167, 1203, 1279) that exist only because of those gates.aimdb-core/src/session/client.rs— 1,685 lines (tests from line 1013).
Suggested work
- Turn
typed_api.rsinto atyped_api/module:producer.rs,consumer.rs,registrar.rs,link_outbound.rs,link_inbound.rs, re-exported frommod.rsso the public paths do not change. - Move the inline tests into per-concern test modules and share one mock connector/runtime between them instead of five partial mocks.
- For
typed_record.rs, look at whether the gated blocks can be grouped behind a small number of internal helper functions so theunused_mutallows disappear.
No behaviour change intended; purely a move/re-organise refactor.
Notes
Line numbers are from the tree at d9c7be0. Sizes were measured with wc -l; the split points are the first top-level #[cfg(test)] in each file.
- Ngôn ngữ chính
- Rust
- Star
- 101
- Fork
- 20
- Merge trung bình
- 2 giờ 33 phút
- Pull request đã merge (30 ngày)
- 90
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aimdb-dev/aimdb
-
🏷️ good first issue enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aimdb-dev/aimdb
Issue tương tự
-
Panic on live viewport resize when unstyled elements exist in display: none subtreeCó thể đã có người làm @GoCoder7 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DioxusLabs/blitz#1488 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
S-Needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
vectordotdev/vrl#2042 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày