Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Use core's blob fetch-summary formatter in apply's fetch_stage instead of a drifted copy

Đang mở Phù hợp với người mới
#1,838 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Đọc crates/socket-patch-cli/src/commands/fetch_stage.rs cùng với các bộ định dạng của core trong crates/socket-patch-core/src/api/blob_fetcher.rs; repair được nêu là một bên gọi hiện có. Cập nhật fetch stage để dùng các bộ định dạng thành công và thất bại của core, đồng thời giữ lại dòng total == 0, sau đó cập nhật các bài kiểm tra fetch_stage và apply_render được nêu. Hoàn tất khi đầu ra thành công không thay đổi và đầu ra thất bại khớp với định dạng đã sắp xếp, ngắn gọn của core, không có dấu hai chấm ở cuối.

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

Mô tả

agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.

Kind: refactor. Register ID: T04.

Problem

Two private functions in fetch_stage.rs L77-L128,`` format_fetch_summary and `format_fetch_failures`, copy the public formatters in core: `api/blob_fetcher.rs` L210-L264 (`format_fetch_result_for`, `format_fetch_successes`, `format_fetch_failures`). `repair` already uses the core ones.

The copies have drifted:

core fetch_stage
failures sorted by hash yes (results come from a HashSet) no, so the order is nondeterministic
header Failed to download N blobs Failed to download N blobs:
id noun.display_id (no ... for ids of 12 chars or fewer) always chars().take(12) + ...
error text concise_fetch_error raw error

"All blobs are present locally." and the ... and N more cap are written in both copies. The cap is also open-coded in fetch_stage::format_purl_list (L77-L83) and in repair.rs.

Proposed change

  • Delete fetch_stage::format_fetch_summary and format_fetch_failures.
  • Call blob_fetcher::format_fetch_successes / format_fetch_failures with ArtifactNoun blobs, keeping the total == 0 line.

Size

1 file. About −45 / +5 lines.

Acceptance criteria

  • apply prints the same success lines.
  • Failure lines take core's form: sorted, concise, and without the trailing colon.
  • fetch_stage and apply_render tests are updated where they pinned the old form.
Ngôn ngữ chính
Rust
Star
8
Fork
2
Merge trung bình
19 giờ 12 phút
Pull request đã merge (30 ngày)
709

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

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 SocketDev/socket-patch

Tất cả issue của SocketDev/socket-patch

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.