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

fix(ci): Rust clippy 恒红——proxy.rs:155 ErrorKind::Other 触发 -D warnings,阻塞 main 与全部 14 个 PR

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

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, rust
领域
ci-cd

调研方向

从 rust/src/proxy.rs:155-158 开始,这里 issue 指出了 clippy 警告;然后检查 .github/workflows/test.yml:84 中的 Lint 命令。运行 cd rust && cargo clippy --all-targets -- -D warnings 和 cd rust && cargo test;两者都通过且 Rust CI job 变为绿色即表示完成。

由索引模型根据 Issue 内容生成。

描述

场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无

基线 HEAD = d35ed884。

Summary

  • rust/src/proxy.rs:155-158:CONNECT 出站代理代码用 std::io::Error::new(std::io::ErrorKind::Other, e),被 clippy 判 clippy::io_other_error(style 组,warn 级):

    parse_connect_response(&head).map_err(|e| std::io::Error::new(
        std::io::ErrorKind::Other,
        e,
    ))?;
    
  • .github/workflows/test.yml:84 的 Lint 步是 cargo clippy --all-targets -- -D warnings,warn 升 error → 退出码 101 → Rust job 必红(同 job 的 cargo test 步 :81 本身是绿的,红只出在 Lint)。

  • 引入点 = 13d917a(2026-10-01 13:49Z,feat(rust): 客户端出站支持 HTTP CONNECT 代理(0.6.0);git blame -L 155,158 rust/src/proxy.rs 四行全部指向该提交)。

  • 时间线(main 上的 test workflow):最后一次绿 = 0846ed19(2026-09-30T11:41Z);此后逐次全红 = 020dec36(2026-10-04T14:22Z,首个红灯)→ cb74c8b4(10-07T17:59Z)→ 9711b1a6(10-08T11:17Z)→ eab5b1a6(10-08T11:50Z)→ d35ed884(10-08T11:53Z,run 37773047527)。首红滞后到 10-04 只是因为 09-30 与 10-04 之间 main 上没有触发 test workflow(13d917a 已领先上一个绿点 29 个提交、且已是 020dec36 的祖先),不是当时绿过。各次失败点逐字相同:--> src/proxy.rs:155:47 + Process completed with exit code 101。

  • 不是工具链 1.99 新增 lint:本机 rustc/clippy 1.98.1 复现同一条 —— 在仓内 cd rust && cargo clippy --all-targets -- -D warnings 得到 error: this can be std::io::Error::other(_)``(clippy 1.98.0 文档链接)→ 101。CI 侧 toolchain 为 rustc 1.99.0(dtolnay/rust-toolchain@stable 日志:`stable-x86_64-unknown-linux-gnu unchanged - rustc 1.99.0 (b940084d7 2026-09-28)`)。即新代码踩了既存 lint,1.99 只是同为命中版本。

  • 影响面不止 main:全部 14 个 open PR(dependabot #5-#19、#25 等,含只改 typescript/ lockfile 的)都因同一个 Rust job 红而卡住合入,例:run 37773298226(PR #18,仅 /typescript undici 升级)失败日志同样是 src/proxy.rs:155:47。

  • 命中处唯一:grep -rn 'ErrorKind::Other' rust/src → 只有 rust/src/proxy.rs:156。

影响

main 与所有 PR 的 CI 门禁确定性恒红(非 flaky):dependabot 依赖升级全部积压,人工改动的 PR 也无法区分「自己的问题」与「既存红」,等于交付管线被一行 lint 卡死。

建议

改为 std::io::Error::other:

parse_connect_response(&head).map_err(std::io::Error::other)?;

验收条件(可执行、可断言):

  1. cd rust && cargo clippy --all-targets -- -D warnings 退出码 0 —— 已在临时副本(/tmp/tunely-verify,仅改此行)用本机 clippy 1.98.1 实跑:Finished dev profile,无任何告警;
  2. cd rust && cargo test 全绿 —— 同一临时副本实跑通过:lib 单测 86、embed_handler 6、integration 10、proxy_integration 4(含 CONNECT 代理路径)、wire_conformance 8、doc-test 1,合计 115 passed / 0 failed;
  3. 改动推上 main 后,test workflow 的 Rust job 转绿(Lint 步通过)。

边界

  • 本单只修这一处 lint 命中,不处理「dtolnay/rust-toolchain@stable 浮动 → 未来新 lint 再次打红 CI」的根因(建议另单:加 rust-toolchain.toml 固定版本,或把 -D warnings 收敛为定向 lint)。历史同类:143ddb71「折叠嵌套 if let——修 CI clippy --all-target」也是被浮动 stable 打到。
  • 不处理 Python job 的非致命噪声:##[error] RuntimeError: Event loop is closed(aiosqlite _connection_worker_thread 在事件循环关闭后回调,pytest PytestUnhandledThreadExceptionWarning;该 job 结论仍是 success,run 37663404002)。与本单无因果关系,如需要另行提报。
主要语言
Python
星标
0
派生
0
平均合并
6 天 2 小时
30 天内合并 PR
2

环境准备

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

从这里开始

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

jeffkit/tunely 的其他 Issue

查看 jeffkit/tunely 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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