Commit graph

20 commits

Author SHA1 Message Date
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
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
William Martin
8b615ec2e6 Issue close early arg parsing 2025-04-17 15:27:39 +02:00
Andy Feller
3bb5f54073 Apply first round of owner/repo#number consistency
This commit expands on @nobe4 initial work by bringing the owner and repository name to the most obvious issue and PR number output use cases before making a second pass for any edge cases.
2024-03-01 14:03:18 -05:00
Sam Coe
e14d14cef2
Add support for issue state reason (#6245) 2022-09-14 12:39:15 +04:00
Sam Coe
45f1a71c8b
Remove all direct calls to shurcool-graphql 2022-08-18 21:40:41 +03:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Sam Coe
6fa8e4299c
Add ability to comment on close/reopen of issues/pull requests (#5437) 2022-04-11 17:06:35 +02: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ć
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Cristian Dominguez
6b49e21295 Improve issue status detection 2021-04-28 00:30:21 -03:00
Mislav Marohnić
f46bab256c Rename to SuccessIconWithColor 2021-01-25 14:56:39 +01:00
Mislav Marohnić
23d68705bc Match color of the success icon with the end state of the record 2021-01-22 23:55:33 +01:00
Mislav Marohnić
683ebee6ef Consistently use green success icon
For operations such as closing an issue or merging a PR, we would
display the success icon (a checkmark) in red and magenta colors,
respectively, to reflect the latest state of the record operated on
(red: closed; magenta: merged).

This was always confusing to me, seeing it both in code and in the UI,
because I'm instinctively thinking that it's a bug and have to remind
myself that it's by design.
2021-01-18 19:57:38 +01:00
Cristian Dominguez
ce151420f3 Migrate legacy tests 2021-01-11 21:07:19 -03:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Mislav Marohnić
c00fe73d5a Isolate issue commands 2020-08-07 00:27:55 +02:00