Skip to content

Bound the pagination loops in github_graph - #674

Open
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:663-fix-pagination-loops
Open

Bound the pagination loops in github_graph#674
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:663-fix-pagination-loops

Conversation

@Thayorns

@Thayorns Thayorns commented Sep 2, 2026

Copy link
Copy Markdown

total_commits_pushed and total_releases_published both page through GitHub with loop do ... break unless hasNextPage, taking whatever endCursor comes back. Nothing bounds that. An endpoint that keeps answering hasNextPage: true with the cursor it was already given leaves the judge spinning on the same page until something else kills it, and there is no message anywhere saying which repository it got stuck on.

Both loops now count their pages and raise Fbe::Error naming the repository once the count passes one hundred, which is far above any real release or commit history a judge walks and low enough to fail in seconds rather than hours. Each loop also compares the cursor it is about to use against the one it just used and stops when they match, so the common case of a repeated cursor ends quietly instead of running to the page limit.

The limit itself is a private constant, since a caller has no business reading or changing it.

Closes #663

total_commits_pushed and total_releases_published looped on
hasNextPage alone, so a stalled or misbehaving endpoint could hang
forever. Cap both loops at MAX_PAGES, raising Fbe::Error naming the
repository when exceeded, and break early when the next cursor
repeats the current one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AousTA57kPsgjc7aQTycWh
@Thayorns
Thayorns marked this pull request as ready for review September 2, 2026 08:21
@Thayorns

Thayorns commented Sep 2, 2026

Copy link
Copy Markdown
Author

@yegor256 take a look here please

yegor256 commented Sep 3, 2026

Copy link
Copy Markdown
Member

This overlaps the same github_graph.rb functions (total_commits_pushed/total_releases_published) touched by #678, #671, #670, and #673 — needs manual reconciliation rather than a blind merge. Assigning to @yegor256.


Generated by Claude Code

@Thayorns Thayorns changed the title fix(#663): bound pagination loops in github_graph.rb Bound the pagination loops in github_graph Sep 3, 2026
@Thayorns

Thayorns commented Sep 3, 2026

Copy link
Copy Markdown
Author

@yegor256 take a look please

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.

Pagination loops have no bound in lib/fbe/github_graph.rb

2 participants