Commit graph

103 commits

Author SHA1 Message Date
Christian Gregg
c5dbf20ed4
Alias list as ls for all commands (#5214)
I always get tripped up whenever trying to list my codespaces, adding
`ls` as an alias to `list` feels natural enough.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-02-17 13:53:42 +01:00
Mislav Marohnić
4a3ef50d2d
Standardize pager output across commands (#5141)
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view

Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
2022-02-01 08:36:51 +01:00
yasudanaoya
b77c37df0f
feat: add job id, into run view suggest command (#5105)
* feat: add job id, into run view suggest command

* fix: dry

* fix: run id to job id

* Change "a" to "the" when referencing a single job

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-27 08:19:37 +00:00
Anton Baklanov
e28fa3c112
Add branch and actor filters to run list (#4100)
* Add branch and actor filters to `run list`

* Simplify what FilterOptions can do

* Check not only limit in TestNewCmdList

* Verify that branch/actor params are parsed properly

* Verify that API requests have proper query parameters

* Change flag name from actor to user

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-26 08:14:56 +02:00
Mislav Marohnić
44775f87c8 Add nolint directives to allow-list current lint violations 2022-01-14 19:52:52 +01:00
Mislav Marohnić
e43cb2b880 Port more legacy stubs to the new ask stubber 2022-01-14 19:34:15 +01:00
Cristian Dominguez
ddaef8baa4
Add --json export flag for workflow runs (#3869)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-17 15:55:45 +00:00
Benjamin Chadwick
3ea69c8c9b
pr checks: count "cancelled" jobs as failing instead of neutral (#4850) 2021-12-16 12:01:53 +01:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
nate smith
a4015b7f09 prompt tests 2021-10-15 15:08:53 -05:00
nate smith
f381a804fc fix tests 2021-10-15 14:57:20 -05:00
nate smith
18975e61d1 fix imports 2021-10-15 14:31:29 -05:00
nate smith
b81eda0c46 newline 2021-10-15 14:28:28 -05:00
nate smith
f329ebd7ca add interactive prompt for in progress runs 2021-10-15 14:19:16 -05:00
nate smith
4a01e6b702 Merge remote-tracking branch 'origin/trunk' into gh-run-cancel 2021-10-15 14:12:53 -05:00
Nate Smith
425bc64859
Merge pull request #4090 from bchadwic/pr-checks
Revised pending and skipped symbols for pr checks / run commands
2021-09-27 09:25:21 -07:00
Nate Smith
49652cdefa
Update pkg/cmd/run/cancel/cancel.go
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2021-09-02 12:57:50 -05:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
88af63d36f
Re-enable label colors for issue list (#4106)
* Re-enable label colors for issue list
* Drop parentheses wrapping issue labels
* Support ANSI escape codes in TablePrinter cells
* Switch to a Truncate implementation that correctly measures ANSI escape codes
* Only output RGB color if terminal has truecolor capabilities
* Enable `ENABLE_VIRTUAL_TERMINAL_PROCESSING` on Windows - fixes wrapping issues with full lines and allows truecolor rendering

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 19:55:12 +02:00
bchadwic
1f2ab7fbe4 pr and run check symbols revision 2021-08-05 02:13:55 -07:00
Mislav Marohnić
13037226c2 Add test for gh run watch --exit-status with completed runs 2021-07-12 16:58:45 +02:00
Des Preston
1980cc83b9 return SilentError if completed run failed
If `gh run watch ${ID} --exit-status` is run and "ID" is the ID of a
completed job that failed, return a SilentError. This ensures that the
program returns a non-zero code.

Fixes #3962
2021-07-09 11:54:58 -04:00
Yuki Osaki
e804053777 change unit 32 to unit 64 2021-06-25 14:32:45 +09:00
Cristian Dominguez
6ba70d4a1e Add run cancel command 2021-06-14 08:57:06 -03:00
Param Patidar
20f915d5ba escape metacharacters in job name 2021-06-02 17:20:31 +00:00
Gowtham Munukutla
9c614247a6 lint fix 2021-05-21 09:36:23 +05:30
Gowtham Munukutla
605f785c70 use fuzzy abbr to display age 2021-05-21 09:33:55 +05:30
Gowtham Munukutla
bc4be19319 lint repair 2021-05-20 12:28:26 +05:30
Gowtham Munukutla
31854f0b25 add extra age column and repair tests 2021-05-20 12:24:47 +05:30
Gowtham Munukutla
6b0a07f22e Merge branch 'trunk' of https://github.com/cli/cli into feature/action-headers 2021-05-20 10:59:14 +05:30
Gowtham Munukutla
97f80740aa remove extra quotes 2021-05-07 11:17:23 +05:30
Gowtham Munukutla
0437a69967 add column headers and age column in listing runs 2021-05-04 10:51:07 +05:30
Mislav Marohnić
9bdc63c4ca Eliminate API overfetching in pr commands
This completely rewrites the PR lookup mechanism so that the caller
must specify the GraphQL fields to query for each PR. Additionally, this
fixes some export problems with `pr view --json`.

Features:

- Each pr command now gets assigned a concept of a Finder. This makes it
  easier to stub the PR in tests without having to stub the underlying
  HTTP calls or git invocations.

- `pr view --web` is much faster since it only fetches the "url" field.

- `pr diff 123` now skips a whole API call where a whole PR was
  unnecessarily preloaded just to access its diff in a subsequent call.

- PullRequestGraphQL query builder is now used to construct queries.

- A bunch of individual commands are now freed of having to know about
  concepts such as BaseRepo, Branch, Config, or Remotes.
2021-04-30 20:34:36 +02:00
vilmibm
00da7f9fc1 handle 404 for annotations 2021-04-26 16:55:08 -05:00
Sam
aea6163a83
Merge pull request #3445 from adamslc/log_fix
Fix `run view --log` when steps have slashes
2021-04-20 08:13:26 -07:00
Sam Coe
75227f44d1
linter 2021-04-20 08:05:19 -07:00
Mislav Marohnić
ae99ad4fbe
Merge pull request #3461 from cli/jobs-url-enterprise
Fix requesting REST sub-resources on GHE
2021-04-20 11:31:23 +02:00
Sam Coe
c77c7ec7c9
Match logs based on job name and step number 2021-04-19 12:21:34 -07:00
Luke Adams
58d3aa878d Extract filename creation logic to seperate function 2021-04-19 10:59:36 -06:00
Mislav Marohnić
ac348b0dec Fix requesting REST sub-resources on GHE
GitHub REST resources typically return full URLs to fetch related
resources at. We used to parse those URLs to find just the path portion
and pass that in to the `REST()` function, which only accepted paths. By
doing so, we are essential de-constructing a URL just to re-assemble it
again. While re-assembling it for Enterprise, though, we would
accidentally inject an extra `api/v3/` prefix where one was not needed.

The solution is just to use raw URLs as reported by the REST API with
no modifications. This extends the `REST()` function to accept full URLs
in addition to just paths to resources.
2021-04-19 12:41:09 +02:00
Luke Adams
0822e6b4ed Fix run view --log when steps have slashes 2021-04-16 23:37:24 -06:00
vilmibm
8458c5f95d use int64 explicitly in Actions support 2021-04-15 13:32:09 -05:00
vilmibm
a2f4f725af create cache dir 2021-04-15 11:15:03 -05:00
vilmibm
e10a3f164f minor usage improvements 2021-04-13 22:43:02 -05:00
vilmibm
a85ef9273f bump run list limit 2021-04-13 22:42:38 -05:00
vilmibm
04844256dd annotation fixes 2021-04-13 22:10:32 -05:00
vilmibm
cd8ec47163 unhide actions commands 2021-04-13 22:08:06 -05:00
vilmibm
efe7aa1f78 fix small bug with startup_failure conclusion 2021-04-13 22:03:59 -05:00
Mislav Marohnić
f8c7fd1d28 Fix extracting workflow artifact to a relative path
To prevent zipslip, we verify that each extracted file would fall
strictly under the prefix of the path to extract to. However, this
yielded a false positive when extracting to `.`, which is the default
for downloading a single archive.
2021-04-13 19:15:14 +02:00
Nate Smith
a579b00dac
Merge pull request #3408 from cli/fix-run-selection
Make run selection unique
2021-04-12 18:44:07 -05:00