Commit graph

19 commits

Author SHA1 Message Date
Raj Hawaldar
0d8c34bf59
Add --verify-tag to release edit command (#7646) 2023-07-07 14:23:39 +00:00
Sam Coe
35a24caed2
Standardize retry mechanism (#7027) 2023-03-02 23:06:30 +00:00
Mislav Marohnić
8cb312a620
Fix release assets upload retry logic
Enables up to 3 retries of uploading a single asset when encountering a network error or a HTTP 5xx error.

Bonus:
- simplifies ConcurrentUpload implementation
- support Go context cancellation
2022-12-14 21:25:09 +01:00
Mislav Marohnić
36ffbe18de
Improve looking up draft releases by tag name
This changes the FetchRelease implementation to look up draft releases directly using by its pending tag name, as opposed to resorting to the Releases list API which is backed by Elastic Search and thus suffers replication lag after the creation of a draft release.

Bonus: all release lookup functions now accept a context for cancellation.
2022-12-14 21:24:08 +01:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Johannes Plunien
186e5ccfb2
Add release edit command (#5422)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-13 14:51:49 +00:00
Mislav Marohnić
83a08aa3ba Remove unnecessary pointers to Go maps 2021-10-25 17:20:12 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
c667a0bc49 Fix fetching draft releases from GitHub Actions
When using GITHUB_TOKEN in Actions, the permissions on a repository are
null and therefore we can't check whether the viewer has push access or
not. The solution is to unconditionally check for draft releases instead
of trying to be smart about it. Draft releases are going to be on top,
so we don't have to paginate through all releases in a repository.
2021-05-18 19:44:29 +02:00
Mislav Marohnić
4425365004 Add release view --json support 2021-05-18 19:40:28 +02:00
Mislav Marohnić
40da8f9c69 Allow retrying HTTP/2 uploads for release assets
The `Request.GetBody` func allows the retry mechanism to reopen the file
that's being uploaded as the request body in case the body of the
previous request has already started to be read.

Hopefully fixes the error:

    http2: Transport: cannot retry err [stream error: stream ID 1; REFUSED_STREAM]
    after Request.Body was written; define Request.GetBody to avoid this error

Ref. d523dce5a7/http2/transport.go (L554)
2021-03-17 15:55:22 +01:00
Morten Linderud
c9b9478b5c
shared/upload: Add .tar format
Currently the mimecap package is an requirement to pass the test suite,
as we need /etc/mime.types to recognize the tar extension. A better idea
is to inline all of the basic test cases for the test suite.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-09-17 17:55:25 +02:00
Mislav Marohnić
1ad9b0b14e Have FindDraftRelease be truer to its name 2020-09-03 15:35:07 +02:00
Mislav Marohnić
151a7340a6 Fix .zip and .js overrides for Windows 2020-09-03 11:44:54 +02:00
Mislav Marohnić
02a057a709 Try fixing Windows tests 2020-09-02 22:11:46 +02:00
Mislav Marohnić
0f42c7af4d Add tests for release create, delete, download, view 2020-09-01 18:56:30 +02:00
Mislav Marohnić
d0d9cc2f9b View latest release if no tag provided 2020-09-01 14:16:59 +02:00
Mislav Marohnić
d43d5e0bc9 Add release delete 2020-08-28 17:41:00 +02:00
Mislav Marohnić
a00d927970 Add release download, upload files on create, upload retrying 2020-08-21 18:00:52 +02:00