-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: reimplement download of latest versions #248
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
refactor: reimplement download of latest versions #248
Conversation
The main reason that prompted this reimplementation was rate limits from GitHub. If we got rate-limited by GitHub, we should block checking again until the rate limit resets. The time of when it will be reset is in the header `x-ratelimit-reset`. References: - https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit
b084f55
to
938bb79
Compare
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.
Pull Request Overview
This PR refactors the version checking and update mechanisms to address GitHub rate limit issues by implementing new API calls and error handling improvements. Key changes include:
- Adding serialization support (Serialize/Deserialize) to VersionChannel and Version structures.
- Renaming API calls from available_update to check_for_update and updating cache clearing logic.
- Changing the download flow to use update.binary.download() with improved error context.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
linkup/src/versioning.rs | Added Serialize and Deserialize derives to VersionChannel and Version for consistency. |
linkup-cli/src/commands/update.rs | Updated update logic to use new API methods and improved error context when downloading. |
Comments suppressed due to low confidence (2)
linkup-cli/src/commands/update.rs:55
- Ensure that the new update.binary.download() method returns a decompressed binary equivalent to the previous update.linkup.download_decompressed('linkup') method, to avoid any unintended behavior changes.
let new_linkup_path = update
linkup-cli/src/commands/update.rs:38
- Verify that CachedReleases::clear() effectively clears the same cache as the previous clear_cache() implementation to ensure consistent update behavior.
release::CachedReleases::clear();
The main reason that prompted this reimplementation was rate limits from GitHub. If we got rate-limited by GitHub, we should block checking again until the rate limit resets.
The time of when it will be reset is in the header
x-ratelimit-reset
.Closes SHIP-2147
References: