-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
PR: Use checksum to verify downloaded asset for updating Spyder (Update manager) #24131
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
Conversation
1455137 to
e1a25ff
Compare
e1a25ff to
0fb3270
Compare
0fb3270 to
593e8f2
Compare
ccordoba12
left a comment
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.
Just a few comments and suggestions for you @mrclary.
…set size. This can reduce url requests when checking for asset availability. This also obviates writing asset size to file. Verifying download now checks asset size against size info in Github release. Download directory is cleared immediately prior to download.
…eliminates the need to consider rate limits on Github url requests.
Use recommended Github request header. Cache get_asset_checksum, but only in unit tests. Create single checksum file and include digest for zip and pkg assets.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
8c3b17b to
261d411
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.
@mrclary, I tested this manually and have a few more suggestions/comments for you.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
f3c36f8 to
e692d11
Compare
ccordoba12
left a comment
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.
Looks good to me now, thanks @mrclary!
In the course of testing #24072, @ccordoba12 discovered the possibility that a previously downloaded update artifact may not match the current update artifact on Github. This is the result of using the completed download artifact size as the verification tool. This works fine to verify the download immediately upon download completion or if the Github artifact does not change. However, it will be more robust to use the checksum of the artifact to both verify the completed download and to verify an existing local artifact against the current Github artifact.
Spyder-checksums.txtasset. All 6.x release checksum assets are updated to reflect the new paradigm (unit tests will fail until this is completed).Spyder-checksums.txtasset is used to obtain the expected checksum for a downloaded asset. Fortunately, this does not need to be downloaded and read from file. A simple url request provides the contents of the file.get_github_releasesandget_asset_checksumare cached for unit tests. This removes the need to consider rate limit errors.Notes:
Spyder-checksums.txtfile can be used to verify one or more local assets from the command line as follows.updatemanagerunit tests rely on specific releases for testing and url requests for Github releases return a finite number of releases. This means that at some time in the near future, either the releases referenced in the tests will need to be updated or the number of releases returned by the url request will need to be increased. This issue existed prior to this PR.