Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`darnit validate` crashes on openssf-baseline.toml summarising levels

Đang mở Phù hợp với người mới
#589 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Đọc packages/darnit/src/darnit/cli.py, đặc biệt là cmd_validate và cách nhóm theo cấp độ gần dòng 416; so sánh với cách darnit audit đọc cấp độ từ các thẻ. Tái hiện bằng openssf-baseline.toml đi kèm, theo các bước trong issue. Công việc hoàn tất khi darnit validate thoát với mã 0 và in ra phân tích theo cấp độ cho các control có cấp độ được lưu trong thẻ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs triage

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

  1. pip install "darnit-mcp==0.1.1" "darnit-core==0.1.1" "darnit-baseline==0.1.1"
  2. 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.

Ngôn ngữ chính
Python
Star
22
Fork
27
Merge trung bình
2 ngày 28 phút
Pull request đã merge (30 ngày)
40

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của darnitdevorg/darnit

Tất cả issue của darnitdevorg/darnit

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.