Repository navigation
fix(report): one-line exit 2 for bad inputs, name the cause of an empty join - #42
Merged
Merged
Conversation
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.
What
seo-manager reportnow handles bad inputs and an empty join cleanly instead of crashing or printing an empty report with no explanation.videos.yaml, a ledger line that is not valid JSON (or has no timestamp), unparseable YAML, avideos.yamlwithout a top-levelvideoslist, an entry missingid/title/date, and a bad date each print one line naming the cause to stderr and exit 2. No traceback.--outpath exits 2 with one line.Why
Before this, a bad input gave a raw
JSONDecodeError/KeyError/FileNotFoundErrortraceback, and an empty join produced a table of zeros with no hint whether the cause was the wrong file, a stale ledger, or a missing metric.Evidence
Red on base: the new
tests/unit/test_perf_report.pycopied ontoorigin/maingives11 failed, 11 passed(all 11 new CLI error/empty-join tests fail, for exampleFileNotFoundErrortraceback on an unwritable--out).Green on this branch, full suite (
python -m pytest, run through the slot gate):0 failed. Lint with the CI-pinned ruff 0.15.22 (
ci/tools-requirements.txt):ruff check .all checks passed;ruff format --check .172 files already formatted.Diff: 4 files, 272 insertions, 28 deletions (300 total).
UI evidence: terminal-only change, no screenshots applicable.