Commit graph

56 commits

Author SHA1 Message Date
2003Aditya
15f01d43a4 fix: --interval flags docs in gh pr checks 2025-10-30 20:06:45 +00:00
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
Andy Feller
c9ecf310b3 Error for mutually exclusive json and watch flags
Closes #10013

This commit enhances `gh pr checks` to exit with an error when mutually exclusive `--json` and `--watch` flags are used.  Users are encouraged to either 1) retrieve information about the checks via `--json` or 2) watch and wait on PR checks that are being updated.
2024-12-05 10:23:13 -05:00
Andy Feller
779a1203b6
Merge pull request #9471 from heaths/issue9470
Always print URL scheme to stdout
2024-08-21 14:46:52 -04:00
Arun
800f99d9fa Describe bucket and state JSON fields in pr checks command
While the `state` field corresponds 1:1 with different GitHub Actions
states, the `bucket` field is an abstraction of the CLI that lacked
documentation. This both adds documentation about the existence of the
`bucket` field and enumerates the possible values.
2024-08-16 15:26:27 -07:00
Prabhat Kumar Sahu
1886fb46ab
Fix pr checks exit code (#9452)
* Enhance  with exit code documentation

* Add new error message for PR check

* Refine gh pr checks: Add exit code 8

* Update EXIT CODES section format in man page generation
2024-08-16 14:30:11 -07:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
Andy Feller
ac5510362b Implement ExportData to filter json fields
In order to filter json fields, the `ExportData` interface needed to be implemented with logic that iterated on the selected fields.
2024-05-14 09:49:07 -04:00
nobe4
8a1995c98d
fix: rename fields list 2024-05-14 08:06:54 +02:00
nobe4
178fc2e51e
feat: add json output for PR checks 2024-05-14 07:57:38 +02:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02:00
Raj Hawaldar
decbbd2165
Show cancelled checks (#7960) 2023-09-24 18:27:01 +02:00
Raj Hawaldar
9fc571499f
pr checks return distinct exit code for PENDING checks (#7866) 2023-08-25 10:30:45 -07:00
Sam Coe
ad283cff72
Fix pr checks command for GHES versions older than 3.9 (#7725) 2023-07-19 09:25:07 -07:00
Johannes Grumböck
8a7d80864b
Add check description to pr checks output (#7451) 2023-07-06 14:38:44 +09:00
Sam Coe
d46f47e430
Don't deduplicate checks that stem from different events (#7618) 2023-06-27 09:12:52 +09:00
William Martin
dad5f25748 Use go enums for status and check status graphql enums 2023-05-23 17:22:56 +02:00
Benjamin Levesque
185ebbe69d
Add a --fail-fast option to pr checks --watch (#7203) 2023-03-27 01:36:30 +00:00
Mislav Marohnić
3fe5026d39
Migrate to tableprinter from go-gh (#6346) 2022-10-17 15:15:39 +02:00
Natthakit Susanthitanon
4c3b123db6
Return empty error before starting a pager program (#6419)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-10-13 19:08:13 +02:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
ffalor
e5b37ee661
add --required flag to gh pr checks (#5648) 2022-09-10 08:00:29 +00:00
Mislav Marohnić
436d9ef859
Fix "missing method Fd" crash on Windows (#6200)
This ensures that `IOStreams.Out` always keeps the original `Fd()` value even if it's wrapped as a Colorable stream for Windows in cases when enabling virtual terminal processing has failed.
2022-09-06 17:29:06 +02:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
Mislav Marohnić
02881b4783
Correctly determine run started/elapsed timestamps (#5945)
This switches `run list` and `run view` commands to measure how long ago did the run happen by using `run_started_at`, which is the timestamp of the latest run in a series, instead of `created_at`, which is the timestamp of the first run. This change also fixes accurate duration for in-progress runs.
2022-07-21 17:30:46 +02:00
vilmibm
1bcf97b914 Merge remote-tracking branch 'origin' into issue5679 2022-07-12 15:40:29 -05:00
Mislav Marohnić
dea1af1227
pr checks: avoid deduplicating same-named checks under different workflows (#5919) 2022-07-12 09:48:39 +00:00
Heath Stewart
be4b392530 Use alternate screen buffer for watching runs
Resolves #5679
2022-05-23 22:18:11 -07:00
Heath Stewart
3574240fa7
Always clear screen when watching PR checks (#5678) 2022-05-23 08:38:50 +02:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
a657fa808a pr checks: fix error message when no checks were found
Fixes the error message:

    no checks reported on the '' branch

Now the correct branch name is reported.
2022-03-08 16:44:41 +01:00
endorama
825328031f
Add watch functionality to pr checks command (#4519)
* pr-checks: extract webMode

* pr-checks: extract checks information collection

* pr-checks: extract output utilities

* pr-checks: implement watch flag

* pr-checks: remove SIGINT interceptor

* pr-checks: exit with error if some task has failed

* update flags help text

* update default interval to 10s

* move interval flag parse to RunE

* refactor checksRunWatchMode to use infinite loop

* Refactor printTable function

* Refactor collect function

* Set up checksRun to use new refactored functions and simplify logic a bit

* Add tests

* Always set interval in opts

* use Duration flag

* Revert back to using int flag for consistency with run watch

* Use run watch screen clearing mechanism

* Re-add pager support

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-02-08 08:33: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
hirasawayuki
b0fd9c6f04 Fix duplicates check results returned by gh pr checks 2022-01-21 00:02:42 +09:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04: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
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
bchadwic
1f2ab7fbe4 pr and run check symbols revision 2021-08-05 02:13:55 -07:00
Mislav Marohnić
e758f30073 Fix preloading of pr reviews, checks, and issue/pr comments 2021-05-18 17:13:27 +02:00
Mislav Marohnić
c50d390cf5 Fix tests 2021-05-07 22:09:58 +02:00
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
Cristian Dominguez
8a0d5b0e43 Add note about current branch detection 2021-04-13 12:30:07 -03:00
Mislav Marohnić
05c7c2bd1a Treat unrecognized PR Checks statuses as "pending"
Previously, unrecognized Checks statuses would crash the program. For
the sake of supporting the "WAITING" status and for
forward-compatibility, this treats any unrecognized status as "pending".
2021-03-31 18:21:45 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Mislav Marohnić
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Mislav Marohnić
c63acf6728 Migrate to new cmd stubber in misc. tests 2021-01-18 22:42:01 +01:00
Cristian Dominguez
ce151420f3 Migrate legacy tests 2021-01-11 21:07:19 -03:00
Jakub Warczarek
b205faa941
Implement --web for gh pr checks (#2146) 2020-11-17 12:27:07 -06:00
Nate Smith
24d863eccc
Merge pull request #2316 from cli/colors-1624
migrate off of utils color functions
2020-11-03 12:49:02 -06:00