-
Notifications
You must be signed in to change notification settings - Fork 77
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
github rate limit is hit pretty quickly #62
Comments
(I was on holiday and missed the notification, apologies) Yeah that’s indeed an issue. The best (only?) solution would be to add support for a |
No worries, thanks for responding.
Could you specify what you mean by "it"? Sorry if I'm missing something obvious here. |
I wasn't very clear. I meant "doing it by hand" as in not using niv, e.g. with a bash script that calls GitHub's API to check for the latest rev. Of course this is not a problem if you copy the rev by hand from the GitHub project page, since most likely you'd be logged in. |
In that case, yes I would suspect that any application that uses the API in this manner would hit the rate limit in the same way niv does. There however seems to be a feature for conditional requests. It might be possible to store the |
Actually I think it might be solved by #58; hopefully fetGit and fetchFromGitHub use SSH to login |
@nmattia Would this switch also replace the code (For that reason) I think |
I'm assuming you want to reimplement the But maybe I am just misunderstanding your intentions. |
@leotaku re your last comment: you're completely right, it was a mix of a brainfart and wishful thinking on my end |
I'm starting thinking about this, and I'm wondering if using the graphql api wouldn't allow to
I'll need to get acquainted with the |
Oh that's a very neat idea. The |
Indeed, it looks like it wouldn't be too much effort to add a constructor to I went through the code, but I did not completely get all the intricacies of it at the first go. I think you mentioned you wanted to write some documentation about; I'd be very curious to read it. For graphql, I crafted the following query to illustrate a few things (using https://developer.github.com/v4/explorer/):
The result is:
Here is what the curl looks like:
That being said, I now realize it's a bit cumbersome, and it only for authenticated users, which might very well be a deal-breaker |
Sweet.
Re. the doc: bumped priority on the todo list |
Out of curiosity, I still looked at how the rate limiting works, and it's quite complex :) But yeah, without anonymous access, this is moot. |
I've felt into a rabbit hole, and another bad option to go around rate limiting is to use the git protocol instead of the api. |
I've hit this also but I reported it under issue #105 because I couldn't see what was going on and the error message was bunk. |
FWIW now using git sources ( |
Although this is for cachix github action, uses same nix.conf
https://github.com/cachix/install-nix-action#usage-with-flakes Don't know why I never get this issue locally unless it's using ssh. For CI with Actions, there's a token available. Might as well. Otherwise make a machine user and create a token or use personal / work account if you need to set this for local development. |
When I try to update all dependencies in multiple large projects, it is realistic for the Github API calls to hit a rate limit.
This is of course a problem, because it essentially "blocks" me from working with niv for 1 hour. Maybe there is something that could be done?
Relevant link: https://developer.github.com/v3/#rate-limiting
The text was updated successfully, but these errors were encountered: