-
Notifications
You must be signed in to change notification settings - Fork 3
[TD-015] Config file schema not validated #12
Copy link
Copy link
Open
Labels
Description
Description
YAML config is loaded but invalid keys are silently ignored, making typos and misconfigurations hard to detect.
Location
- File:
lib/config.pyaround line 108-116
Impact
- Silent misconfiguration
- Users may not realize their settings aren't being applied
- Debugging config issues is difficult
Suggested Fix
Add schema validation with helpful error messages:
from jsonschema import validate, ValidationError
CONFIG_SCHEMA = {
"type": "object",
"properties": {
"aws": {...},
"azure": {...},
"gcp": {...},
},
"additionalProperties": False # Reject unknown keys
}
def load_config(path: Path) -> dict:
with open(path) as f:
config = yaml.safe_load(f)
try:
validate(config, CONFIG_SCHEMA)
except ValidationError as e:
raise ConfigError(f"Invalid config: {e.message}")
return configPriority
Low
Source
TECH_DEBT.md - TD-015
Reactions are currently unavailable