Skip to content

Conversation

@michaelpiramanrique271-tech

This PR adds robust rate limit handling for all GitHub API calls to improve reliability and prevent failures when approaching or exceeding API limits.

Changes:

  • Add RateLimitInfo dataclass to parse and track rate limit state
  • Add parse_rate_limit_headers() to extract rate limit info from responses
  • Add is_rate_limited() to detect rate limiting (403/429 status codes)
  • Add check_preemptive_rate_limit() for early warning when approaching limits
  • Add wait_for_rate_limit_reset() with progress logging for long waits
  • Integrate rate limit handling into get_github_user()
  • Integrate rate limit handling into get_pull_request_file_changes()
  • Integrate rate limit handling into get_github_graphql_query()

Benefits:

  • Prevents validator failures during high API usage periods
  • Automatic retry with proper wait times when rate limited
  • Proactive warnings when approaching rate limits
  • Better observability through detailed logging

This PR adds robust rate limit handling for all GitHub API calls to improve
reliability and prevent failures when approaching or exceeding API limits.

Changes:
- Add RateLimitInfo dataclass to parse and track rate limit state
- Add parse_rate_limit_headers() to extract rate limit info from responses
- Add is_rate_limited() to detect rate limiting (403/429 status codes)
- Add check_preemptive_rate_limit() for early warning when approaching limits
- Add wait_for_rate_limit_reset() with progress logging for long waits
- Integrate rate limit handling into get_github_user()
- Integrate rate limit handling into get_pull_request_file_changes()
- Integrate rate limit handling into get_github_graphql_query()

Benefits:
- Prevents validator failures during high API usage periods
- Automatic retry with proper wait times when rate limited
- Proactive warnings when approaching rate limits
- Better observability through detailed logging
@LandynDev LandynDev closed this Dec 31, 2025
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.

2 participants