已关闭
[pre-commit|缺陷反馈]:pre-commit检查存在可能漏查版权声明情况 #5016
景明创建于 9月7日关闭于 23 天前
9月7日 添加了label:bug-report
游震
9月7日 评论:
9月7日 评论:
/assign @gitcode_lijd


9月7日 将 gitcode_lijd 设为负责人
25 天前 修改标题为 “[pre-commit|缺陷反馈]:pre-commit检查存在可能漏查版权声明情况”,原标题为“[Bug-Report|缺陷反馈]:pre-commit检查存在可能漏查版权声明情况”
25 天前 修改标题为 “[pre-commit|缺陷反馈]:pre-commit检查存在可能漏查版权声明情况”,原标题为“[Bug-Report|缺陷反馈]:pre-commit检查存在可能漏查版权声明情况”
25 天前 删除了label:bug-report
23 天前 关闭了 issue
23 天前 添加了label:resolved
13 天前 关联了pull request:feat(pre-commit): 拦截类钩子报告统一落盘 pre-commit_reports
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
oat-check hook 存在两个导致合规检查失效的问题:
未设置 require_serial(默认 false),多核机器上 pre-commit 会把文件列表拆成多块并行调用 scripts/oat_check.sh。脚本内部 flock 串行化 + done-marker 缓存机制下,第一个抢到锁的分块(可能只含干净文件)扫完即写 marker,其余分块全部静默跳过——含版权头不合规文件的提交可整体漏过 OAT 检查(实测 6 文件混入 1 个问题文件场景,6 次中 5 次漏拦)。
命中 done-marker 时静默 exit 0,hook 显示 "Passed" 但实际未做任何扫描,易造成误判(ops-nn 仓会输出 [SKIP] 日志)。
Environment / 环境信息 (Mandatory / 必填)
A5
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
多个文件同时pre-commit
Describe the expected behavior / 预期结果 (Mandatory / 必填)
全部拦截
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
1
Special notes for this issue/备注 (Optional / 选填)
1