fix(releases): paginate GitHub client compare_commits to avoid 250-commit limit#108550
Merged
fix(releases): paginate GitHub client compare_commits to avoid 250-commit limit#108550
Conversation
armenzg
approved these changes
Feb 19, 2026
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.
Per https://sentry.slack.com/archives/C08AZ3MD2EQ/p1770657631215169
Our customers are experiencing problems with missing commits on their releases, and the limit seems to be 250 commits. This is because we use GitHub's compare_commits endpoint, which is limited to 250 commits when unpaginated. Here we paginate the endpoint to make sure we get the complete commits list.
Complete flow from sentry-cli to getting the fetched release commits:
sentry-cli releases set-commits --autoresolves head shas from local git remotes via find_heads()authenticated_api.set_release_refs()sends a put request with the resolved shas to/organizations/{org}/releases/{version}/, orOrganizationReleaseDetailsEndpoint.put()OrganizationReleaseDetailsEndpoint.put()callsrelease.set_refs()Release.set_refs()callsfetch_commits()taskfetch_commits()callsprovider.compare_commits(), for GitHub that would be this function, which then hits the GitHub compare_commits endpoint.CommitAuthorsusing the stored author info from the fetched commits, and linkingCommitandCommitAuthortoReleaseCommit)release.authorsto contain all the author ids for theReleaseCommitsfor this release_get_authors_metadata()uses those author ids to query the correspondingCommitAuthorobjects