Page the REST pulls list by hand instead of --paginate - #72
Merged
Conversation
`gh api --paginate` follows GitHub's Link header verbatim, and that header names github.com/ghapi. Behind an exe.dev GH_HOST proxy the second page therefore escapes the proxy, goes out unauthenticated, and 404s the whole call, so pullBaseOids returned null and every sweep aborted. Only a repo with more than 100 open PRs ever has a second page, which is why this hit bevyl (135 open) for five days and no other VM. Ask for page=N explicitly instead, and log gh's first stderr line on failure the way the gh pr list branch already does, so the next time this call dies the log says why.
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.
Why
The bevyl reviewer (
stupify-bevyl-ai-bevyl-ai) has loggedgh api pulls failed (auth/network down?) — aborting sweepevery minute since 2026-09-03 02:47Z, right after the #71 bundle landed. No PR on bevyl-ai/bevyl.ai has been reviewed since.The failing call is the REST base-SHA fetch #70 added:
Page 1 comes back fine through the exe.dev proxy. Its
Linkheader is<https://github.com/ghapi/repositories/1023932389/pulls?...&page=2>; rel="next", andgh --paginatefollows that URL verbatim, so page 2 bypassesGH_HOST, hits github.com/ghapi with no credentials, and 404s. gh exits 1,pullBaseOidsreturnsnull, the sweep aborts. Only a repo with more than 100 open PRs has a page 2, so the other five VMs never saw it (bevyl has 135).Reproduced on the VM: the same URL with
&page=2and no--paginatereturns the remaining 35 PRs; the Link URL fetched directly returns 404.What
page=1..Nwith explicitper_page/pageparams until a short page. No--paginate.gh pr listbranch. The old branch logged a fixed string and swallowed the real error, which is why this took five days to read.Deployed the bundle from this branch to
stupify-bevyl-ai-bevyl-ai(backup atreview-sweep.ts.bak-pre-paginate-fix). The other VMs are still on the Sep 1 bundle and should get this once merged.