Commit graph

234 commits

Author SHA1 Message Date
Kynan Ware
273fccd908 Check user and teams nil state instead of length 2025-11-10 11:09:14 -07:00
Kynan Ware
e154601f7d Ensure empty arrays for reviewers in PR API calls
Updated AddPullRequestReviews and RemovePullRequestReviews to send empty arrays instead of null values for reviewers and team_reviewers when no users or teams are specified, as required by the API.
2025-11-07 14:00:28 -07:00
Lucas Melin
6db1441eb6
Return only basic pull request info when reverting a PR
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-10-22 18:02:35 -04:00
Lucas Melin
b229402cab
Return nil when err is nil 2025-10-06 13:27:45 -04:00
Lucas Melin
023a639c8c
feat: include revert PR info in message output 2025-10-06 13:25:31 -04:00
Lucas Melin
9467d66b11
Undo autoformat changes 2025-10-06 13:25:31 -04:00
Lucas Melin
60b6a5eed5
feat: implement pr revert 2025-10-06 13:25:31 -04:00
Kynan Ware
66fae72872 Remove default empty slices in RemovePullRequestReviews
Eliminates unnecessary initialization of users and teams to empty slices in RemovePullRequestReviews. Also updates the request body struct to use 'omitempty' for reviewers and team_reviewers, ensuring empty fields are omitted from the JSON payload.
2025-10-01 16:12:06 -06:00
Kynan Ware
848faf8115 Refactor reviewer partitioning in PR edit command
Extracted logic for splitting reviewer identifiers into users and teams into a new helper function, partitionUsersAndTeams. Updated updatePullRequestReviews to use this function for both adding and removing reviewers, improving code clarity and maintainability. Also clarified comments regarding PR author handling.
2025-10-01 16:02:05 -06:00
Kynan Ware
57fce1dc3a Escape repo owner and name in PR reviewer API paths
Updated AddPullRequestReviews and RemovePullRequestReviews to use url.PathEscape for repo owner and name in API paths. This ensures correct handling of special characters in repository identifiers.
2025-10-01 15:55:24 -06:00
Kynan Ware
87468f40db Refactor PR reviewer editing to use REST API and optimize team fetch
Switches pull request reviewer add/remove operations from GraphQL to the REST API, enabling separate add and remove calls for reviewers and teams. Refactors reviewer editing logic to avoid fetching organization teams unless required for interactive editing, improving performance for non-interactive flows. Updates tests and supporting code to reflect the new reviewer management and metadata fetching behavior.
2025-09-30 10:45:44 -06:00
Kynan Ware
dd424d85fd Add agent task listing command and CAPI client
Introduces a new 'list' subcommand under agent-task for listing agent tasks. Implements a Copilot API client for fetching agent sessions and hydrating them with pull request data. Updates PullRequest and PRRepository types to support new fields. Adds dependencies for msgpack and tagparser.

Co-Authored-By: Babak K. Shandiz <babakks@github.com>
2025-08-28 22:00:35 -06:00
Babak K. Shandiz
00a86a105e
fix: remove AssignedActorsUsed field
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-01 11:11:28 +01:00
William Martin
793a7ff459 Fix pr edit when URL is provided 2025-06-02 15:07:55 +02:00
Kynan Ware
f559068106 feat(pr edit): fetch assigned actors 2025-05-15 09:33:36 -06:00
Azeem Sajid
9ed733fa5e
Add closingIssuesReferences JSON field to pr view (#10544)
* [gh pr view] Support `closingIssuesReferences` JSON field

* Support pagination

* Support pagination

* Fix typo

* Add more fields
2025-04-29 11:48:20 +01:00
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
William Martin
8a0d361bac Expose fullDatabaseId for PR json export 2024-07-23 13:23:10 +02:00
Babak K. Shandiz
feb5aa55b9
Add separate type for PullRequest.Mergeable field
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-07-16 15:28:27 +01:00
Babak K. Shandiz
78091c4aff
Fix query parameter name
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-09 20:42:46 +01:00
Babak K. Shandiz
cec2ced42f
Improve query variable names
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-07 00:19:30 +01:00
Babak K. Shandiz
acef17d6cb
Add ComparePullRequestBaseBranchWith function
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-06 23:57:20 +01:00
Babak K. Shandiz
7de10f0bdf
Add UpdatePullRequestBranch method
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-10 19:20:20 +01: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
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