-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dynamic quarto #176
Dynamic quarto #176
Conversation
@tnederlof This is ready to review. It's MUCH faster because I added parallelization to make the 5 API calls at once, rather than sequentially. I figured, "I'm in Go, why am I doing things without parallelization?" |
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 quick question otherwise LGTM, thanks for doing this!
|
||
for _, result := range results { | ||
|
||
err := json.NewDecoder(result.res.Body).Decode(&quarto) |
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.
Is it possible for result.res.Body to not exist and we should check for that or is the only case that would happen the error would be non nil in results
which already gets checked earlier?
I can't remember if we'd ever talked about this but I do have a reference that uses the excellent go GitHub sdk https://github.com/dpastoor/qvm/blob/main/internal/gh/releases.go In addition one thing you might want to check before fetching too many releases is if they have an API key, if you're making unauthenticated requests you blast through rate limit and things go south. Then you're blocked for a while so might want to consider how that specific scenario might get bubbled specially. The other technique to consider is to just check if a known release is valid so if they say provide a given version you can see if it is valid and go get that rather than fetching a bunch. Great to see this continuing to evolve! |
…or the 10 latest versions
Rebased dynamic quarto
…e download phase.
Pull quarto versions dynamically from github API. The results from the API are paginated with 100 results per page and there are a lot of releases.... 1300ish right now. Additionally, I exclude pre-lease versions to make sure we're only installing properly released versions.