Use core's blob fetch-summary formatter in apply's fetch_stage instead of a drifted copy
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
閱讀 crates/socket-patch-cli/src/commands/fetch_stage.rs,並參照 crates/socket-patch-core/src/api/blob_fetcher.rs 中的 core 格式化器;repair 被列為現有呼叫端。更新 fetch stage,讓它使用 core 的成功與失敗格式化器,同時保留其 total == 0 行,接著更新指定的 fetch_stage 和 apply_render 測試。完成標準是:成功輸出維持不變,失敗輸出符合 core 排序後的簡潔格式,且結尾沒有冒號。
由索引模型根據 Issue 內容生成。
描述
[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_summaryandformat_fetch_failures. - Call
blob_fetcher::format_fetch_successes/format_fetch_failureswithArtifactNounblobs, keeping thetotal == 0line.
Size
1 file. About −45 / +5 lines.
Acceptance criteria
applyprints the same success lines.- Failure lines take core's form: sorted, concise, and without the trailing colon.
fetch_stageandapply_rendertests are updated where they pinned the old form.
- 主要語言
- Rust
- 星號
- 8
- 分支
- 2
- 平均合併
- 19 小時 12 分鐘
- 30 天內合併 PR
- 709
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 83/100
SocketDev/socket-patch#1860 ·
維護者通常 1 天內回覆
-
Share one scoped env-var test guard: EnvGuard is copy-pasted 11 times across core unit and integration tests可能已有人在做 @mikolalysenko 今天認領。 未關閉agent:claimed agent:triaged arch-audit priority:p3 refactor
難度 4/5 3-5 天 新手友好度 55/100
SocketDev/socket-patch#1889 · 2 則留言 ·
維護者通常 1 天內回覆
-
Memoize env-keyed subprocess probes through one helper: composer, python and ruby each define the same env key and drifted on when an answer is kept可能已有人在做 @mikolalysenko 今天認領。 未關閉agent:claimed agent:triaged arch-audit priority:p1 refactor
難度 4/5 1-2 天 新手友好度 25/100
SocketDev/socket-patch#1888 · 3 則留言 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 4/5 1-2 天 新手友好度 55/100
SocketDev/socket-patch#1887 · 1 則留言 ·
維護者通常 1 天內回覆
-
agent:needs-human agent:triaged arch-audit priority:p3 refactor
難度 4/5 3-5 天 新手友好度 38/100
SocketDev/socket-patch#1881 ·
維護者通常 1 天內回覆
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
Y-ASLant/ElegantClipboard#178 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
linxiv-dev/linXiv#384 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug drawings ui
難度 2/5 1-3 小時 新手友好度 82/100
userFRM/egui-charts#1595 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
smoltcp-rs/smoltcp#1235 ·
維護者通常 1 天內回覆
-
scope:core type:security
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆