Skip to content

#1661: prevent infinite loop in earliest() commit pagination#1757

Open
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1661-infinite-loop-earliest
Open

#1661: prevent infinite loop in earliest() commit pagination#1757
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1661-infinite-loop-earliest

Conversation

@VasilevNStas

@VasilevNStas VasilevNStas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Changes the earliest() method in github-events.rb from sha-based pagination to page-based pagination with a safety limit of 100 pages, preventing infinite loops when commit history is very large or GitHub returns unexpected results.

Also updates test stubs to match the new page=N parameter in commit requests.

Closes #1661

Replace while loop with proper page-based pagination and a
max-iteration guard (100 pages) to prevent infinite loops on
repos with long commit history.
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 please review

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.

github-events.rb earliest() infinite loop on repos with very long commit history

1 participant