Prhub

#25322 Deprecate /rerun-stage; scrub CUDA target_stage infra

原始 PR 作者 hnyls2002 合并时间 2026-05-15 17:18 文件变更 10 提交数 7 评论 4 代码增减 +95 / -604

执行摘要

废弃 /rerun-stage 并清理 target_stage 基础设施

根据 PR 描述,/rerun-stage 命令的粒度太粗,不适合映射到单个功能。过去六个月的利用率数据显示,/rerun-stage 仅被使用 ~111 次,主要是两位贡献者,而更精确的 /rerun-test(268 次)和 /rerun-failed-ci(320 次)使用更频繁。因此,该命令被废弃,以鼓励使用更精确的重新运行测试的方式。

建议阅读该 PR 以了解如何基于使用数据做出废弃决策,以及如何清理跨多个工作流的死代码。特别值得关注的是 _pr-test-check-changes.yml 中移除 API 驱动的变化检测步骤,这显著简化了工作流。

讨论亮点

该 PR 没有收到任何人类审查评论。作者在问题中触发了 /rerun-stage 命令,并收到了自动废弃回复,表明该命令已废弃。

实现拆解

  1. 废弃命令处理器scripts/ci/utils/slash_command_handler.py):删除了整个 handle_rerun_stage() 函数(约 213 行),该函数处理阶段名称验证、权限检查和 workflow_dispatch 触发。现在 /rerun-stage 分支会发送一条废弃注释,并附上 -1 反应,指引用户使用 /rerun-test/rerun-failed-cirun-ci/run-ci-extra 标签。AMD 用户会被引导使用 Actions UI 下拉菜单。
  2. 清理 CUDA 工作流链pr-test.ymlpr-test-multimodal-gen.ymlpr-test-extra.ymlpr-test-jit-kernel.ymlpr-test-sgl-kernel.yml_pr-test-check-changes.yml_pr-test-stage.yml_pr-test-sgl-kernel-build.yml_pr-awareness-comment.yml):移除了所有 target_stagepr_head_shainclude_wheel_build 工作流输入及相关条件逻辑。具体包括:
    • 删除 workflow_dispatch 输入声明(target_stagepr_head_shainclude_wheel_build)及其默认值。
    • 删除动态 run-name 格式化(用于标识 /rerun-stage 的运行)。
    • 简化并发组:不再包含 pr_head_shatarget_stage
    • _pr-test-check-changes.yml 中,删除了基于 API 的变化检测步骤(filter-api)和 validate-target-stage 步骤,输出 sgl_kernel_raw 被移除,target_stage 覆盖逻辑被清除。
    • pr-test-multimodal-gen.yml 中,所有 inputs.target_stage == '...' 的条件分支被移除,作业触发仅依赖于 multimodal_gen 标志。
    • 在所有工作流中,将 ref: ${{ inputs.pr_head_sha || inputs.git_ref || github.sha }} 简化为 ref: ${{ inputs.git_ref || github.sha }}
    • pr-test-extra.ymlpr-test-jit-kernel.yml 中进行了类似的简化。
  3. 保持 AMD 工作流不变pr-test-amd.ymlpr-test-amd-rocm720.ymlpr-test-musa.yml):这些工作流拥有独立的 target_stage 输入,没有被斜杠命令使用,因此保持不变,以保留 AMD 团队依赖的 UI 下拉菜单功能。
文件 模块 状态 重要度
scripts/ci/utils/slash_command_handler.py CI 工具 modified 6.83
.github/workflows/_pr-test-check-changes.yml 工作流配置 modified 6.2
.github/workflows/pr-test.yml 工作流配置 modified 5.36
.github/workflows/pr-test-multimodal-gen.yml 工作流配置 modified 5.05
.github/workflows/pr-test-extra.yml 工作流配置 modified 4.17
.github/workflows/pr-test-jit-kernel.yml 工作流配置 modified 4.14
.github/workflows/_pr-test-stage.yml 工作流配置 modified 4.03
.github/workflows/pr-test-sgl-kernel.yml 工作流配置 modified 3.4
.github/workflows/_pr-test-sgl-kernel-build.yml 工作流配置 modified 3.19
.github/workflows/_pr-awareness-comment.yml 工作流配置 modified 2.24

关键符号

handle_rerun_stage

分析完成后,这里会展示 LLM 生成的相对完整源码片段和详细注释。

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

主要风险是潜在的回归,即某些用户或自动化脚本可能仍依赖 /rerun-stage 命令,而现在该命令只会触发废弃消息。如果任何外部系统或内部工具直接调用 handle_rerun_stage 函数,它们将失效。此外,CUDA 工作流中的 target_stage 相关逻辑被移除,如果未来需要恢复此功能,将需要重新实现。不过,该 PR 保留了 /rerun-stage 的触发事件,以便废弃消息能够正常工作,因此不会出现静默失败的情况。AMD 工作流不受影响,且已通过验证。

用户影响:任何使用 /rerun-stage 命令的开发者现在都会看到废弃消息,需要改用更精确的命令。系统影响:CUDA CI 工作流变得更加简单,减少了维护负担和条件逻辑错误的风险。团队影响:AMD 团队的工作流保持不变,没有影响。整体影响程度为中低,因为 /rerun-stage 的使用率较低。

废弃命令可能影响自动化 AMD 路径保持不变 无新测试覆盖

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论