fetchMergedPullRequests pages with sort=updated&direction=desc, caps at MAX_PAGES_PER_REPO = 10 (1000 PRs) per repo, and --max-prs defaults to 300. When a cap is reached the run succeeds, printing a confident table built from a subset of the window.
Two things make that dangerous rather than cosmetic:
- The window filter uses
merged_at while the listing is ordered by updated, so the pages that contain the window are not guaranteed to be reached before the cap. A dormant PR merged inside the window competes with every PR touched more recently.
- The denominator is a sum of
issuesClosed, so dropping PRs does not just hide rows — it changes every contributor's amount, while dustRemainder still looks plausible.
The --since default (previous cycle's generatedAt) and the 300 default make this reachable for a busy multi-repo cycle, and nothing in the output says the crawl was cut short.
Fix: detect exhaustion (cap hit while payload.length === PER_PAGE, or merged.length >= maxPrs) and warn loudly — or fail with a clear message pointing at --max-prs. A paging strategy anchored on the window (e.g. stopping once a page is entirely older than since, which needs sort consistent with the filter) would be the real cure.
fetchMergedPullRequestspages withsort=updated&direction=desc, caps atMAX_PAGES_PER_REPO = 10(1000 PRs) per repo, and--max-prsdefaults to 300. When a cap is reached the run succeeds, printing a confident table built from a subset of the window.Two things make that dangerous rather than cosmetic:
merged_atwhile the listing is ordered byupdated, so the pages that contain the window are not guaranteed to be reached before the cap. A dormant PR merged inside the window competes with every PR touched more recently.issuesClosed, so dropping PRs does not just hide rows — it changes every contributor's amount, whiledustRemainderstill looks plausible.The
--sincedefault (previous cycle'sgeneratedAt) and the 300 default make this reachable for a busy multi-repo cycle, and nothing in the output says the crawl was cut short.Fix: detect exhaustion (cap hit while
payload.length === PER_PAGE, ormerged.length >= maxPrs) and warn loudly — or fail with a clear message pointing at--max-prs. A paging strategy anchored on the window (e.g. stopping once a page is entirely older thansince, which needssortconsistent with the filter) would be the real cure.