Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#1,838 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

阅读 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: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.
主要语言
Rust
星标
8
派生
2
平均合并
19 小时 12 分钟
30 天内合并 PR
709

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。