Skip to content

Comments

fix(releases): paginate GitHub client compare_commits to avoid 250-commit limit#108550

Merged
srest2021 merged 4 commits intomasterfrom
srest2021/fix-250-commits-bug
Feb 20, 2026
Merged

fix(releases): paginate GitHub client compare_commits to avoid 250-commit limit#108550
srest2021 merged 4 commits intomasterfrom
srest2021/fix-250-commits-bug

Conversation

@srest2021
Copy link
Member

@srest2021 srest2021 commented Feb 19, 2026

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:

  1. sentry-cli releases set-commits --auto resolves head shas from local git remotes via find_heads()
  2. authenticated_api.set_release_refs() sends a put request with the resolved shas to /organizations/{org}/releases/{version}/, or OrganizationReleaseDetailsEndpoint.put()
  3. OrganizationReleaseDetailsEndpoint.put() calls release.set_refs()
  4. Release.set_refs() calls fetch_commits() task
  5. fetch_commits() calls provider.compare_commits(), for GitHub that would be this function, which then hits the GitHub compare_commits endpoint.
  6. Now that we have <=250 commits we store the author info then set that release's commits (thus creating CommitAuthors using the stored author info from the fetched commits, and linking Commit and CommitAuthor to ReleaseCommit)
  7. Finally, we update release.authors to contain all the author ids for the ReleaseCommits for this release
  8. Whenever we serialize a release, _get_authors_metadata() uses those author ids to query the corresponding CommitAuthor objects

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 19, 2026
@srest2021 srest2021 marked this pull request as ready for review February 19, 2026 19:21
@srest2021 srest2021 requested a review from a team as a code owner February 19, 2026 19:21
@srest2021 srest2021 requested a review from a team February 19, 2026 19:22
@srest2021 srest2021 merged commit 8f47484 into master Feb 20, 2026
83 checks passed
@srest2021 srest2021 deleted the srest2021/fix-250-commits-bug branch February 20, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-code-assisted Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants