Commit graph

18 commits

Author SHA1 Message Date
Kynan Ware
7477bdb690 refactor(pr status): remove ChecksStatus slow path
All supported GHES versions (3.16 through 3.20) support the
checkRunCountsByState and statusContextCountsByState fields on
StatusCheckRollupContextConnection. The slow path that iterated
individual CheckContext nodes in ChecksStatus() is dead code.

This commit:

- Removes the slow path from ChecksStatus(), keeping only the
  aggregated counts-by-state path
- Removes parseCheckStatusFromCheckConclusionState (no callers remain)
- Removes CheckRunAndStatusContextCounts from PullRequestFeatures
  and its introspection detection
- Consolidates the two feature detection introspection queries into
  one (PullRequest + WorkflowRun fits within the platform limit of
  two __type expressions)
- Removes the errgroup dependency from feature detection
- Always uses statusCheckRollupWithCountByState in pr status queries
- Updates pr view fixtures to include counts-by-state fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 15:21:17 -06:00
Andy Feller
746da6de00 Update PR tests for v2 projects 2025-08-12 21:13:18 -04: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
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
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ć
c50d390cf5 Fix tests 2021-05-07 22:09:58 +02:00
Mislav Marohnić
56cdbb643f Fix pr view tests broken by createdAtsubmittedAt switch 2021-04-14 19:41:55 +02:00
Gowtham Munukutla
1d8dd2f1e9 add tests for additions and deletions 2021-03-06 15:02:16 +05:30
Sam Coe
52bdcad8ea
Do not display minimized comments 2021-01-27 08:14:46 -08:00
Sam Coe
3f172ad991
Add contional and tests 2021-01-25 13:27:32 -08:00
Sam Coe
b9b1079493
Display reviews when viewing pull requests 2021-01-20 12:15:25 -08:00
Sam Coe
9f101ff0a2
Add comments to pr view 2020-12-08 14:18:05 -05:00
Mislav Marohnić
74b191d0f7 Isolate pr view command 2020-07-31 14:19:09 +02:00