-
Notifications
You must be signed in to change notification settings - Fork 143
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 channel over github api #104
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.
Getting closer! Just a few more nits.
Hmm, I actually discovered a toml parsing bug as a result of #100. I have included the fix in this PR because it was only a one-liner fix (in this commit 1ac5155)
Looking a bit closer at the Settings
type, it seems to be doing some manual parsing that might also be better replaced by deriving Deserialize
? Probably best addressed in a separate PR either way.
src/download.rs
Outdated
@@ -298,10 +290,11 @@ pub fn unpack_bins(dir: &Path, dst_dir: &Path) -> Result<Vec<PathBuf>> { | |||
|
|||
#[cfg(test)] | |||
mod tests { | |||
use crate::channel::Channel; | |||
|
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.
src/channel.rs
Outdated
@@ -3,21 +3,34 @@ use crate::{ | |||
download::DownloadCfg, | |||
}; | |||
use anyhow::{bail, Result}; | |||
|
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.
src/channel.rs
Outdated
use tempfile::tempdir_in; | ||
use toml_edit::{Document, Item}; | ||
use tracing::error; | ||
use toml_edit::{de, Item}; | ||
|
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.
Good point - will create an issue for this |
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.
LGTM, will defer to @mitchmindtree for final approval.
* fuelup check refactor * Better error handling when splitting and parsing versions * clippy and message changes * revert check logic changes * remove newline
…bs/fuelup into bingcicle/channel-support
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.
🚢
This reverts commit 557d1e9.
Closes #87
Note: we might want to wait for #95 to be approved and merged prior to getting this merged
Now that we have channels we should move to using them instead of directly forming URLs within the code itself. This also gets rid of the flakiness issue of getting versions from GitHub API, which fails sometimes as reported here as well.
new
channel.rs
to handle all thingsChannel
related. Eventually we should also supportnightly
andstable
here. There's also a simple test included here to verify correctness of parsing a sample channel (provided withintests
dir)Under this new file there is also the
Package
construct which represent a downloadable component and its different distribution info, represented by aHashedBinary
which contains the respectiveurl
andhash
based on the target architecture. Currently we do not check the hash when we download the file but this can be done in a future PR.Introduced new way of creating a
DownloadCfg
from aPackage
. This allowsfuelup
to use the download URL directly without having to manually build and format the URL.code changes for existing code has to do with commands
fuelup check
andfuelup toolchain install latest
.check
has been updated to parse the versions from the channel toml, whiletoolchain install latest
has been updated to useDownloadCfg::from_package
to directly download from theurl
within the correctHashedBinary
representation (depending on your machine)There is also some refactoring of existing code (eg.
get_latest_tag()
), mostly to do withdownload.rs
to make things smoother when handling both channel usage and github api usage.We do not yet deprecate GitHub API support completely for at least a few versions to ensure stability, so we keep them as a fallback for now.