`darnit validate` crashes on openssf-baseline.toml summarising levels
维护者通常 1 天内回复
评估
调研方向
阅读 packages/darnit/src/darnit/cli.py,重点查看 cmd_validate 和第 416 行附近的级别分组;并与 darnit audit 从标签读取级别的方式进行比较。按照 issue 中的步骤,使用随附的 openssf-baseline.toml 重现问题。完成标准是 darnit validate 以退出码 0 退出,并打印级别存储在标签中的 controls 的分级明细。
由索引模型根据 Issue 内容生成。
描述
Description
darnit validate on the bundled openssf-baseline.toml reports the framework as valid, then raises a TypeError and exits non-zero. The level breakdown in cmd_validate (packages/darnit/src/darnit/cli.py) groups controls by ctrl.level. The baseline TOML now keeps the level in tags, so ctrl.level is None for those controls, and sorted() fails when the keys mix int and None. darnit audit reads the level from tags and reports it correctly.
Steps to Reproduce
pip install "darnit-mcp==0.1.1" "darnit-core==0.1.1" "darnit-baseline==0.1.1"darnit validate "$(python -c 'import importlib.resources as r; print(r.files("darnit_baseline") / "openssf-baseline.toml")')"
Expected Behavior
Exit 0 with the per-level breakdown.
Actual Behavior
INFO: Framework 'openssf-baseline' is valid
INFO: Controls: 66
INFO: Adapters: 0
Traceback (most recent call last):
File "/opt/darnit/lib/python3.13/site-packages/darnit/cli.py", line 416, in cmd_validate
logger.info(f" By level: {', '.join(f'L{k}={v}' for k, v in sorted(by_level.items()))}")
TypeError: '<' not supported between instances of 'int' and 'NoneType'
Environment
- darnit version: 0.1.1
- Python version: 3.13
- OS: Debian trixie (Docker)
Additional Context
We hit this running darnit in Alpha-Omega's scrutineer, which bundles it in its runner image for an OpenSSF Baseline compliance scan, with darnit validate as a build-time smoke test. The same code is still on main at 24a4fed. Reading the level as ctrl.level or ctrl.tags.get("level") there would match what the audit path does.
- 主要语言
- Python
- 星标
- 22
- 派生
- 27
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 39
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
darnitdevorg/darnit 的其他 Issue
-
needs triage
难度 2/5 1-3 小时 新手友好度 83/100
darnitdevorg/darnit#587 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 65/100
darnitdevorg/darnit#585 ·
维护者通常 1 天内回复
-
quality
难度 2/5 1-3 小时 新手友好度 66/100
darnitdevorg/darnit#523 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 76/100
darnitdevorg/darnit#516 ·
维护者通常 1 天内回复
-
good first issue module-core
难度 1/5 1-3 小时 新手友好度 88/100
darnitdevorg/darnit#506 ·
维护者通常 1 天内回复
查看 darnitdevorg/darnit 的全部 Issue
相似的 Issue
-
area:core-platform effort:S priority:P3 status:in-review type:test
难度 2/5 1 小时以内 新手友好度 80/100
randomparity/kdive#3246 · 1 条评论 ·
维护者通常 1 天内回复
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton mass未关闭bug
难度 1/5 1 小时以内 新手友好度 85/100
nf-core/metaboigniter#130 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
common-workflow-language/cwl-utils#477 ·
维护者通常 1 天内回复
-
Add dependabot未关闭feat
难度 2/5 1 小时以内 新手友好度 72/100
open-nudge/opentemplate#204 ·
维护者通常 1 天内回复
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limit可能已有人在做 @VascoSch92 今天认领。 未关闭priority:medium ready-for-dev
难度 2/5 1-3 小时 新手友好度 72/100
OpenHands/extensions#781 ·
维护者通常 1 天内回复