已合并
[fix] Fix glob pattern to match files in subdirectories #5670
WSs_321创建于 21 天前
[fix] Fix glob pattern to match files in subdirectories #5670
已合并
WSs_321创建于 21 天前
WSs_321成员
21 天前

【合入来源】

如有社区issue,请关联issue链接
请勿携带内部流程信息(需求链接、问题单、内部issue等)

关联issue:https://gitcode.com/Ascend/op-plugin/issues/374

【修改方案】

.gitcode/workflows/PR-pipeline_op-plugin.ymlDetect_file_changespaths-changes-filter non-doc 排除规则由 !**.md!**.rst 等 glob 模式改为 !**/*.md!**/*.rst 等,使其能匹配子目录下的文档文件,纯文档变更(含子目录)可正确跳过 Build 阶段。

【资料变更】

不涉及

【接口变更】

不涉及

【功能验证】

构造仅含子目录下 .md/.rst 文档变更的 PR,评论 /compile 触发流水线,验证 need_build=no、Build 阶段被跳过;非文档变更时 need_build=yes、Build 正常执行。

【CheckList】

PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 WSs_321 的贡献)
WWSs_321成员
21 天前 创建了 pull request,commit eab709c8
atomgit-bot
atomgit-bot
21 天前 评论:

变更摘要

此 PR 在 .gitcode/workflows/PR-pipeline_op-plugin.yml 流水线配置中新增了一个 SCA(软件成分分析)安全扫描任务,用于在 PR 阶段对代码进行安全扫描。同时将 PR 评论触发条件从子串匹配 compile 修正为正则精确匹配 ^compile$

主要改动

  • 新增 SCA 安全扫描任务:在 CodeCheck 阶段增加了名为 SCA 的 Job,运行在 dedicate-hostedx64, 2xlarge 节点上,使用指定的 PyTorch 容器镜像,并在检出合并提交后调用 sca-pr-scan 动作执行安全扫描。
  • 扫描配置参数sca-pr-scan 步骤通过 secrets 传入 SCAN_ACCESS_KEYSCAN_SECRET_KEY,并传递 pr-idrepository-name 以及 project-name: FrameworkPTAdapter 等参数。
  • PR 评论触发条件修正pull_request_commentcomments 过滤条件从 [ 'compile' ] 改为 [ '^compile$' ],将原先的子串匹配改为正则精确匹配,避免误触发。
likedislike
atomgit-bot
atomgit-bot
21 天前 评论:

代码审查

我已经完整阅读了变更文件 .gitcode/workflows/PR-pipeline_op-plugin.yml,并对两处变更进行了逐行审查。以下是我的分析结论:


变更分析

变更 1:第 15 行 — comments: [ 'compile' ]comments: [ '^compile$' ]

将 PR 评论触发器的匹配模式从字面字符串 compile 改为正则表达式 ^compile$。正则 ^compile$ 锚定了开头和结尾,语义上等同于精确匹配字符串 "compile",功能行为不变。这是一次使匹配规则更显式的改进,无问题

变更 2:第 41–59 行 — 新增 SCA 作业

CodeCheck 阶段新增了一个 SCA(软件成分分析)安全扫描作业。逐项检查如下:

检查维度 结论
YAML 键名拼写 所有键名(runs-oncontainerimagestepsuseswithref 等)拼写正确,与同文件中已有作业一致
缩进/语法 缩进层级正确,与同级的 CodeCheck_pre_commit 作业对齐
密钥传递 scan-access-keyscan-secret-key 通过 ${{ secrets.XXX }} 从 CI 密钥管理中读取,无硬编码密钥
checkout ref ref: refs/merge-requests/${{ env.pr_id }}/merge 与文件中其他 checkout 步骤一致,pr_id 来自第 19 行的 env 定义
变量引用 pr-id: ${{ atomgit.event.pull_request.number }} 与第 19 行 env.pr_id 的定义来源一致;repository-name: ${{ atomgit.repository }} 与第 105 行已有用法一致
作业条件 该作业无 if 条件,与同阶段其他作业(CodeCheck_pre_commitDetect_file_changes)一致,在 ^compile$ 评论触发时均会执行

审查结论

该 diff 中没有发现任何正确性、安全性、可靠性或回归性问题。 两处变更均为合理的改进:一处使触发匹配规则更显式,另一处新增了软件成分分析安全扫描能力,实现方式与现有代码模式一致。


汇总

  • P0: 0
  • P1: 0
  • P2: 0
  • P3: 0

已审查文件.gitcode/workflows/PR-pipeline_op-plugin.yml — 无问题。

整体风险判断:此变更风险极低,可以安全合入。

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

💬 仅评论

likedislike
ascend-robotascend-robot成员
21 天前 添加了label:stat/needs-squash
此处折叠了99条消息 查看更多
ascend-robot
ascend-robot成员
15 天前 评论:

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
WWSs_321成员
15 天前 解决了最后一个问题
ascend-robotascend-robot成员
15 天前 关闭了关联的issue
ascend-robotascend-robot成员
15 天前 合入了pull request
ascend-robot
ascend-robot成员
15 天前 评论:

Pull Request 已合并或已关闭。

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

likedislike