Pull Request已成功合入, 合并人@CANN-robot
(感谢 yajie_caroline 的贡献)变更摘要
本次 PR 新增了 .gitcode/workflows/infrastructrue.yaml 工作流配置文件,用于适配 action 上线流程。该工作流定义了一个名为 PR-pipeline_infrastructrue 的 CI 流水线,涵盖并发控制、触发条件、环境变量以及分阶段执行(PreBuild → CodeCheck)和后置作业的完整编排。
主要改动
- 新增流水线并发控制策略:通过
concurrency配置限制最大并发数为 5,超出时排队等待,并启用基于mr_id事件的抢占机制。 - 定义多触发源的 PR 事件监听:支持
workflow_dispatch手动触发,以及pull_request_comment和pr_comment两种评论触发方式,评论需匹配^(?:\/)?compile*模式。 - PreBuild 阶段编排:包含
Test_image(镜像修订)和Test_PreBuild(预构建)两个作业,镜像修订使用cann/.gitcode/actions/revise-img@masteraction,运行在指定华为云容器镜像环境下。 - CodeCheck 阶段编排:依赖前阶段产出的
precommit和codecheck镜像版本号,复用cann/.gitcode/.gitcode/workflows/codecheck_action.yml@master模板进行代码检查。 - 后置作业处理:通过
post.jobs.job_post配置统一的收尾作业,复用cann/.gitcode/.gitcode/workflows/post_action.yml@master模板。


代码审查
现在完成最终排查。我已经检查了所有变更行及其周边上下文,没有再发现其他值得报告的问题。
审查总结
已审查文件:
.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 |
⛔ 需要修改


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


compile


🟠 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 中,或在使用处直接拼接表达式。


/lgtm
/approve


compile


/lgtm
/approve


/lgtm


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.


action上线适配