Commit graph

428 commits

Author SHA1 Message Date
Kynan Ware
3651c289ed Show friendly display names in gh issue view
Apply DisplayName() to author and assignee display in issue view,
consistent with the pr view changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 12:01:06 -07:00
Kynan Ware
93c4340f29
Merge pull request #12627 from cli/kw/pr-create-multi-select-with-search-ccr
`gh pr create`: login-based reviewer requests and search-based interactive selection
2026-03-06 10:24:19 -07:00
Kynan Ware
4f2304d4e5 Remove StateReason feature detection for issue close
The stateReason field was added in GHES ~3.4, which is far older than
the earliest supported GHES version (3.14). The feature detection and
conditional inclusion of stateReason is therefore unnecessary.

This removes:
- StateReason field from IssueFeatures struct
- GHES introspection query in IssueFeatures() (only ActorIsAssignable
  remains, which is always false on GHES)
- Conditional stateReason field inclusion in issue list
- Feature detection guard in issue close
- Feature detection guard in FindIssueOrPR

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 13:31:30 -07:00
Kynan Ware
6b56a23970 Remove unnecessary StateReasonDuplicate feature detection
The DUPLICATE enum variant for IssueClosedStateReason was added in
GHES 3.16, which is older than the earliest supported GHES version.
The feature detection check is therefore unnecessary.

Addresses: https://github.com/cli/cli/pull/12811#issuecomment-3997044372

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 13:24:05 -07:00
Kynan Ware
d594c5e918
docs: add examples to gh issue close help text (#12830)
Add examples for closing issues, closing with a comment, closing as
duplicate, and closing with a reason.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2026-03-04 14:53:27 +00:00
Takeshi
b9c8d8e023
Merge branch 'trunk' into issue-close-duplicate-of 2026-03-03 22:03:25 -05:00
Kynan Ware
4ea9076d81
Merge pull request #12651 from gunadhya/fix-repeating-cmd-gh-issue-develop
`issue develop`: prevent .git/config corruption on repeated `--name` invocation
2026-03-03 18:55:43 -07:00
Kynan Ware
d983ae0469
Merge pull request #12623 from LouisLau-art/fix/issue-list-pr-search-qualifier
fix(issue list): reject pull request-only search qualifiers
2026-03-03 14:52:35 -07:00
Louis Shawn
b601b307a4 test(issue list): cover additional PR search qualifier variants 2026-03-03 10:13:57 +08:00
Kynan Ware
1957a022b6
Merge pull request #12652 from VishnuVV27/fix-issue-view-comments-redundancy
Fix redundant API call in gh issue view --comments (#12606)
2026-03-02 10:58:41 -07:00
Louis Shawn
5194256928 fix(issue list): reject pull request-only search qualifiers 2026-03-02 10:50:15 -07:00
gunadhya
ee8014a4d9 Simplify progress indicators in issue develop 2026-03-02 17:01:57 +05:30
Takeshi
01c83acfe8 Add --duplicate-of flag and duplicate reason to gh issue close
Support closing issues as duplicates via --reason duplicate and
--duplicate-of <issue> flags. The --duplicate-of flag accepts an issue
number or URL, validates it references a different issue (not a PR),
and passes the duplicate issue ID to the closeIssue mutation.

Feature detection checks whether the GHES instance supports the
DUPLICATE enum value in IssueClosedStateReason before using it.
2026-02-28 20:10:07 -05:00
Kynan Ware
9de48154de Add missing TODO comments for featuredetection if-statements
Add greppable TODO identifiers above all if-statements that reference
featuredetection struct fields, as required by the featuredetection
linter. This ensures every feature detection branch is tagged for
future cleanup when GHES gains support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-16 14:24:32 -07:00
gunadhya
b38f6772e5 Fix issue develop repeated invocation with named branches 2026-02-09 23:31:22 +05:30
vishnuvv27
b32b7eab39 Fix redundant API call in gh issue view --comments (#12606) 2026-02-09 15:31:55 +05:30
Kynan Ware
9904f7d1b9 gh pr create: CCR and multiselectwithsearch 2026-02-04 14:56:05 -07:00
Kynan Ware
07dfdf97ae Update edit tests
Updated test mocks and logic to consistently use lowercase 'monalisa' for login names and display names for user assignees. Improved handling of dynamic assignee fetching in interactive flows by relying on searchFunc and metadata population, and clarified logic in FetchOptions to fetch assignees only when necessary. These changes ensure more accurate simulation of interactive assignment and better test coverage for actor assignee features.
2026-01-26 13:29:22 -07:00
Babak K. Shandiz
1cd4840199
fix(pr/shared): delegate query compilation to search package
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-20 13:35:24 +00:00
Jonathan Fisher
09617d315e
Fix typo in comment for gh issue develop branch checkout command 2025-10-28 16:13:24 -06:00
Kynan Ware
ec526bf72b Inject Detector mock in edit command tests
Added Detector field with EnabledDetectorMock to EditOptions in issue and PR edit command tests to ensure feature detection logic is exercised during test runs. Also updated EditableOptionsFetch signature in pr/edit/edit_test.go to include projectsV1Support parameter for compatibility with shared.FetchOptions.
2025-10-21 15:55:42 -06:00
Kynan Ware
e373ad6c9f Pass ProjectsV1Support to FetchOptions functions
Update FetchOptions and related function signatures to accept a ProjectsV1Support parameter, enabling conditional logic based on project support. This change improves flexibility for handling project fields in issue and PR editing flows.
2025-10-21 15:03:52 -06:00
Babak K. Shandiz
37896d613a
fix(featuredetection): remove redundant AdvancedIssueSearchWebInIssuesTab field
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:46:28 +01:00
Babak K. Shandiz
02ee337818
docs(issue list): mention advanced issue search syntax support
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:36:24 +01:00
Babak K. Shandiz
20e8b9e8ea
docs(issue list): fix incorrect formatting
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-02 10:14:32 +01:00
Babak K. Shandiz
87bd76c5aa
docs: add cleanup/future TODO marks for advanced issue search changes
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-01 13:55:49 +01:00
Babak K. Shandiz
5747297775
docs(issue list): explain use of advanced issue search syntax
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-01 13:40:20 +01:00
Babak K. Shandiz
b4213ac136
test(issue/pr list): assert integration with advanced issue search
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-08-31 21:11:55 +01:00
Babak K. Shandiz
6d148400a8
refactor(issue/pr list): support advanced issue search
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-08-31 18:29:24 +01: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
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
973718712a Fix failing tests for Copilot replacement 2025-07-16 15:36:53 -04:00
Andy Feller
4f0a5807bf Refactor CopilotReplacer logic based on PR feedback
Thanks to @bagtoad, this commit refactors the argument to `NewCopilotReplacer(bool)` from being where this is used to what it effect is has.

Because there is already precedence for display name being `<login> (<name>)`, I worried there would be confusion for `Copilot (AI)` being display name for assignees and reviewers but `Copilot` when going to GitHub.com UI.  Instead, I renamed the argument based on whether the login is returned / replaced.
2025-07-16 14:42:11 -04:00
Andy Feller
e2bed653df Implement actor and user assignee tests 2025-07-16 14:10:26 -04:00
Andy Feller
554fe0f51f Fix gh issue create tests, copilot web assign
This commit is primarily focused on fixing the existing `gh issue create` tests with the changes to the underlying queries retrieving the data for resolving metadata.

Additionally, a new test case for `gh issue create --web --assignee @copilot` was added to mirror existing tests.  While exercising this capability, I found out the web UI apparently wants `copilot` instead of the `copilot-swe-agent` login, so changes to address that were a part of this commit.
2025-07-11 12:19:36 -04:00
Andy Feller
49821b20f9 Add non-TTY issue create copilot test, todos 2025-07-08 15:19:09 -04:00
Andy Feller
c69f828019 Initial assign Copilot during issue create changes
- updated command documentation for new `--assignee @copilot` syntax
- updated `gh issue create` logic with feature detection for actor availability
- fixed bug where `--assignee` would not select default assignees due to login vs display name mismatch
- updated survey prompt logic to avoid parsing prompt options in favor of correlating with assignee / actor source

One thing that is not included in these changes is incorporating the GraphQL mutation to replace assignees with actors, which I will continue iterating on.
2025-07-02 16:22:12 -04:00
Babak K. Shandiz
dc51226ce2
test: improve test case to highlight host name override
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-07-01 11:21:24 +01:00
Kynan Ware
ed4b90104f test(pr): Add tests for actor assignees 2025-06-03 14:30:19 +01:00
Andy Feller
cde860be88 Iterate on pr edit problems with existing assignees
This commit is a handful of changes around `gh pr edit --add-assignee` behavior.  Most notably, fixing a bug where the assigned actors weren't being dropped.

In addition to this, I was refactoring the testing setup to allow for individual test table scenarios could be contained.
2025-06-03 13:33:52 +01:00
Tim Rogers
9a8031151c
Document support for @copilot in gh [pr|issue] edit --add-assignee and --remove-assignee (#11056)
* Document support for `@copilot` in `gh [pr|issue] edit --add-assignee` and `--remove-assignee`

Following up on #10991, this updates the help text for
`issue edit` and `pr edit`'s `--add-assignee` and
`--remove-assignee` options to mention that you can use
`@copilot`.

This is already mentioned in the command-level help text, but
not at the argument level, whereas the `@me` macro is.

* Apply suggestion from @babakks

Co-authored-by: Babak K. Shandiz <babakks@github.com>

* Apply suggestion from @babakks

Co-authored-by: Babak K. Shandiz <babakks@github.com>

---------

Co-authored-by: Babak K. Shandiz <babakks@github.com>
2025-06-02 16:29:35 +01:00
Kynan Ware
3a8cdda148
Merge pull request #10991 from cli/kw/gh-cli-917-special-actor-assignee-names-noninteractive
`issue edit`, `pr edit`: Support special non-interactive (flags) assignee name `@copilot`
2025-05-16 12:19:43 -06:00
Kynan Ware
748afb6e85 doc(issue/pr edit): clarify @copilot usage 2025-05-16 12:18:23 -06:00
Kynan Ware
532aa1c32a doc(issue/pr edit): doc @copilot assignee 2025-05-16 09:55:17 -06:00
Kynan Ware
a22a1bbde4 test(editable): prompts use assignee display names 2025-05-16 09:20:58 -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
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
08cd1dc7db feat(issue edit): replacing actor assignee is done synchronously with updateIssue 2025-05-14 11:43:29 -06:00
Kynan Ware
1e5c3c7426 fix(issue edit): revert rename of ActorAssignees 2025-05-13 13:02:20 -06:00
Kynan Ware
21bd797c6c fix(issue edit): use double quotes for assignedActors 2025-05-13 11:45:40 -06:00