config: typos in configs/match/hooks/columns sections are silently ignored (extra="ignore")

Đang mở
#127 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/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
backend

Hướng nghiên cứu

Start with the listed models in schema.py and the semantic validation in validator.py. Add strict handling for extra fields to the named models, then inspect how collect_config_issues presents Pydantic extra_forbidden errors. Done means typos in match, hooks, and columns are reported with dotted paths in the editor Problems panel.

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

Mô tả

bug

Problem

Only Defaults (schema.py:142) and WorkflowStepSchema (schema.py:82) set extra="forbid". The rest of the config schema uses Pydantic's default extra="ignore":

  • MachineConfig (schema.py:178), MatchCriteriaSchema (schema.py:161), HooksConfig (schema.py:96), ColumnMapping (schema.py:49), RowColor (schema.py:35), AppConfigYaml (schema.py:208)

And the semantic validator only checks top-level keys (validator.py:13, :35-37). Verified examples that load with zero feedback:

  • match: {hostnmae: ["WS-*"]} → criteria silently become all-empty → config never matches → silent fallback to first config
  • hooks: {failmodee: abort} → failmode stays warn
  • columns: {Version: {widht: 5}} → no error anywhere, including collect_config_issues

This contradicts the project's No-Silent-Failures rule: a typo silently disables auto-selection or changes behavior. Closes the same hole #44 covers for defaults.columns, but in the per-config/match/hooks sections.

Suggested fix

Add model_config = ConfigDict(extra="forbid") to those models (top-level unknown keys are already caught by _KNOWN_TOP_LEVEL). Then verify collect_config_issues reports the Pydantic extra_forbidden errors with dotted paths for the editor Problems panel.

Ngôn ngữ chính
Python
Star
1
Fork
1
Merge trung bình
4 giờ 46 phút
Pull request đã merge (30 ngày)
55

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 falbany/ProFiles

Tất cả issue của falbany/ProFiles

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.