-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix solana-install init
making unnecessary API requests
#33949
Fix solana-install init
making unnecessary API requests
#33949
Conversation
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.
Thanks for taking a crack at this!
This isn't quite right yet, as it breaks some of the other commands (solana-install info
, solana-install update
) that ultimately call into fn init_or_update()
.
Before:
$ solana-install init v1.16.13
✨ 1.16.13 initialized
$ solana-install info
Configuration: /.config/solana/install/config.yml
Active release directory: /.local/share/solana/install/active_release
• Release version: 1.16.13
• Release URL: https://github.com/solana-labs/solana/releases/download/v1.16.13/solana-release-aarch64-apple-darwin.tar.bz2
• Release commit: b2a38f6
🎁 Update available: 1.16.18
With this patch:
$ cargo run --bin solana-install init v1.16.13
Finished dev [unoptimized + debuginfo] target(s) in 0.22s
Running `solana/target/debug/solana-install init v1.16.13`
✨ 1.16.13 initialized
$ cargo run --bin solana-install info
Finished dev [unoptimized + debuginfo] target(s) in 0.22s
Running `solana/target/debug/solana-install info`
Configuration: /.config/solana/install/config.yml
Active release directory: /.local/share/solana/install/active_release
• Release version: 1.16.13
• Release URL: https://github.com/solana-labs/solana/releases/download/v1.16.13/solana-release-aarch64-apple-darwin.tar.bz2
• Release commit: b2a38f6
🎁 Update available: 1.16.13
I think that we need some flag to ensure your github-check bypass is only executed when the call comes from fn init()
. There are probably alternatives that involve refactoring fn init_or_update()
, which is kind of a kitchen sink.
I added I didn't test the other commands, sorry for that, and thanks for pointing out some of them broke. |
Oh cool, I forgot we had that already 😅 I just kicked off CI on this, so keep an eye out in case there are any complaints. Looking good, though. |
Codecov Report
@@ Coverage Diff @@
## master #33949 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 809 809
Lines 219070 219074 +4
=========================================
- Hits 179476 179466 -10
- Misses 39594 39608 +14 |
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.
Thanks for this contribution, @acheroncrypto !
Problem
Using
solana-install init
makes API requests to GitHub even when the given version is already installed locally.Summary of Changes
Only fetch releases from GitHub if the given version is not installed.
Fixes #33948