Open smiklos opened 2 years ago
Issue persists on GitLens Version 12.0.1
Have been getting spammed constantly with:
GitHub request failed: API rate limit exceeded for user ID xxxx
Source: GitLens --- Git supercharged (Extension)
v12.0.1 installed
I'm sorry for the trouble. Can you please enable debug logging by running from GitLens: Enable Debug Logging from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens and GitLens (Git) channel in the Output pane.
Once enabled, please reproduce the issue, and attach the log from the both GitLens and GitLens (Git) channels.
Thank you!
FYI, I will also be adding better handling of rate limit issues, but I really want to understand why GitLens would be making so many calls.
The issue is not just that I get blocked out but the whole office network is detected as malicious and we can't access github. Even users who don't even use vscode are blocked. Me having to reproduce this is not feasible.
On Wed, 9 Mar 2022, 07.27 Eric Amodio, @.***> wrote:
I'm sorry for the trouble. Can you please enable debug logging by running from GitLens: Enable Debug Logging from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens and GitLens (Git) channel in the Output pane.
Once enabled, please reproduce the issue, and attach the log from the both GitLens and GitLens (Git) channels.
Thank you!
FYI, I will also be adding better handling of rate limit issues, but I really want to understand why GitLens would be making so many calls.
— Reply to this email directly, view it on GitHub https://github.com/gitkraken/vscode-gitlens/issues/1869#issuecomment-1062595324, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYR27F4P3FYHSVATEBIZNDU7BAGPANCNFSM5PXOXD4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
I'll enable debugging and try to reproduce this. I encountered it multiple times already on public GitHub repositories so this should hopefully reproduce with logs.
Just pinging if anyone can provide logs -- because I'm really not sure what could be causing lots of requests. GitLens only makes requests a handful of requests generally in response to direct user action (other than checking for a PR associated with the current branch -- but it only does that once and when the repo changes). Other requests are done to check for PRs when changing the active line (which seems like the most likely candidate -- but still hard to see hitting limits there), or expanding commits in the views, or in the hovers. The only place where GitLens can make a series of requests is if you use the new Autolinked Isssues & PR feature in comparisons -- since that will make a request for each issue/PR found.
Also for users hitting this you disconnect GitLens from GitHub with the GitLens: Disconnect from Remote
command or by setting the gitlens.integrations.enabled
setting to false
for the time being.
Again, really sorry for the trouble.
What I see in the logs is that just by moving a cursor to a line GitLens sends a request to issuesOrPullRequest
(e.g. [2022-03-11 19:44:43.590] [ 1085] GitHubApi.getIssueOrPullRequest completed • 291 ms
.
This seems too eager to me. Or at least I'd like to understand what information I would loose by not hitting the API at this point.
@eps1lon yeah, it does make a request for each commit that you move the cursor to (only once per commit tho).
You can see (and toggle) that behavior here:
Also in those logs all of those calls look like they are reading from cache as they are completing in 0ms.
[2022-03-11 19:49:13.264] [ 1aa3] GitHubRemote.getPullRequestForCommit — O=ba24a4be96469a5c3e004c186e19c1a57b2fd999
[2022-03-11 19:49:13.265] [ 1aa3] GitHubRemote.getPullRequestForCommit completed • 0 ms
Also in those logs all of those calls look like they are reading from cache as they are completing in 0ms.
2 of the 3, yes. 1 still went through.
You can see (and toggle) that behavior here:
I don't want to turn it off. I just don't need it when the cursor is on the commit. Will try with it turned off though for now.
@eps1lon Turning that setting off -- will just turn off the querying as you move the cursor around (since it won't be trying to add the PR information into the current line blame annotation). It will still query if you hover, or any of the other places. GitLens has lots of granular control over what you want to see when and where.
This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!
I also have "GitHub Pull Requests and Issues" installed which seems to have similar issues: https://github.com/microsoft/vscode-pull-request-github/issues/3409#issuecomment-1072736656
Since the latest update to 12 We are getting rejected from accessing Github because we get rate limited, presumably because of the many requests this plugin makes. I have no further proof yet, but it started two days ago , exactly when the new version was released.
I will try to provide logs later but perhaps someone can look into this already.