Repository navigation
Fix remaining missing season key; catch duplicate keys in CI - #137
Merged
Merged
Conversation
That Time I Got Reincarnated as a Slime (TVDB 352408) was missing the
`5:` season key, so its fifth `episodes:` block landed in season 4's
mapping as a duplicate key. Kometa loads YAML through ruamel, which
rejects duplicates, so the whole file aborted with:
found duplicate key "episodes" with value "{}"
Same class of bug as #136 (Colin from Accounts), which the reporter
suspected was not the only instance -- it was not.
`validate_yaml.py` missed both because pyyaml's `safe_load` silently
keeps the last duplicate value. Added a `check_duplicate_keys` pass
that walks the composed node tree (reporting every duplicate, not just
the first) so CI fails on this instead of shipping it to users. No new
dependency -- it uses the pyyaml the workflow already installs.
Also routed the existing repo-relative path formatting through a `_rel`
helper; `relative_to` raised when files were passed as relative CLI
arguments.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #136. That PR fixed Colin from Accounts and noted "there might be others" — there was one more, and now CI will catch the next one.
The remaining break
That Time I Got Reincarnated as a Slime (TVDB
352408) was missing its5:season key, so the fifthepisodes:block landed inside season 4's mapping as a duplicate key:Kometa loads YAML through ruamel, which rejects duplicate keys, so the entire 45k-line file aborted for every user with the reported error:
Verified there are no other instances: every
.yaml/.ymlin the repo now loads cleanly under ruamel with duplicate-key checking on.Why CI didn't catch it
validate_yaml.pyuses pyyaml'ssafe_load, which silently accepts duplicate keys and keeps the last value. So both this and #136 passed CI while being fatal to every downstream config.Added a
check_duplicate_keyspass that walks the composed node tree rather than the loaded document, reporting every duplicate with line numbers instead of aborting on the first:Duplicate keys are treated as errors (non-zero exit), alongside syntax errors and broken references. No new dependency — it uses the pyyaml the workflow already installs.
Also routed the existing repo-relative path formatting through a
_relhelper;relative_toraisedValueErrorwhen files were passed as relative CLI arguments (python3 scripts/validate_yaml.py metadata/series/title_cards.yaml).Verification
python3 scripts/validate_yaml.py→0 syntax error(s), 0 duplicate key(s), 0 broken reference(s)352408→ seasons 1–5 with 14/24/24/24/13 episodes; no title cards lost🤖 Generated with Claude Code