Skip to content

fix(ci): correct gitlink detection in submodule gate and pr governance - #9

Merged
cloudQuant merged 1 commit into
devfrom
fix/submodule-gate-detection
Aug 23, 2026
Merged

fix(ci): correct gitlink detection in submodule gate and pr governance#9
cloudQuant merged 1 commit into
devfrom
fix/submodule-gate-detection

Conversation

@cloudQuant

Copy link
Copy Markdown
Owner

演练发现的真实缺陷(M4 观察期产出)

D5 演练(PR #8,真实 SHA-bump)暴露:Submodule Gate 报告 not-applicable,
而该 PR 明确包含 bt_api_ctp 的 gitlink 变更。

根因(本地已复现)

git diff --raw 头部格式为 :oldmode newmode oldsha newsha status

  • submodule-tests.yml: awk '$4 ~ /160000/' 测试的是新 SHA 字段而非 mode → count 恒为 0
  • pr-governance.yml: cols[2] == "160000" 检查的是旧 SHA;old/new 提取索引错位(取到 status)

修复

按真实字段位置匹配 cols[1] == "160000" / awk '$2 == "160000"',SHA 取 cols[2]/cols[3]。

验证

  • 本地: git diff --raw f338199b..24ad0762 | awk '$2 == "160000"' | wc -l → 1(修复前为 0)
  • 合入后将重建 D5 演练验证 validated 路径

risk:r1 — 仅 CI 检测逻辑;area:ci。

Drill D5 exposed that a real SHA-bump PR reported not-applicable:
git diff --raw headers are ':oldmode newmode oldsha newsha status', so
awk $4 tested the new SHA instead of the mode, and the Python parser
checked cols[2] (old SHA) against '160000' while extracting cols[3]/cols[4]
(status letter). Match mode at cols[1] and take SHAs from cols[2]/cols[3].
@cloudQuant
cloudQuant merged commit fbea451 into dev Aug 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant