Compare commits

...

2 Commits

Author SHA1 Message Date
rusackas
9b85a06304 fix(importers): guard validation-failure diagnostic against non-mapping and unsortable configs
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 18:36:56 -07:00
Evan Rusackas
0155015347 chore(importers): log field names instead of full config on validation failure
The debug log dumped the entire parsed config dict when schema
validation failed. Those blobs can be enormous (inline example data,
multi-line keys) and bury the actual validation error logged just
above. Log the file name and its top-level field names instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 13:40:17 -07:00

View File

@@ -230,7 +230,21 @@ def load_configs(
prefix,
exc.messages,
)
logger.debug("Config content that failed validation: %s", config)
# Log field names only; full values can be huge (e.g. inline
# example data) and drown out the validation error above. Guard
# the diagnostic so it can never raise and mask the validation
# error: config may be a non-mapping or have unsortable keys.
if isinstance(config, dict):
field_names = ", ".join(sorted(map(str, config)))
logger.debug(
"Config fields present in %s: %s", file_name, field_names
)
else:
logger.debug(
"Config in %s is not a mapping (type: %s)",
file_name,
type(config).__name__,
)
exc.messages = {file_name: exc.messages}
exceptions.append(exc)