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
-
ai_p2 bug comp-datalake
难度 2/5 1-3 小时 新手友好度 85/100
ClickHouse/ClickHouse#128306 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
area: ui enhancement good first issue
难度 2/5 1-3 小时 新手友好度 70/100
JavenKazebee/capture-room#166 ·
维护者通常 1 天内回复