Commit graph

45 commits

Author SHA1 Message Date
Dalius Dobravolskas
9414930b5d
Adding option to return baseRefOid in pr view
You need to know exact `baseRefOid` so you could show correct diff.
`baseRefName` is not enough sometimes because branch from which PR was
forked might have changes already.

Example usage:
```
gh pr view --json headRefName,headRefOid,number,baseRefName,baseRefOid,reviewDecision
```
2024-11-19 23:50:45 +02:00
tsukasa inoue
b33e2f92a7
feat: add ArchivedAt field to Repository struct 2024-10-19 11:11:24 +09:00
Yukai Chou
d7b8ecf33d Unify use of tab indent in non-test source files
Found with
    rg '(^ | \t|\t )' -g '*.go' -g '!*_test.go'

Mixed indent exceptions:
- wrapped long list items with extra 2-space indent
- code snippets using space indent
- commented code lines having "\t*// \t+" prefix
2024-08-03 00:35:30 +08:00
William Martin
8a0d361bac Expose fullDatabaseId for PR json export 2024-07-23 13:23:10 +02:00
William Martin
172a9de2fe Ensure PR does not panic when stateReason is requested 2024-07-11 16:30:35 +02:00
nobe4
140edf7327
feat: add support for stateReason in gh pr view (#9080) 2024-05-21 19:54:56 +02:00
Andy Feller
d611ed4bf0 Add missing title field for projectv2 2024-04-29 07:42:53 -04:00
Babak K. Shandiz
985dee0e05
Match query fields with ProjectV2 type
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-04-26 22:59:01 +01:00
Babak K. Shandiz
9e1f9d6101
Include projectsV2 in GraphQL query
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-26 21:06:29 +01:00
Matthew Ruggio
8a868779a6 Add status column for each projectItem object.
This should be comparable to classic project's notion of column, although not _exactly_ the same since new projects are much more configurable.
2023-10-16 21:06:30 -05: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
75e35e2dde Use pseudo field for statusCheckRollupWithCountByState 2023-05-22 17:28:15 +02:00
William Martin
ebb7d26f3a Implement initial spike for detecting and using counts by state 2023-05-17 19:59:03 +02:00
Martijn Pieters
bf3ffba8ef
Add PR auto-merge status info to PR queries (#7384) 2023-05-04 09:36:21 +12:00
Yeikel
9b75e274e4
feat: add visibility field (#7337) 2023-04-25 12:58:01 +00:00
Sam Coe
08a1231178
Allow retrieving projectItems in JSON and allow adding/removing user owned projects (#7007) 2023-02-15 22:14:59 +00:00
azu
700bda3ad8
Add gh repo edit --enable-discussions (#6903)
* Add gh repo edit --enable-discussions
* Add hasDiscussionsEnabled to JSON fields for repos

Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-01-24 18:13:05 +01: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
Mislav Marohnić
8b3e5c1554
Fix mergedBy JSON export for PRs 2023-01-18 21:41:07 +01:00
Mislav Marohnić
8d82a96349
Fix fetching issue/PR comments
The "Author" struct was too overloaded in different types of queries that treat struct fields in incompatible ways. This change defines a simpler CommentAuthor struct for use in comments until we can figure out how to query `... on User` information for comments too.
2022-12-23 17:14:06 +01:00
vilmibm
84a15d0943 Merge remote-tracking branch 'origin/trunk' into add-more-author-infomation 2022-12-07 11:54:55 -08:00
Mislav Marohnić
40cfa90222
Expose commit OID in PR reviews JSON export 2022-11-21 17:25:44 +01:00
Robin Neatherway
0197b51f72
Replace spaces with tabs in mixed whitespace string (#6456)
This makes the indentation of the query consistent no matter your
local tab size rendering.
2022-10-18 11:08:47 +00:00
Seito Tanaka
e523d50176
Add support for editing last issue/pr comment (#6384) 2022-10-18 08:10:12 +00:00
Natthakit Susanthitanon
bb25202054
Add headRefOid to PullRequestFields 2022-10-07 16:16:15 +07:00
Sam Coe
e14d14cef2
Add support for issue state reason (#6245) 2022-09-14 12:39:15 +04:00
ffalor
e5b37ee661
add --required flag to gh pr checks (#5648) 2022-09-10 08:00:29 +00:00
ffalor
665e4e3446
Add new commands issue pin and issue unpin (#5597) 2022-08-31 10:16:45 +00:00
Mislav Marohnić
dea1af1227
pr checks: avoid deduplicating same-named checks under different workflows (#5919) 2022-07-12 09:48:39 +00: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
86566d8187 Add author information in pr list JSON output 2022-01-16 21:22:31 +09:00
Mislav Marohnić
0e3c3bb4a4
pr view: ensure that PR reviews are always rendered in --comments mode (#4848)
The GraphQL query for review didn't use to request the `TotalCount`
field, but that field was checked before rendering the conversation
thread in `pr view --comments`. This fixes rendering the conversation
thread when a PR only has reviews but no ordinary comments.
2021-12-03 18:07:27 +01:00
Mislav Marohnić
34fc5fb75c Improve issue view re: overfetching, PR support
- Supports passing a PR as argument, not just issues
- Makes it non-fatal when project cards were not able to load
- Cleans up legacy method for fetching issues
2021-11-24 18:49:36 +01:00
Mislav Marohnić
1eb790cacd Improve issue comment re: overfetching, handling PRs
- `issue comment` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue comment` now accepts either issue or pull number as argument.
2021-11-23 16:40:14 +01:00
Mislav Marohnić
a4d1ce7709 Fix fetching information about the PR potentially being behind base branch 2021-06-10 15:51:27 +02:00
mercimat
a612f06dee fix pr review requests for teams 2021-05-24 17:00:25 +02:00
Mislav Marohnić
6bec7a956a Fix pr merge on GHE < 3.0
This avoids loading authorship information for git commits, since it
relies on a GraphQL API that wasn't available before GHE v3.0. The
authorship information wasn't necessary for the merge operation anyway;
just loading the last commit OID was.
2021-05-21 17:35:41 +02:00
Mislav Marohnić
1440fd81a1 Fix broken GraphQL queries due to editing Author struct 2021-05-18 18:35:34 +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ć
02a2ed2f73 Add repo view --json export functionality 2021-05-12 17:05:15 +02:00
Mislav Marohnić
e63904bacd Expose more fields for PR JSON export 2021-04-14 17:28:27 +02:00
Mislav Marohnić
abe452bb19 Add --json export flag for issues and pull requests
The `--json` flag accepts a list of GraphQL fields to query for and
output in JSON format. To get the list of available flags, run the
command with a blank value for `--json`. Additional `--jq` and
`--template` flags are available just like in `gh api`.
2021-04-13 20:29:31 +02:00