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

API Rate Limit #24

Open
shiv810 opened this issue Oct 28, 2024 · 2 comments
Open

API Rate Limit #24

shiv810 opened this issue Oct 28, 2024 · 2 comments

Comments

@shiv810
Copy link
Collaborator

shiv810 commented Oct 28, 2024

The unlimited issue fetch depth is leading to rate limiting for the REST and GraphQL API calls. A maximum depth for issue fetching should be created.

Action Run: Run

@0x4007
Copy link
Member

0x4007 commented Oct 28, 2024

We should instead gracefully handle when rate limited and continue with what we can but also let the user know in the output that due to rate limits this isnt the full context possible for the response.

@Keyrxng
Copy link
Contributor

Keyrxng commented Oct 28, 2024

I don't think it's unlimited fetch depth that's causing it. This PR #21 introduced a package github-diff-tool which is used in this fn which is called with it's own Promise.all() within formatChatHistory() which uses it's own Promise.all().

Current call count using that package:

Octokit call count Map(9) {
  'rest.issues.get' => 8,
  'rest.issues.listComments' => 3,
  'repos.getContent' => 2,
  'rest.pulls.listReviewComments' => 2,
  'graphql' => 5,
  'rest.pulls.get' => 1,
  'rest.pulls.listFiles' => 8,
  'rest.repos.getContent' => 13,
  'repos.listLanguages' => 1
}

Call count without using that package without removing Promise.all():

Octokit call count Map(7) {
  'rest.issues.get' => 8,
  'rest.issues.listComments' => 3,
  'repos.getContent' => 2,
  'rest.pulls.listReviewComments' => 2,
  'graphql' => 5,
  'paginate' => 1,
  'repos.listLanguages' => 1
}
  1. Optimize usage of Promise.all() for the changes introduced in fix: ignore file path and diffs #21 that use the package. (I see it colours diffs etc. Is that stripped before fed to the model I assume?
  2. Remove usage of the package and simplify the PR diff/file fetching.
  3. Totally remove usage of Promise.all().

I tend to avoid using it completely the time benefits usually are not necessary especially for action plugins. Unless they involve API calls it's fine.

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

No branches or pull requests

3 participants