Commit graph

736 commits

Author SHA1 Message Date
Kynan Ware
7ff84cff2e
Merge pull request #11797 from cli/github-cli-epic-990
`gh agent-task` commandset
2025-09-23 09:45:59 -06:00
Babak K. Shandiz
1e36e9f1e3
refactor(agent-task/capi): hydrate user data
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:11 +01: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
minxinyi
21b08bdd20
refactor: use slices.Equal to simplify code (#11364)
Signed-off-by: minxinyi <minxinyi6@outlook.com>
2025-08-26 15:29:19 -06:00
Andy Feller
72f5fbbec0 Base changes for PR project items 2025-08-12 20:59:50 -04:00
Andy Feller
7851c9c664 Update gh issue view to show v2 projects
These changes enhance the existing `gh issue view` experience by listing v2 projects in interactive and non-interactive forms.

Additionally, the tests have been enhanced to use a more standard `httpStubs` approach from other tests.
2025-08-12 16:18:45 -04:00
Kynan Ware
addee16531 Refactor and improve RepoMetadata teams test
Renamed the test to clarify its purpose and added an explicit exclusion for the OrganizationTeamList GraphQL query to ensure teams are only fetched when specified. This improves test accuracy and readability.
2025-07-23 09:59:20 -06:00
Kynan Ware
e5feda353f Refactor error assertion in Test_RepoMetadataTeams
Replaces manual error check with require.NoError for consistency and improved readability in the test.
2025-07-22 11:06:50 -06:00
Kynan Ware
449920b40f Add TeamReviewers flag to RepoMetadataInput
Introduces a TeamReviewers boolean to RepoMetadataInput to control whether team reviewers are fetched. Updates RepoMetadata logic to only fetch teams if both Reviewers and TeamReviewers are true. Adds tests to verify correct behavior when TeamReviewers is false.
2025-07-22 10:47:24 -06:00
Andy Feller
260519dc69
Merge pull request #11279 from cli/andyfeller/issue-create-assign-copilot
Assign Copilot during `gh issue create`
2025-07-16 17:01:32 -04:00
Andy Feller
5cf3d3b9a5 Use constant for Copilot name
Based on PR feedback from @bagtoad, this commit creates a new constant for the Copilot bot name, which is used in the assignee / reviewer selection as well as replacing `@copilot` when going to GitHub.com UI
2025-07-16 15:06:43 -04:00
Andy Feller
a8053d19a9 Resolve issue and PR metadata consistently
This commit refactors how `gh issue create` and `gh pr create` retrieve information needed to resolve metadata to be more in line with the approach used in `gh issue edit` and `gh pr edit`.

Previously, both commands used `prshared.fillMetadata(...)` function to retrieve assignees, reviewers, labels, and teams outside of `api.RepoMetadata(..)`.  Now, these commands will consistently use the same logic and data for resolving metadata.
2025-07-11 10:21:17 -04:00
Andy Feller
49821b20f9 Add non-TTY issue create copilot test, todos 2025-07-08 15:19:09 -04: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
ee3db50e43 Avoid requesting PR reviewer twice 2025-06-11 15:54:16 +02:00
William Martin
793a7ff459 Fix pr edit when URL is provided 2025-06-02 15:07:55 +02:00
Kynan Ware
0788a01517 refactor(api): inline struct definitions in RepoAssignableActors 2025-05-16 15:17:39 -06:00
Kynan Ware
e0f3f0f2fd refactor(api): change CopilotActorLogin to constant 2025-05-16 14:57:49 -06:00
Kynan Ware
a28e2d8784 refactor(api): use constant for Copilot login 2025-05-16 12:28:46 -06:00
Kynan Ware
475163a126
Merge pull request #10990 from cli/kw/gh-cli-916-special-actor-assignee-names
`issue edit`, `pr edit`: handle display names in interactive assignee editing
2025-05-16 10:16:08 -06:00
Kynan Ware
8bd77c0a95 fix(pr edit): clarify error messages for assignee actors and users 2025-05-15 14:01:10 -06:00
Kynan Ware
981da86701 doc(pr edit): condense comment for reviewer/user filtering 2025-05-15 13:47:51 -06:00
Kynan Ware
51b1e6cd6f
Merge branch 'kw/gh-cli-909-911-assign-actors-to-prs' into kw/gh-cli-916-special-actor-assignee-names 2025-05-15 11:27:14 -06:00
Kynan Ware
9a5ea87d75 fix(issues): fix non-interactive assignee matching to logins&IDs 2025-05-15 09:56:35 -06:00
Kynan Ware
d72018d312 feat(pr edit): fetch assignable actors 2025-05-15 09:33:36 -06:00
Kynan Ware
f559068106 feat(pr edit): fetch assigned actors 2025-05-15 09:33:36 -06:00
Kynan Ware
0db7ae872f refactor(api): remove needless parenthesis
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-05-15 09:33:36 -06:00
Kynan Ware
eace1e889a feat(editable): update assigned actors to use display names
- Refactored AssignedActors to return display names instead of logins.
- Updated related functions to ensure consistency in display names.
- Enhanced comments for clarity on display name logic and actor types.
2025-05-14 20:26:53 -06:00
Kynan Ware
d4832ba015 feat(pr edit): fetch assignable actors 2025-05-14 11:52:02 -06:00
Kynan Ware
71f22d8843 feat(pr edit): fetch assigned actors 2025-05-14 11:52:02 -06:00
Kynan Ware
712eeabd4a doc(api): remove needless comment 2025-05-14 08:55:55 -06:00
Kynan Ware
dfd600713f refactor(api): rename assignable user types and methods 2025-05-14 08:53:47 -06:00
Kynan Ware
1e5c3c7426 fix(issue edit): revert rename of ActorAssignees 2025-05-13 13:02:20 -06:00
Kynan Ware
261297f0a2 refactor(issue edit): add assignedActors to lookupFields 2025-05-13 07:28:42 -06:00
Kynan Ware
3bed77836a refactor(issue edit): rename loop variable for clarity 2025-05-13 07:11:24 -06:00
Kynan Ware
35792827ad refactor(issue edit): rename AssignedActors to ActorAssignees 2025-05-13 07:09:04 -06:00
Kynan Ware
cff2fa71e2 doc(repo queries): clarify reviewer actor fetching logic 2025-05-12 11:49:44 -06:00
Kynan Ware
29241cb7a5 refactor(issue edit): improve actor type handling
This improves actor type handling while fetching repository assignable actors.
2025-05-12 11:34:31 -06:00
Kynan Ware
e0afc91fef chore(issue edit): comments cleanup 2025-05-09 23:02:15 -06:00
Kynan Ware
ee9d169204 feat(issue edit): fetch assignable actors 2025-05-09 15:13:11 -06:00
Kynan Ware
38e52db377 feat(issue edit): fetch currently assigned actors 2025-05-09 15:12:07 -06:00
Azeem Sajid
ee281fd9ba
Add closedByPullRequestsReferences JSON field to issue view (#10941)
* [gh issue view] Expose `closedByPullRequestsReferences` JSON fields

* Incorporate GitHub Copilot review suggestions

* Incorporate review changes
2025-05-07 13:59:22 +01:00
William Martin
e995a873cb Feature detect v1 projects on non-interactive pr create 2025-05-02 15:08:34 +02:00
Sinan Sonmez (Chaush)
0a1e7a1fdc
Add --delete-last option to pr comment and issue comment (#10596)
* deletion for issues with confirmation flag

* add handling for interaction case

* finish implementation for issues

* finish the implementation for issues

* finalize the implementation for PR

* fix missing --yes flag for PR

* address PR comments related to feedbacks

* improve CommentablePreRun for pre checks

* improve confirmation prompt and truncate long comment body

* address PR comments on tests

* Truncate comment for confirmation prompt

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Improve test case descriptions

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Fix mock comment body

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Remove irrelevant prompt stub

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Use `opts.Interactive` as TTY indicator

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Fix expected `Interactive` value

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Polish `TestNewCmdComment`

Signed-off-by: Babak K. Shandiz <babakks@github.com>

---------

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2025-05-01 14:12:55 +01: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
William Martin
c208b1f075 Feature detect v1 projects on web mode issue create 2025-04-17 21:04:08 +02:00
William Martin
c8dd61d837 Feature detect v1 projects on non-interactive issue create 2025-04-17 17:51:38 +02:00
beforetech
563c2f9e18 refactor: use a more straightforward return value
Signed-off-by: beforetech <mail@before.tech>
2025-02-23 22:59:33 +08:00
zhuhaicity
13211af256 chore: fix some function names in comment
Signed-off-by: zhuhaicity <zhuhai@52it.net>
2025-01-12 15:07:04 +08: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