Skip to content

fix(tools): parse every page of overlap PR results - #4540

Closed
MiniRML wants to merge 2 commits into
boykopovar:mainfrom
MiniRML:fix/tools-overlap-pagination
Closed

MiniRML wants to merge 2 commits into
boykopovar:mainfrom
MiniRML:fix/tools-overlap-pagination

Conversation

@MiniRML

@MiniRML MiniRML commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

The overlap scanner fails with JSONDecodeError: Extra data when GitHub CLI returns more than one page of PRs. gh api --paginate emits separate JSON documents for each page, but open_prs parses its entire output as one document. Request --slurp and flatten the resulting page arrays. The previous test double returned one flat array and concealed the failure; update it to the real response shape.

The response contract is documented in the GitHub CLI API manual.

Tested

Windows 11, Python 3.13. A fixture matching the documented CLI contract supplies 201 PRs over three pages: it fails on the base with Extra data and passes with the fix, retaining the final PR's head and dependency. No live gh invocation or game files needed.

Checklist

  • Based on current main; no other open PR implements the same fix
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no runtime stubs changed
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source; none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

@oneandonlydean oneandonlydean self-assigned this Oct 12, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: gh api --paginate already joins the pages of an array endpoint into one array (main's call returns all 423 open pull requests as one JSON document on gh 2.101), and #4289 removed --slurp because gh before 2.48 rejects it. Reopen with the gh version and the output if a real run gives Extra data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants