Commit graph

16 commits

Author SHA1 Message Date
Tyler McGoffin
0bb92c5980
Separate partitioning from globbing in cmdutil/args package and consumers (#3)
* Separate partitioning from globbing in cmdutil/args package and consumers

In the previous commit, GlobPaths was overloaded, containing logic
specific to command use-cases. This commit removes that functionality from
GlobPaths and back into the commands that have the special use-cases.

To do this, I've introduced a new Partition util in cmdutil/args.go that
will separate a slice into two slices given a predicate. This functionality
is leveraged by both the special use-cases described above to separate the
command-specific syntax from the globable filepaths.

* Add test to validate that the order of '-' in gh gist create args doesn't matter
2025-03-04 07:05:23 +05:00
Azeem Sajid
f4b65b785e Add exclude callback function 2025-02-26 12:46:56 +05:00
Azeem Sajid
092eb7e962 Support globbing for all platforms 2025-02-22 12:16:42 +05:00
Tyler McGoffin
8748bb0b1a
Add testing to GlobWindowsPaths (#2) 2025-02-21 22:33:19 +05:00
Azeem Sajid
d9bfa606cc Fix gh gist create for multiple filenames and glob patterns 2025-02-11 12:56:32 +05:00
Azeem Sajid
161ad92b20 [gh release create/upload] Expand glob patterns on Windows 2025-02-09 21:58:15 +05: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
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +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ć
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ć
a00d927970 Add release download, upload files on create, upload retrying 2020-08-21 18:00:52 +02:00