已开启
fix(op-lint): Stop false-blocking read-only state-file verification commands #587
lizixuan创建于 2 天前
fix(op-lint): Stop false-blocking read-only state-file verification commands #587
已开启
合并受阻
2 天前 关联了issue:[Bug-Report|缺陷反馈]: 【断裂点】pypto-op-lint isStateWriteCommand 对 .orchestrator_state.json 只读命令误拦截(git/sha256sum/python json.load 未入白名单
2 天前 关联了issue:[Bug-Report|缺陷反馈]: 【断裂点】pypto-op-lint isStateWriteCommand 对 .orchestrator_state.json 只读命令误拦截(git/sha256sum/python json.load 未入白名单
2 天前 添加了label:cann-cla/yes
CANN-robot
2 天前 评论:
2 天前 评论:
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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/pypto-gym | ❌ (0/2)(You can also ask: xinweiliu, congqiannan, 周若愚, wangzheng97, wangbing110) | ❌ (0/1)(You can also ask: xinweiliu, gaoxingwang, 冯思远, 林嘉树, 尹杰) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
lizixuan1020, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Closes #115
问题
isStateWriteCommand把合法只读核验命令误判为写入,在执行前 throw(报错文案"禁止写入"与实际只读行为矛盾):git diff/status/log、sha256sum、python json.load、for ... stat全部不覆盖 → 纯只读组合被拦。;切分复合命令会把python3 -c "import json; json.load(...)"(Python 也用;作语句分隔符)切开,状态文件那段st=json.load(...)段首不在白名单 → 误判。修复(pypto-op-lint.ts)
python3 -c/python - <<EOF不按;切段,只在整个命令层面检测显式写信号(open(...w/a/x)、write_text、json.dump 等);只读 json.load/open(默认 r) 放行。git(-C dir) diff/status/log/show/rev-parse、sha256sum/sha1sum/md5sum/cksum、echo、for循环。>/>>指向状态文件)仍是明确写信号,保持拦截。验证
新增 5 个测试(git -C diff / sha256sum / python3 json.load / for-stat / heredoc 读 = 放行;echo 重定向 / python json.dump = 拦截);opencode hooks 59 个测试全部通过。