Bound the pagination loops in github_graph - #674
Open
Thayorns wants to merge 3 commits into
Open
Conversation
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
marked this pull request as ready for review
September 2, 2026 08:21
Author
|
@yegor256 take a look here please |
Member
yegor256
self-requested a review
September 3, 2026 06:22
Author
|
@yegor256 take a look please |
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.
total_commits_pushedandtotal_releases_publishedboth page through GitHub withloop do ... break unless hasNextPage, taking whateverendCursorcomes back. Nothing bounds that. An endpoint that keeps answeringhasNextPage: truewith 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::Errornaming 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