Serialize patch vulnerabilities through one helper; get's selectionRequired options[] are unsorted and drop description
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Start with crates/socket-patch-cli/src/commands/agent_download.rs, list.rs, get.rs, and json_envelope.rs; compare the three vulnerability serializers and inspect select_json_mode_multi_free_options_serialize_vulnerabilities in get.rs. Run that test, then update it to assert that options contain vulnerabilities sorted by id with descriptions; confirm the other JSON outputs stay unchanged except for any deliberate severity field addition.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor (with a small output fix). Register ID: T02.
Problem
The per-vulnerability JSON object {id, cves, severity, summary, description} is built by hand in three places, and the copies have drifted:
agent_download::patch_event_metadataL119-L141 includesdescriptionand sorts by id. Its comment notes that "HashMap iteration is otherwise nondeterministic and consumers diff this output".list.rsL172-L192 builds the same shape from aPatchRecord, sorted and withdescription, but it omits the top-levelseveritythatpatch_event_metadataemits.get.rsL767-L790, theselectionRequiredoptions[], iteratesp.vulnerabilities(aHashMap) unsorted and omitsdescription.
So get --json <CVE> with several free options lists each option's vulnerabilities in a different order from run to run. The test that claims to cover this, select_json_mode_multi_free_options_serialize_vulnerabilities (get.rs L4898), only asserts Err(1), so the drift went unnoticed.
Proposed change
- Add one
#[derive(Serialize)]vulnerability view, or a singlevuln_json(id, &v)helper, injson_envelope.rs. It returns the list sorted by id. - Use it from all three sites.
- Decide in the PR whether
listgains the top-levelseverity, and say so in the PR description.
Size
3 to 4 files. About −40 / +30 lines.
Acceptance criteria
scan/geteventdetailsandlist --jsonare byte-identical before and after, apart from any field the PR deliberately adds.get'soptions[].vulnerabilitiesis sorted by id and carriesdescription.- The fake test above captures the envelope and asserts the sorted
options[].vulnerabilities.
- Ngôn ngữ chính
- Rust
- Star
- 9
- Fork
- 2
- Merge trung bình
- 20 giờ 47 phút
- Pull request đã merge (30 ngày)
- 681
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 SocketDev/socket-patch
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SocketDev/socket-patch#1860 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SocketDev/socket-patch#1838 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
arch-audit refactor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
SocketDev/socket-patch#1993 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
arch-audit refactor
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
SocketDev/socket-patch#1992 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
SocketDev/socket-patch#1987 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-patch
Issue tương tự
-
Perl - Readme DriftCó thể đã có người làm @Omnideth đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CommunityToolkit/Aspire#2375 ·
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 78/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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/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 72/100
Maintainer thường phản hồi trong vòng 1 ngày