Pull Request has been successfully merged by ascend-robot.
(Thank you for wujinyuan1's contribution.)变更摘要
本次变更集中在 CI 流水线配置 .gitcode/workflows/PR-pipeline_torchair.yml,目的是修复 pre-commit 检查任务名称并解决例外备案指标的统计问题。主要做法是在文件变更检测阶段新增 touch_gitcode 标记输出:当改动文件列表命中 .gitcode/ 目录时置为 true,并以此控制后续编译与测试任务的执行条件;同时将代码检查任务的标识由下划线形式调整为连字符形式。
主要改动
- pre-commit 任务名称修正: 将
CodeCheck阶段下的任务名与name由CodeCheck_pre_commit统一改为CodeCheck_pre-commit,修正任务标识的命名。 - 新增
touch_gitcode输出: 在Detect_file_changes阶段outputs中新增touch_gitcode: ${{ steps.set-skip.outputs.touch_gitcode }},把该标记向上游 job 暴露。 .gitcode目录改动识别: 在文件变更处理步骤中通过grep -q '^\.gitcode/' modify_files.txt判断改动是否包含.gitcode/下的文件,并向$ATOMGIT_OUTPUT写入touch_gitcode=true/false。- 编译任务跳过条件:
Build_x86与Build_arm的if条件在原有need_build_ut == 'yes'基础上追加touch_gitcode != 'true',当仅改动.gitcode目录时不再触发编译。 - 系统测试跳过条件:
ST任务的if条件同样追加touch_gitcode != 'true',与编译任务保持一致,避免纯流水线配置改动触发系统测试。


代码审查
审查结论
已审查文件
.gitcode/workflows/PR-pipeline_torchair.yml:发现 2 个问题(见下)
问题清单(按优先级)
- P2 × 2,无 P0/P1/P3。
总体风险判断
本次改动本身不涉及运行时逻辑与安全边界,主要是 CI 门禁策略调整:新增的 touch_gitcode 输出与 CodeCheck_pre-commit 改名在 YAML 结构、key 拼写、output 引用(steps.set-skip.outputs.touch_gitcode ↔ id: set-skip)、表达式写法上与既有 need_build_ut 用法一致,未发现语法/引用类错误。主要风险集中在跳过策略的粒度上:条件用“存在 .gitcode/ 改动”而非“改动仅为 .gitcode/”,会让同时改动源码的 PR 绕过 Build/ST,且会让改动 build_job.yml/st_job.yml 的 PR 恰好跳过唯一会执行它的作业。建议按 above 两条修正后再合入,否则 CI 质量门禁存在可用性缺口。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 2 |
💬 仅评论


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


当前PR是否有AI参与:
[x] 否
PR功能描述 / 为什么需要这个合入**:
修复pre-commit任务名称,解决例外备案指标问题
https://gitcode.com/Ascend/torchair/issues/936
该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #
https://gitcode.com/Ascend/torchair/issues/936
希望检视人员了解: