Commit graph

49 commits

Author SHA1 Message Date
Kynan Ware
628325920d Reject cross-host issue refs in ResolveIssueRef
Relationship mutations (parent, sub-issue, blocked-by, blocking) run
against baseRepo's host with node IDs that must come from that same
host. Catch a different-host ref up front with a clear error instead
of letting the mutation fail with a confusing node-ID error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 18:04:48 -06:00
Kynan Ware
ddb2fce07b refactor: extract shared helpers for issue ref resolution and type lookup
Address code review findings:

- Extract resolveIssueRef into shared.ResolveIssueRef (was duplicated
  between create.go and edit.go)
- Extract issue type name→ID resolution into shared.ResolveIssueTypeName
  (was duplicated between create applyIssueTypes and edit applyEditIssueType)
- Fix double import of issue/shared in view.go

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 08:49:43 -06: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
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
cfa90a2c80 Remove old issue lookup funcs 2025-04-17 15:27:40 +02:00
William Martin
8b615ec2e6 Issue close early arg parsing 2025-04-17 15:27:39 +02:00
William Martin
aaddcb019d Issue edit early arg parsing 2025-04-17 15:27:39 +02:00
Andy Feller
47225bcf56
Merge pull request #10737 from cli/andyfeller/muted-text-part2-github-cli-833
Ensure muted text is thematic and customizable
2025-04-08 16:59:36 -04:00
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
Andy Feller
3eca268a7f Introduce color_labels support, update commands
This commit implements the actual changes around configuration setting / environment variable logic for displaying labels using their RGB hex color code in terminals with truecolor support.

One of the subtler changes in this commit is renaming generic ColorScheme.HexToRGB logic to render truecolor to ColorScheme.Label as this feature was being used exclusively for labels.  This is due to confusion about introducing the new `color_labels` config on top of generic coloring logic.
2025-04-02 18:24:20 -04:00
crystalstall
5562c1489f chore: fix some function names
Signed-off-by: crystalstall <crystalruby@qq.com>
2024-09-02 15:18:42 +08:00
t4kamura
a6cccdf671 Add pr url pattern 2024-03-18 22:49:23 +09:00
t4kamura
2ea5f03b43 Test pr url lock 2024-03-18 22:49:07 +09:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02:00
Sam Coe
e9a0b393c9
Fix flaky test 2023-05-31 11:04:06 +09:00
Heath Stewart
17679cf65f
Edit multiple issues, PRs in parallel (#7259)
Allows multiple issues or PRs to be edited in parallel, and querying for shared fields once to reduce network requests.

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2023-04-25 14:45:41 +02: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
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
vilmibm
f5d19b831e error instead of prompt when no base repo + fixes 2022-12-15 11:44:37 -08:00
Nate Smith
a20192943d
Merge pull request #6254 from Bestra/create-linked-branch-command
Add `gh issue develop` command
2022-10-24 16:26:56 -05:00
Mislav Marohnić
3fe5026d39
Migrate to tableprinter from go-gh (#6346) 2022-10-17 15:15:39 +02:00
Chris Westra
1f26eb6899
Merge branch 'trunk' into create-linked-branch-command 2022-09-14 16:28:54 -04:00
Chris Westra
48512176d8 Error when issue-repo doesn't match issue url 2022-09-14 11:57:51 -04:00
Sam Coe
e14d14cef2
Add support for issue state reason (#6245) 2022-09-14 12:39:15 +04:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Chris Westra
ac4fc388bf List linked branches works 2022-09-13 07:28:33 -04:00
ffalor
665e4e3446
Add new commands issue pin and issue unpin (#5597) 2022-08-31 10:16:45 +00:00
Sam Coe
2fc0ffd0be
Fix auth refresh prompter initialization (#6141)
* Fix prompter not being initialized in auth refresh

* fix broken issue list test
2022-08-25 12:07:40 +03:00
Sam Coe
074ed50b8a
Integrate go-gh API package (#5614) 2022-06-23 04:05:31 +01:00
Sam Coe
8a0c1f903c
Change issue close color from red to purple (#5436) 2022-04-11 11:50:55 +02: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ć
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ć
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ć
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
88af63d36f
Re-enable label colors for issue list (#4106)
* Re-enable label colors for issue list
* Drop parentheses wrapping issue labels
* Support ANSI escape codes in TablePrinter cells
* Switch to a Truncate implementation that correctly measures ANSI escape codes
* Only output RGB color if terminal has truecolor capabilities
* Enable `ENABLE_VIRTUAL_TERMINAL_PROCESSING` on Windows - fixes wrapping issues with full lines and allows truecolor rendering

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 19:55:12 +02:00
Mislav Marohnić
930ee60ac5 Disable colorizing labels in issue list output
- Labels with dark color are not visible on a dark background
- "Raw" `issue view` output should never output color, not even with
  CLICOLOR_FORCE=1
2021-08-03 16:02:16 +02:00
bchadwic
47314a6bbc modified HexToRGB to check whether terminal and gh have color enabled, as well as created tests for HexToRGB 2021-07-03 17:09:25 -07:00
bchadwic
af2499cb69 renamed func RGB to HexToRGB 2021-06-29 22:35:23 -07:00
bchadwic
4c412bc88c Added in label rgb functionality for both prs and issues 2021-06-29 22:26:41 -07:00
Mislav Marohnić
e53d02b680 Add back isolated tests for issue/PR lookup by argument 2021-03-22 12:55:04 +01:00
Sam Coe
b2edf782cf
Reverse order of issue lookup checks 2020-12-08 14:16:40 -05:00
Sam Coe
bec5e0cd77
Address PR comments 2020-12-08 10:24:02 -05:00
Sam Coe
c843a4fa13
Add issue comment viewing 2020-12-07 14:25:04 -05:00
Mislav Marohnić
feec114bb6 Fix truncateLabels for empty values 2020-11-11 15:29:40 +01:00
Mislav Marohnić
8d054486a3 Merge remote-tracking branch 'origin' into jan25/issue-2042 2020-11-11 15:23:46 +01:00
Mislav Marohnić
62e4c536ce Ensure parentheses are preserved after truncating labels in table view 2020-11-11 15:22:34 +01:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Abhilash Gnan
9e03d01bdf Fetch all issue labels
Signed-off-by: Abhilash Gnan <abhilashgnan@gmail.com>
2020-10-28 19:45:21 +01:00
Mislav Marohnić
c00fe73d5a Isolate issue commands 2020-08-07 00:27:55 +02:00