已合并
action上线适配 #117
yajie_caroline创建于 12 天前
action上线适配 #117
已合并
yajie_caroline创建于 12 天前
12 天前

action上线适配

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yajie_caroline 的贡献)
Yyajie_caroline
12 天前 创建了 pull request,commit 3948d002
atomgit-bot
atomgit-bot
12 天前 评论:

变更摘要

本次 PR 新增了 .gitcode/workflows/infrastructrue.yaml 工作流配置文件,用于适配 action 上线流程。该工作流定义了一个名为 PR-pipeline_infrastructrue 的 CI 流水线,涵盖并发控制、触发条件、环境变量以及分阶段执行(PreBuild → CodeCheck)和后置作业的完整编排。

主要改动

  • 新增流水线并发控制策略:通过 concurrency 配置限制最大并发数为 5,超出时排队等待,并启用基于 mr_id 事件的抢占机制。
  • 定义多触发源的 PR 事件监听:支持 workflow_dispatch 手动触发,以及 pull_request_commentpr_comment 两种评论触发方式,评论需匹配 ^(?:\/)?compile* 模式。
  • PreBuild 阶段编排:包含 Test_image(镜像修订)和 Test_PreBuild(预构建)两个作业,镜像修订使用 cann/.gitcode/actions/revise-img@master action,运行在指定华为云容器镜像环境下。
  • CodeCheck 阶段编排:依赖前阶段产出的 precommitcodecheck 镜像版本号,复用 cann/.gitcode/.gitcode/workflows/codecheck_action.yml@master 模板进行代码检查。
  • 后置作业处理:通过 post.jobs.job_post 配置统一的收尾作业,复用 cann/.gitcode/.gitcode/workflows/post_action.yml@master 模板。
likedislike
atomgit-bot
atomgit-bot
12 天前 评论:

代码审查

现在完成最终排查。我已经检查了所有变更行及其周边上下文,没有再发现其他值得报告的问题。


审查总结

已审查文件:

  • .gitcode/workflows/infrastructrue.yaml — 发现 6 个问题

按优先级统计:

优先级 数量 说明
P1 1 env.MERGE_ID 自引用导致 obs_path 缺失 merge ID
P2 3 表达式空格缺失、未声明的 job outputs、双层 .gitcode/ 路径异常
P3 2 pull_request_comment / pr_comment 重复触发、mr_id 并发键与 PR 事件不匹配

整体风险评估:中等。 该文件是全新添加的 CI 流水线配置,存在一个高概率触发的 P1 缺陷(obs_path 路径拼接错误),以及多个可能导致流水线执行失败的 P2 配置问题。建议在上线前修复 P1 和所有 P2 问题,P3 问题视 atomgit 平台实际语义确认后处理。

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

⛔ 需要修改

likedislike
CANN-robotCANN-robot成员
12 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
12 天前 评论:

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
For more, you also can visit HICANN


PR Approval Progress

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

Module Approval Details

module lgtm status approve status
.gitcode/** 宋常霞, tanghaoran7 (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

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

likedislike
yajie_caroline
12 天前 评论:

compile

likedislike
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
12 天前 评论:

流水线任务触发成功
任务链接 [8d05fe9ce5bf4a5a94d45b42ab5caec6][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
precommit ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>

[2026-08-12 17:20:57]    CI执行结束

likedislike
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-passed
atomgit-bot
atomgit-bot12 天前进行代码检视2
.gitcode/workflows/infrastructrue.yaml
已过期
@@ -0,0 +24,4 @@
24+ MERGE_ID: ${{ atomgit.event.pull_request.number }}
25+ TARGET_BRANCH: ${{ atomgit.base_ref }}
26+ SOURCE_BRANCH: ${{ atomgit.head_ref }}
27+ obs_path: "${{ vars.OBS_PATH }}/${{ env.MERGE_ID }}"
atomgit-bot
atomgit-bot12 天前评论:

🟠 High Priority

第 27 行 obs_path: "${{ vars.OBS_PATH }}/${{ env.MERGE_ID }}" 引用了同一 env 块中第 24 行定义的 MERGE_ID。在 GitHub Actions 及类似的 CI 系统中,env 块内的变量各自独立求值,不能在定义阶段相互引用。因此 ${{ env.MERGE_ID }}obs_path 求值时尚未存在,会解析为空字符串,导致 obs_path 实际值为 "<OBS_PATH>/"(缺少 merge ID 路径段)。

触发条件:每次流水线运行时,obs_path 都会缺少 MERGE_ID 部分。
失效模式:依赖 obs_path 的后续步骤(如 revise_image action、codecheck_action 等可能使用该路径上传/下载产物)会使用错误路径,导致产物丢失或路径冲突。

建议:将 obs_path 的定义移出顶层 env 块,放到 job 或 step 级别的 env 中,或在使用处直接拼接表达式。

likedislike
System
系统消息系统
9 天前 评论:

changed this line on 56d55e06 view diff detail

songchangxia成员
11 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:approved
Larry成员10 天前进行代码检视2
.gitcode/workflows/infrastructrue.yaml
已过期
@@ -0,0 +20,4 @@
20+ 
21+env:
22+ org_name: ${{ vars.ORG_NAME }}
23+ repo_name: ${{ atomgit.event.repository.name}}
Larry10 天前评论:

repository.name后面少个空格

likedislike
System
系统消息系统
10 天前 评论:

changed this line on 95bf43d6 view diff detail

Larry成员10 天前进行代码检视2
.gitcode/workflows/infrastructrue.yaml
已过期
@@ -0,0 +41,4 @@
41+ repo_name: ${{ env.repo_name }}
42+ target_branch: ${{ env.TARGET_BRANCH }}
43+ repo_url: ${{ vars.CI_PATH }}
44+ runs-on: [dedicate-hosted, x64, small]
Larry10 天前评论:

改成新的runs-on格式

likedislike
System
系统消息系统
10 天前 评论:

changed this line on 95bf43d6 view diff detail

Yyajie_caroline
10 天前 update merge request[project id: 7990062, iid: 117, commit_id: b544932eb0e355b5dcfa90966551920dad9b380a] virtual merging success
此处折叠了5条事件消息 查看更多
CANN-robotCANN-robot成员
10 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
10 天前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): ci-pipeline-passed.

likedislike
CANN-robotCANN-robot成员
10 天前 删除了label:approved
CANN-robot
CANN-robot成员
10 天前 评论:

Notice

New code changes of the pull request are detected and remove these labels approved. 😳

likedislike
yajie_caroline
10 天前 评论:

compile

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
10 天前 评论:

流水线任务触发成功
任务链接 [0f0991d1bd5b479e83092aa4dd398d4b][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
precommit ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>

[2026-08-14 16:23:10]    CI执行结束

likedislike
CANN-robotCANN-robot成员
10 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
10 天前 添加了label:ci-pipeline-passed
Larry成员10 天前进行代码检视2
.gitcode/workflows/infrastructrue.yaml
已过期
@@ -0,0 +24,4 @@
24+ MERGE_ID: ${{ atomgit.event.pull_request.number }}
25+ TARGET_BRANCH: ${{ atomgit.base_ref }}
26+ SOURCE_BRANCH: ${{ atomgit.head_ref }}
27+ obs_path: "${{ vars.OBS_PATH }}/${{ env.MERGE_ID }}"
Larry10 天前评论:

obs_path参考ops-legacy改成动态拼接的

likedislike
System
系统消息系统
9 天前 评论:

changed this line on 56d55e06 view diff detail

Yyajie_caroline
9 天前 update merge request[project id: 7990062, iid: 117, commit_id: 30a82fd131c71db1703f6bb2b7d7cdd14bc11969] virtual merging success
Yyajie_caroline
9 天前 推送  1 个提交:56d55e06-obs参数动态配置
Yyajie_caroline
9 天前 update merge request[project id: 7990062, iid: 117, commit_id: 073e5916723fd9173658812bae0e227d73ad1ed2] virtual merging success
CANN-robotCANN-robot成员
9 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
9 天前 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
9 天前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): ci-pipeline-passed.

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:cann-cla/yes
songchangxia成员
9 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:approved
tanghaoran
tanghaoran成员
9 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
9 天前 添加了label:lgtm
CANN-robot
CANN-robot成员
9 天前 评论:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
LLarry成员
8 天前 解决了最后一个问题
CANN-robotCANN-robot成员
8 天前 合入了pull request