Adding gh release download for .zip and .tar.gz#4489
Conversation
mislav
left a comment
There was a problem hiding this comment.
Thank you for working on this; this is shaping up great!
A general note about ZipballURL/TarballURL API endpoints: this might not be immediately apparent, but these APIs result in a "legacy" format of the zip/tgz archive when compared to the archives downloaded by using the "Source code" download links from the web interface. Ideally this would be consistent with the web, as I personally don't like the legacy archive format and find the non-legacy format way more useful. However, you don't need to address this in your PR; I'm asking other people at GitHub more knowledgeable about Releases as to what we could potentially do here.
lpessoa
left a comment
There was a problem hiding this comment.
Code review changes implemented. Added a little helper to httpmock to allow setting a Header value for the Responder's http.response (can be easilly converted to accept multiple headers).
Just a small question regarding the scenario where the content-disposition header is missing from the server (should not happen 😄 )
mislav
left a comment
There was a problem hiding this comment.
Looks great! Only minor bits remaining
mislav
left a comment
There was a problem hiding this comment.
Looks great!
I will hold off merging until we internally resolve the question of how do we access non-legacy zipball/tarball archives (see my previous review) using the public API.
|
@shiouen No movement from the platform side. It looks like we might be stuck with the currently available API that redirects to legacy tarball/zipball format. However, we can take control over the HTTP redirect and remove the |
Co-authored-by: Mislav Marohnić <mislav@github.com>
The `zipball_url` and `tarball_url` fields on the Release API payload always link to "legacy" archives that are of a different format than those one would get if they downloaded an archive from a Release using the web interface. The GitHub API does not seem to publish links to non-legacy archives. This adds a redirect hack to turn "legacy" Codeload URLs into non-legacy ones with the goal of ensuring the consistency of user experience when downloading archives.
Fixes #2167
Adding
gh release downloadsupport for fetching the default .zip or .tar.gz release files.The user will be able to require the files by simply adding the
--archivecommand line parameter.