-
Notifications
You must be signed in to change notification settings - Fork 756
Use Github REST API to download platform tools #8370
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8370 +/- ##
=======================================
Coverage 83.2% 83.2%
=======================================
Files 838 838
Lines 368496 368496
=======================================
+ Hits 306684 306728 +44
+ Misses 61812 61768 -44 🚀 New features to boost your workflow:
|
pretty sure we used to do this for the release binary tarball and at some point gh instituted quotas so we had to switch to cloud buckets. did we confirm that this interface provides the bandwidth that we need here? |
According to the Github docs, for unauthenticated users like our case:
I think on that end we are good. There are also secondary limits:
I don't think users download the tools so often, do they? See the points in https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#calculating-points-for-the-secondary-rate-limit.
I don't know if "response time" includes the download time. When I download with curl and limit the download rate to 500kbits/s, the download takes 15 minutes and finishes successfully.
Not our use case. |
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.
Looks great to me! Do get Trent's approval on the rate limiting bit, just to make sure we aren't wandering into another problem.
don't think it was a rate limit last time. rather a bandwidth quota. i can't find anything clearly documented atm though. i guess fafo. should probably have a backup plan tho this is just a concept ack. didn't review the code |
Given the potential quota Trent is worried about, we could instead adopt another strategy. We could maintain the existing URL for automatic downloads, when someone simply invokes Any opinions? |
Hm, that's a good point, how about a flag to use the old download method and url? ie |
Sorry, I posted my message without seeing yours!
Works for me! I've wanted an install-only command for a long time 😄 |
Closing in favor of #8461 |
Problem
Downloads directly from the browser URL may fail in slow connections because Github now restricts them to a five minute window. One of the alternatives discussed in https://github.com/orgs/community/discussions/169381#discussioncomment-14105326 is using the Github REST API for the download.
This PR should fix anza-xyz/platform-tools#108 and anza-xyz/platform-tools#107.
Summary of Changes
solana-file-download
.