Commit graph

96 commits

Author SHA1 Message Date
Kynan Ware
7198d270b4 Add generic actorDisplayName for all actor display names
Replace copilotDisplayName with actorDisplayName(typeName, login, name)
which handles all actor types: known bots get friendly names (e.g.
Copilot → 'Copilot (AI)'), regular bots return login, users with
names return 'login (Name)', others return login.

All DisplayName() methods on Author, CommentAuthor, GitHubUser,
AssignableUser, AssignableBot, RequestedReviewer, and ReviewerBot
now delegate to actorDisplayName with their available fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 11:55:09 -07:00
Kynan Ware
04bc0d27f4 Show friendly Copilot (AI) name in gh pr view
Add CopilotDisplayName helper that translates known Copilot bot
logins (copilot-pull-request-reviewer, copilot-swe-agent) to the
friendly 'Copilot (AI)' display name. Applied to:

- PullRequestReview.AuthorLogin() — review comment author
- Comment.AuthorLogin() — PR/issue comment author
- parseReviewers() in pr view — reviewer list display

This ensures gh pr view shows 'Copilot (AI)' instead of the raw
'copilot-pull-request-reviewer' login for both the reviewer status
line and any review comments left by Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 11:19:43 -07:00
Andy Feller
746da6de00 Update PR tests for v2 projects 2025-08-12 21:13:18 -04:00
Andy Feller
72f5fbbec0 Base changes for PR project items 2025-08-12 20:59:50 -04:00
William Martin
c5d8e6f8f5
Merge pull request #10821 from cli/wm/projectsv1-deprecation-pr-view
Feature detect v1 projects on pr view
2025-05-02 15:07:40 +02:00
William Martin
64370ce73e Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
William Martin
3bcf9758ad Feature detect v1 projects on pr view 2025-05-01 15:31:36 +02: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
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
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
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
William Martin
8a0d361bac Expose fullDatabaseId for PR json export 2024-07-23 13:23:10 +02:00
William Martin
940b54c708 Add tests for JSON field support on issue and pr view commands 2024-07-12 17:35:54 +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
Florian Forster
7164f6e225
fix: Prevent nil dereference in pr view. (#8566)
The API may return a `null` project, maybe related to "legacy projects". This
is translated to a nil pointer in Go. When accessing `project.Column`, the nil
pointer was dereferenced, causing a segmentation fault.
2024-01-17 22:12:22 +00:00
Yukai Chou
afbdb945bc Small docs tweaks 2023-11-23 07:14:38 +08:00
Yukai Chou
17d336e005 Wrap cli flags in backticks uniformly 2023-11-16 22:54:27 +08:00
ffalor
31ffa6b499
Alphabetically sort labels for pr/issue view (#7587) 2023-06-20 11:30:03 +09:00
William Martin
04ecac9a6f Rework state parsing for CheckRuns and StatusContexts 2023-05-23 16:51:08 +02:00
Martijn Pieters
0da0de4022
Include auto-merge information in gh pr view (#7385) 2023-05-10 08:39:52 +12:00
lpessoa
fb6f538f88
Adding no checks message when PR has no checks
Including additional tests.
2022-10-05 22:10:38 -03:00
lpessoa
6246f89690
Adding new tests for 'view' and 'shared display'
Added all passed, all failed, some failed and pending scenarios.
Added tests for PrCheckStatusSummaryWithColor.
2022-09-19 16:41:01 -05:00
lpessoa
742b50c929
Adding new tests for 'view' and 'shared display'
Added all passed, all failed, some failed and pending scenarios.
Added tests for PrCheckStatusSummaryWithColor.
2022-09-19 16:37:22 -05: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
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Mark Woods
e876b22963
Change markdown wrap limit match terminal width (#6016) 2022-09-01 07:36:25 +00:00
Nate Smith
1da31c8b8f
Merge pull request #6085 from satotake/add-age-to-pr
Add age field to `pr list` / `pr view`
2022-08-23 11:55:29 -05:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
satotake
61e0c5a294 Add age field to pr view 2022-08-17 02:02:53 +09:00
Sam Coe
d244346960
Replace uses of strings.Title (#5623) 2022-05-12 13:52:21 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Callum Macrae
f7ef503051 fix: respect GH_FORCE_TTY when running gh pr view
`GH_FORCE_TTY` only affects stdout, not stderr, so this check was
failing and the flag was being ignored.

I also checked for similar problem in other files but everything else
seemed stderr or stdin related.

closes #5354
2022-03-25 15:07:47 +00:00
Mislav Marohnić
4a3ef50d2d
Standardize pager output across commands (#5141)
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view

Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
2022-02-01 08:36:51 +01:00
Mislav Marohnić
456d55ead9 Have a single Render function handle all Markdown rendering 2022-01-13 19:39:43 +01:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
e2973453b5
Add helper template functions for rendering tables (#3519)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 21:00:25 +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
jack1142
6a74eb1262
Merge branch 'trunk' into patch-1 2021-06-02 11:10:25 +02:00
jack1142
184149b844
Add missing new line 2021-06-01 23:53:58 +02:00
jack1142
3943a8bb1f
Update PR tty view formatting and its tests 2021-05-29 04:44:34 +02:00
Mislav Marohnić
1a980e768c Fix how teams are displayed in requested reviewers
1. The `--json` export now only renders the `login` field for User types
   and `name` and `slug` fields for Team types.
2. The `pr view` command now renders team reviewers in the format of
   `ORG/SLUG` instead of the team name. This is so that the same value
    can be used in the `pr create -r` flag.
2021-05-28 14:32:31 +02:00
Mislav Marohnić
42155c7d2d Export more IDs in issue/pr JSON payload 2021-05-18 18:19:28 +02:00
Mislav Marohnić
e758f30073 Fix preloading of pr reviews, checks, and issue/pr comments 2021-05-18 17:13:27 +02:00
Mislav Marohnić
bc3bb97c43 Merge remote-tracking branch 'origin' into pr-lookup-refactor 2021-05-17 17:41:38 +02:00
Mislav Marohnić
5f0301c990 Have Exporter.Write automatically call ExportData on given data structure 2021-05-12 17:05:15 +02:00