Files
zlareb1andClaude Opus 4.7 9de76e56fd Skip unmerged PR rows in pr_meta.tsv loaders
Address review comment 3194688968: `parse_pr_meta` and the nightly-summary
loader in `compute_deltas` both called `datetime.fromisoformat(r["mergedAt"])`
unconditionally. `gh pr list --state all` returns open PRs with empty
`mergedAt`, so the bare-empty-string would raise `ValueError` mid-load and
abort the whole pipeline.

Add a shared helper `parse_merged_at` in `_common.py` that returns `None`
for empty/whitespace `mergedAt`, and route both call-sites through it. Each
loader counts skipped rows and prints a one-line summary to stderr so the
caller can tell the difference between "no PRs in input" and "all PRs were
unmerged". `tests/test_common.py` gains 4 cases pinning the
empty/whitespace/missing-key/Z-suffix paths. 25 -> 29 cases, all pass.

Backward compat held: `cumulative_gains.tsv` md5 still
e5a27e01008ef7e23597ee041f68103b on the standard smoke input. Manually
verified that injecting a synthetic open-PR row (empty `mergedAt`) now
prints `parse_pr_meta: skipped 1 unmerged PR row(s) ...` and the pipeline
still produces `pr_to_nightly.tsv` instead of aborting.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-06 11:40:14 +00:00
..