Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add bypass to rate limiter #396

Merged
merged 2 commits into from
Oct 7, 2024
Merged

feat: add bypass to rate limiter #396

merged 2 commits into from
Oct 7, 2024

Conversation

zkoppert
Copy link
Member

@zkoppert zkoppert commented Oct 5, 2024

Pull Request

fixes #395

This pull request introduces a new feature to bypass the GitHub API rate limit waiting loops and includes several related changes across multiple files. The key changes involve updating the configuration with a bypass, modifying the rate limit handling logic, and adding corresponding tests.

Proposed Changes

New Feature: Rate Limit Bypass

Configuration Updates:

  • config.py: Added rate_limit_bypass parameter to the EnvVars class and updated the __init__ and __repr__ methods to include this parameter. Also, modified the get_env_vars function to read the RATE_LIMIT_BYPASS environment variable. [1] [2] [3] [4] [5] [6]

Main Functionality Updates:

  • issue_metrics.py: Updated the search_issues function to accept a rate_limit_bypass parameter and modified the wait_for_api_refresh function to skip waiting if the bypass is enabled. Also, updated the main function to pass the rate_limit_bypass parameter to search_issues. [1] [2] [3] [4] [5] [6]

Documentation:

  • README.md: Added a description for the new RATE_LIMIT_BYPASS environment variable.

Test Cases:

  • test_config.py: Updated the setUp method to include RATE_LIMIT_BYPASS and added it to the environment variables. Modified the test_get_env_vars_with_github_app test case to include the rate_limit_bypass parameter. [1] [2] [3]
  • test_issue_metrics.py: Added a new test case test_search_issues_with_just_owner_or_org_with_bypass to verify that the rate limit bypass works correctly.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance, or breaking

@zkoppert zkoppert self-assigned this Oct 5, 2024
@zkoppert zkoppert marked this pull request as ready for review October 5, 2024 06:55
@zkoppert zkoppert merged commit c567bd1 into main Oct 7, 2024
31 checks passed
@zkoppert zkoppert deleted the bypass-ratelimiter branch October 7, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bypass rate limiting when not enabled
2 participants