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

未关闭
#127 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
1
派生
1
平均合并
4 小时 46 分钟
30 天内合并 PR
55

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

falbany/ProFiles 的其他 Issue

查看 falbany/ProFiles 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。