Commit graph

211 commits

Author SHA1 Message Date
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
e2dc66baea Reorder Check and Status States enums variants alphabetically 2023-05-23 17:36:20 +02:00
William Martin
dad5f25748 Use go enums for status and check status graphql enums 2023-05-23 17:22:56 +02:00
William Martin
04ecac9a6f Rework state parsing for CheckRuns and StatusContexts 2023-05-23 16:51:08 +02:00
William Martin
90e680f21a Split CheckRunState and StatusState parsing 2023-05-23 15:59:12 +02:00
William Martin
9d81c1134d Implement parsing and counting of PR checks using new GQL fields 2023-05-17 18:45:25 +02:00
William Martin
bfb5e8f1d6 Avoid using named return in PR ChecksStatus
See: https://dave.cheney.net/practical-go/presentations/gophercon-israel.html#_avoid_named_return_values
2023-05-16 19:53:35 +02:00
William Martin
c4bb344ddd Add some comments to PR ChecksStatus 2023-05-16 19:53:35 +02:00
Martijn Pieters
bf3ffba8ef
Add PR auto-merge status info to PR queries (#7384) 2023-05-04 09:36:21 +12:00
Ilya Yatsishin
179e9c256d
Add projectsV2 support to issue create, issue edit, pr create, and pr edit (#6735)
Co-authored-by: pshevche <pavel.shevchenko.95@gmail.com>
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2023-01-19 22:13:09 +00:00
Seito Tanaka
e523d50176
Add support for editing last issue/pr comment (#6384) 2022-10-18 08:10:12 +00:00
Nate Smith
99e76a709f
Merge pull request #6292 from lpessoa/lp-checks
feat: adding checks at GH PR view
2022-10-06 14:27:38 -05:00
Ariel Deitcher
49f6b20d3d
Add undo option to pr ready command to convert PR to draft (#5995) 2022-09-21 19:00:13 +00:00
lpessoa
e8767b9706
feat: adding checks at GH PR view
Fixes #6117

Adding checks to PR view as a new line along with changes information.
Isolated 'status' display logic into a shared method in order to reuse it in 'view'.
Updated existing 'view' tests.

TODO: add new tests for PRs with checks.
2022-09-16 13:56:10 -03:00
Mislav Marohnić
cfb7e66d2b
Merge pull request #6260 from cli/fix-branch-delete
Fix deleting remote branches with `#` in their name
2022-09-15 11:06:04 +02:00
Mislav Marohnić
1e295607d7 Fix deleting remote branches with # in their name 2022-09-14 16:19:33 +02:00
ffalor
e5b37ee661
add --required flag to gh pr checks (#5648) 2022-09-10 08:00:29 +00:00
Mislav Marohnić
dea1af1227
pr checks: avoid deduplicating same-named checks under different workflows (#5919) 2022-07-12 09:48:39 +00:00
Sam Coe
074ed50b8a
Integrate go-gh API package (#5614) 2022-06-23 04:05:31 +01:00
ffalor
2388f51927
Add --match-head-commit field to gh pr merge (#5692)
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-06-20 17:18:00 +02:00
Ariel Deitcher
53a8737c87 pr merge: add support for Merge Queue
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-08 12:24:36 +02:00
Sam Coe
539b150833
Extract feature detection package (#5494) 2022-05-17 19:07:44 +00:00
Nate Smith
3a088e4df5
Merge pull request #5069 from hirasawayuki/fix-pr-checks-cmd
Fix duplicates check results returned by `gh pr checks`
2022-01-26 16:46:32 -06:00
Des Preston
2e07d0f32c
pr status: show number of approvals (#4240)
If the base branch has no minimum approval requirements, show "N Approved"
reviews. Otherwise, show "N/X Approved".

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-01-21 15:58:15 +00:00
hirasawayuki
b0fd9c6f04 Fix duplicates check results returned by gh pr checks 2022-01-21 00:02:42 +09:00
Mislav Marohnić
c8d5a6be02 Accept pull requests in issue edit argument 2021-11-23 20:39:19 +01:00
Mislav Marohnić
f99a149eb2 Improve issue reopen re: overfetching, handling PRs
- `issue reopen` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue reopen` now accepts either issue or pull number as argument.
2021-11-23 19:39:40 +01:00
Mislav Marohnić
07cad386a5 Improve issue close re: overfetching, handling PRs
- `issue close` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue close` now accepts either issue or pull number as argument.
2021-11-23 19:38:55 +01:00
Mislav Marohnić
e4c8aa3b2b Add tests for pr diff --patch 2021-10-08 13:53:19 +02:00
Adarsh K Kumar
e0897fd8e8 #2720 | Add patch flag to pull-request diff command 2021-10-07 23:09:21 +05:30
Mislav Marohnić
619333adb6 Avoid using error values to pass information about the search cap 2021-09-06 16:09:18 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Sam Coe
e5b099b1dd
Fix bug where branchProtectionRule doesn't exist in enterprise 2.22 2021-06-30 09:47:30 -07:00
Mislav Marohnić
a4d1ce7709 Fix fetching information about the PR potentially being behind base branch 2021-06-10 15:51:27 +02:00
Mislav Marohnić
885e94786a Shorten GraphQL query for pr status --json 2021-06-10 15:37:58 +02:00
Mislav Marohnić
f5cd33b4bf Fix showing Checks in pr status
This was a regression in how `statusCheckRollup` is queried and stored.
As a result, `gh pr status` did not include rendered information about
checks related to each pull request. This switches the query builder to
`PullRequestGraphQL()` to eliminate the outdated query.
2021-06-08 20:22:33 +02:00
Mislav Marohnić
1a980e768c Fix how teams are displayed in requested reviewers
1. The `--json` export now only renders the `login` field for User types
   and `name` and `slug` fields for Team types.
2. The `pr view` command now renders team reviewers in the format of
   `ORG/SLUG` instead of the team name. This is so that the same value
    can be used in the `pr create -r` flag.
2021-05-28 14:32:31 +02:00
Sam Coe
761fa94831
Small nitpicky polish 2021-05-27 08:47:41 -04:00
mercimat
a612f06dee fix pr review requests for teams 2021-05-24 17:00:25 +02:00
Mislav Marohnić
42155c7d2d Export more IDs in issue/pr JSON payload 2021-05-18 18:19:28 +02:00
Mislav Marohnić
e758f30073 Fix preloading of pr reviews, checks, and issue/pr comments 2021-05-18 17:13:27 +02:00
Mislav Marohnić
51f7cbdfde 💅 cleanup and tests for PR finder 2021-05-18 09:59:05 +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
Mislav Marohnić
47b7987772
Merge pull request #3402 from cristiand391/remove-unused-embedded-struct
Remove unused embedded struct
2021-04-20 18:48:19 +02:00
Nate Smith
d09896468d
Merge pull request #3351 from cristiand391/fix-pr-reopen
Fix detecting PR status when passing branch as arg
2021-04-20 11:41:16 -05:00
Mislav Marohnić
e63904bacd Expose more fields for PR JSON export 2021-04-14 17:28:27 +02:00
Mislav Marohnić
3f22e3b353 Add pr status --json support 2021-04-13 21:12:30 +02:00
Mislav Marohnić
e158fac1a9 Restructure PullRequestStatus function 2021-04-13 20:54:09 +02:00