已合并
新增workflow 的流水线配置指导 #96
新增workflow 的流水线配置指导 #96
已合并
tanghaoran创建于 7月6日
tanghaoran
tanghaoran成员
7月6日

变更描述 / Description

改动类型 / Change Type

  • Closes #
  • References #

测试信息 / Testing

检查清单 / Checklist

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 tanghaoran 的贡献)
atomgit-bot
atomgit-bot
7月6日 评论:

变更摘要

此 PR 旨在为项目添加 CI(持续集成)配置,共涉及 2 个文件、新增 2371 行代码,主要用于引入自动化构建与检查流水线。

主要改动

  • 新增 CI 配置文件:添加 CI 流水线定义,用于自动化执行构建、测试等任务(因未提供具体文件差异,无法列出精确文件名和配置项)
  • 新增 CI 辅助或脚本文件:补充与 CI 流程配套的脚本或配置(共计 2 个文件,均为全新添加,无删除行)
likedislike
atomgit-bot
atomgit-bot
7月6日 评论:

代码审查

审查总结

文件 结果
docs/ci/CI流水线配置指导.md 发现 3 个问题(1 个 P1,2 个 P2)
docs/ci/GitCode-Action通用配置指导.md 发现 1 个问题(1 个 P2)

总计:4 个发现(P1 ×1,P2 ×3),无 P0 阻塞性问题。

整体风险评估:中等。最严重的问题是编译命令模板中的 set +e + exit 0 模式会静默忽略编译失败(P1),若用户直接按文档模板配置 CI,可能导致有编译错误的代码通过流水线检查。另外两处 P2 问题(OBS 下载凭证不一致、权限字段名不匹配)也会在用户照搬配置时造成实际运行故障。建议在文档合入前修复上述问题,尤其是 P1 的编译命令模板。

类型 数量
🔴 阻塞 1
🟡 建议 1

⛔ 需要修改

likedislike
CANN-robotCANN-robot成员
7月6日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月6日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/infrastructure 宋常霞, yangbinhua (2/2) 宋常霞 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

tanghaoran7, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
atomgit-bot
atomgit-bot7月6日进行代码检视2
docs/ci/GitCode-Action通用配置指导.md
已过期
@@ -0,0 +1256,4 @@
1256+ 
1257+permissions:
1258+ contents: read
1259+ pull-requests: write
atomgit-bot
atomgit-bot7月6日评论:

🟡 Medium Priority

变更行:PR 检查模板(第 1257–1259 行)中使用了 contents: readpull-requests: write 两个权限字段。

但同一文档第 15.2 节的权限项表格(第 1051–1058 行)列出的合法权限域为:projectprissuenoterepositoryhook。模板中使用的 contentspull-requests 均不在该表格中。

触发条件:用户直接复制该模板的 permissions 配置到自己的 workflow 中。

失败模式:平台可能无法识别 contentspull-requests 权限名,导致权限声明被忽略或 workflow 运行时报错/权限不足。正确的权限名按表格应为 repository: readpr: write

建议:将 contents: read 改为 repository: read,将 pull-requests: write 改为 pr: write,与第 15.2 节的权限项表格保持一致。

改动建议
1284
+ permissions:
1285
+ repository: read
1284
- pull-requests: write
1286
+ pr: write
应用建议
likedislike
System
系统消息系统
7月13日 评论:

changed this line on 95af481d view diff detail

atomgit-bot
atomgit-bot7月6日进行代码检视2
docs/ci/CI流水线配置指导.md
已过期
@@ -0,0 +440,4 @@
440+ BuildAccelerate bash build.sh --pkg --cann_3rd_lib_path=/home/jenkins/opensource -j16
441+ exit 0
442+ ;;
443+esac
atomgit-bot
atomgit-bot7月6日评论:

🟠 High Priority

变更行:第 433–443 行的编译命令 Bash 模板。

问题:模板使用 set +e 禁用了错误退出,随后在每个 case 分支中无条件执行 exit 0。这意味着无论 BuildAccelerate bash build.sh ... 是否编译成功,该步骤始终返回成功(退出码 0)。

触发条件:当编译实际失败(例如 build.shBuildAccelerate 返回非零退出码)时。

失败模式:CI 流水线的编译步骤始终显示"通过",实际编译错误被完全掩盖,下游步骤(如包校验 verify-package)可能在缺少产物的状态下运行,或直接跳过看似成功的编译阶段,导致有问题的代码被合入。

建议:移除 set +eexit 0,让编译命令的退出码自然传播。若需要容错,显式捕获退出码后再决定是否失败。

likedislike
System
系统消息系统
7月13日 评论:

changed this line on 95af481d view diff detail

tanghaorantanghaoran成员
7月7日 强制推送  1 个提交:af3e01d4-add CI
tanghaorantanghaoran成员
7月7日 解决了最后一个问题
tanghaorantanghaoran成员
7月7日 强制推送  1 个提交:c05cac8e-add CI
tanghaorantanghaoran成员
7月13日 强制推送  1 个提交:95af481d-add CI
CANN-robotCANN-robot成员
7月13日 修改标题为 “新增workflow 的流水线配置指导”,原标题为“add CI”
songchangxia成员
7月13日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
7月13日 添加了label:approved
yangbinhua
yangbinhua成员
7月13日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
7月13日 添加了label:lgtm
CANN-robotCANN-robot成员
7月13日 合入了pull request