Skip to content

ref(scm): Add quota policy for GitHub API requests#115657

Merged
cmanallen merged 13 commits into
masterfrom
cmanallen/rate-limit-github-requests
May 18, 2026
Merged

ref(scm): Add quota policy for GitHub API requests#115657
cmanallen merged 13 commits into
masterfrom
cmanallen/rate-limit-github-requests

Conversation

@cmanallen
Copy link
Copy Markdown
Member

@cmanallen cmanallen commented May 15, 2026

Certain referrers need reserved quota to ensure their requests are always completed. This pull request aims to enable that. This does not handle secondary rate-limits whose calculations are not publicly available.

To use the reserved quota system you must:

  1. Register your referrer in the referrer allocation dictionary.
  2. Use the with client.referrer(name): expression to scope your requests to your referrer.
    • Lower priority requests can be made outside the with block which falls back to the shared quota pool.

@cmanallen cmanallen requested review from a team as code owners May 15, 2026 18:28
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 15, 2026
Comment thread src/sentry/scm/private/rate_limit.py Outdated
Comment thread src/sentry/scm/private/rate_limit.py Outdated
Comment thread src/sentry/scm/private/rate_limit.py
Comment thread src/sentry/scm/private/rate_limit.py
Comment thread src/sentry/scm/private/rate_limit.py
Comment thread src/sentry/integrations/github/client.py Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed77b82. Configure here.

Comment thread src/sentry/integrations/github/client.py
@cmanallen cmanallen merged commit 9f5fe89 into master May 18, 2026
69 checks passed
@cmanallen cmanallen deleted the cmanallen/rate-limit-github-requests branch May 18, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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