bug: branch_name 去空白后通过校验,但下游仍用原始值创建 PR

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
ci-cd

调研方向

验证器 .github/scripts/validate_implementation_output.py 仅针对 target_branch 比较对 branch_name 执行 strip(第 38-47 行),并在第 58 行返回原始元数据。结合 .github/scripts/commit_implementation_branch.py:192(会执行 strip)和 .github/scripts/finalize_implementation_pr.py:79(不会执行 strip)一起阅读,然后统一规范化一次,使三者一致。向 test_validate_implementation_output.py 添加一个带空白填充的 branch_name 用例;完成意味着返回的元数据带有 strip 后的名称,并且新测试通过。

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

描述

area:tests area:workflow bug repro:high triaged

问题位置

.github/scripts/validate_implementation_output.py:38

触发条件

实现代理在 standalone 实现分支模式下,把 pr-metadata.json 的 branch_name 写成带前导或尾随空白的字符串,例如 " spec/implement-issue-18 "。

实际影响

校验器先 strip 再与 target_branch 比较,因此放行;commit_implementation_branch.py 也会 strip 后成功推送分支,但 finalize_implementation_pr.py 使用未清理的 branch_name 查询或创建 PR,找不到已推送分支,最终无法生成或更新 implementation PR。

核实依据

validate_implementation_output.py 第 38-47 行只把 strip 后的值用于比较,第 58 行返回原始 metadata,main 没有回写;commit_implementation_branch.py 第 192 行对 branch 做 strip,而 finalize_implementation_pr.py 第 79 行直接使用 metadata 中的 branch_name 调用 open_pr_for_branch 或 create_pr。现有 test_validate_implementation_output.py 只覆盖无空白 branch_name。

扫描提交:e777f60106e401b086925270af317a4b36722be0;扫描日期:2026-11-24(北京时间);轮巡分片:54/90。

主要语言
Python
星标
171
派生
24
平均合并
3 小时 13 分钟
30 天内合并 PR
13

环境准备

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

从这里开始

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

Terry-Mao/AICodingFlow 的其他 Issue

查看 Terry-Mao/AICodingFlow 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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