Skip to content

feat: add GitHub API rate limit awareness#54

Open
Jiya3177 wants to merge 1 commit into
Hell1213:mainfrom
Jiya3177:feat/github-rate-limit-awareness-37
Open

feat: add GitHub API rate limit awareness#54
Jiya3177 wants to merge 1 commit into
Hell1213:mainfrom
Jiya3177:feat/github-rate-limit-awareness-37

Conversation

@Jiya3177
Copy link
Copy Markdown

Summary

Add rate-limit awareness to GitHubCLIProvider before GitHub API calls.

Related Issue

Fixes #37

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Test changes
  • CI/Chore

Testing

  • uv run ruff check passes
  • uv run mypy passes
  • uv run pytest passes
  • Manual testing done

Manual testing:

  • PYTHONPATH=src python3 -m pytest tests/oss/test_github_cli_provider.py
  • python3 -m ruff check src/oss_dev/providers/github/client.py tests/oss/test_github_cli_provider.py

Description

Added rate-limit checks before gh api calls in GitHubCLIProvider.

This change:

  • Parses gh api rate_limit output.
  • Blocks API calls when remaining quota is exhausted.
  • Warns on low remaining quota.
  • Handles malformed rate-limit responses gracefully.
  • Handles rate-limit CLI errors with clearer ProviderError messages.
  • Avoids recursive checks for gh api rate_limit.

Added focused tests with mocked subprocess.run so no real GitHub API calls are made.

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.

Add rate limit awareness for GitHub API calls

1 participant