Fail closed when pages ffprobe exits with leftover JSON - #143
Merged
Conversation
Pages duration badges parsed ffprobe stdout without checking returncode, so a failed probe could stamp a wrong ~Mm Ss onto index.html. Ignore stdout on nonzero exit and keep the varies/concat fallbacks. Co-authored-by: jmjava <jmjava@gmail.com>
ruff green; pytest 799 passed, 1 skipped; docgen benchmark meets baseline. Co-authored-by: jmjava <jmjava@gmail.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.
Problem
PR #135 made compose / TTS / validate / local-timestamp duration probes ignore ffprobe stdout when the process exits non-zero. Pages was left behind.
PagesGeneratorduration badges stilljson.loads(out.stdout)with noreturncodecheck. A failed probe that still printed JSON (or leftover stdout) can stamp a wrong~Mm Ssonto generatedindex.htmlinstead of the"varies"/"concat"fallback.Change
_ffprobe_duration_label: nonzero exit, timeout, missing ffprobe, or unparsable JSON → fallback~Mm SsGate
ruff check src/ tests/greenpytest tests/— 799 passed, 1 skippeddocgen benchmarkmeetssrc/docgen/benchmark_data/baseline.json(no clock change; no--update-baseline)Out of scope
_check_streams/_check_driftJSON probes (empty stdout already failsjson.loads→ failed check)int(... or 0)in timing enrichmentdocgen pageswhen ffprobe is missingMilestone:
milestones/pages-ffprobe-returncode.md