Add multiple strategies for querying GitHub release and assets info #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The github v4 api is a little heavy for the github installer strategy in binny. Specifically a github token is required for use at all, and though the v3 api does not require this, it fetches a lot more information (is slower) and has pretty strict rate limiting. For this reason I've decided to add multiple strategies for fetching release information.
For installing, 3 strategies are attempted in the following order:
https://github.com/<user>/<repo>/releases/expanded_assets/<tag-or-latest>
endpoint that drives the github UI. This is brittle, however, is the quickest way to get a list of all assets for a release universally. The risk is that GitHub may decide to change this endpoint at any time in the future for no reason or warning.checksums.txt
assets that may or may not be there, then use the contents for a listing of assets. This is not universally guaranteed and there are a few common patterns to try so it is not an ideal solution to use as a default.For updating the version locks, 2 strategies are attempted in the following order:
https://github.com/<user>/<repo>/releases/latest
(acceptingapplication/json
)For an update strategy to be deemed working, the result must not be empty and must also satisfy any user-given version constraint, otherwise the next strategy is attempted.
These updates will make binny not only faster but also not require a github token by default 🎉