Serialize patch vulnerabilities through one helper; get's selectionRequired options[] are unsorted and drop description
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
[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.
- 主要言語
- Rust
- スター
- 9
- フォーク
- 2
- 平均マージ
- 20時間 47分
- マージ済み PR(30日)
- 681
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SocketDev/socket-patch#1860 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SocketDev/socket-patch#1838 ·
メンテナーはふだん 1 日以内に返信
-
arch-audit refactor
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
SocketDev/socket-patch#1993 ·
メンテナーはふだん 1 日以内に返信
-
arch-audit refactor
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
SocketDev/socket-patch#1992 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
SocketDev/socket-patch#1987 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
Perl - Readme Drift対応中かも @Omnideth が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CommunityToolkit/Aspire#2375 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信