You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: paginate on the API page size, not on how many PRs survive curation
Second run got as far as fetching PRs and reported:
Found 0 open pull requests (curation selects 160)
⚠️ 160 selected PR(s) are no longer open and will be skipped
All 160 are open. The walk over /pulls decided it had reached the last page by
testing `len(prs) < 100` *after* filtering. A page of 100 open PRs almost never
contains 100 that a curator selected, so the loop stopped on page 1 — and since
the API returns newest first while this profile's PRs are older, page 1 held
none of them. Zero.
Pagination now tests the count the API returned; filtering happens after and
cannot end the walk. Simulated against the real shape (20 selected PRs spread
across 80 pages): 0 found before, 20 after.
The bug was latent in the original code, which filtered by USERNAMES before the
same check — it only ever ran with USERNAMES empty, so nothing was filtered and
the count was the raw page size. Making curation unconditional is what exposed
it.
Also fixes the crash that followed. The "no open PRs" path prints "creating
branch with just main branch updates" and then pushes that branch, but nothing
creates it — apply_prs_to_branch() normally does, and that path skips it. The
push failed with "src refspec build-... does not match any", which says nothing
about the actual problem. It now creates the branch, so an empty curation
produces an empty build and a report rather than a misleading git error.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments