-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use Github graphql api to avoid rate limiting #104
Use Github graphql api to avoid rate limiting #104
Conversation
This adjusts the index regeneration so that it retrieves the list of all pack versions (repo tags) in as few API calls as possible. At 1 call per pack per pack deployment, multiple pack deployments can easily hit the rate limit. Using graphql reduces the number of calls that count toward the rate limit (today) to 2 per pack deployment. Tags are apparently a very inexpensive API request, so github is only counting 1 call per page. More complex queries can count as more than one call per page, so this is very fortunate for our use case. Graphql limits each page to 100 results, so with about 160 packs, that is only 2 pages. So, we won't hit a 3rd page until we get over 200 packs.
I've tested my changes manually. Both |
I've tested the |
4f9766f
to
9808cb2
Compare
Also fix git clone "fatal: Too many arguments." error
9808cb2
to
8c62bef
Compare
Using the dependencies job requires updating .circleci/config.yml in all packs, so we continue installing it in the dependencies script until it has been deployed everywhere and is thus safe to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change. Otherwise looks good.
1f1acf0
to
d36f7a3
Compare
Co-authored-by: blag <blag@users.noreply.github.com>
The new CI error messages we're getting for Exchange Packs after this PR:
@blag Is that because of expired creds? @cognifloyd I guess we need a bit better error handling there. |
Yes it is. And yes we do. |
Captured in #109. |
This adjusts the index regeneration so that it retrieves the list of all
pack versions (repo tags) in as few API calls as possible.
At 1 call per pack per pack deployment, multiple pack deployments can
easily hit the rate limit. Using graphql reduces the number of calls
that count toward the rate limit (today) to 2 per pack deployment.
Tags are apparently a very inexpensive API request, so github is only
counting 1 call per page. More complex queries can count as more than
one call per page, so this is very fortunate for our use case.
Graphql limits each page to 100 results, so with about 160 packs, that
is only 2 pages. So, we won't hit a 3rd page until we get over 200
packs.