Skip to content

Conversation

@andyfeller
Copy link
Member

@andyfeller andyfeller commented Aug 15, 2025

Fixes #10716, #10708, #11409

With v1 classic projects being deprecated, this pull request improves users' v2 projects experience while also ensuring v1 projects functionality works for the correct GHES versions:

  • gh issue view will show information about v2 projects it is contained on
  • gh pr view will show information about v2 projects it is contained on
  • gh will avoid retrieving data or making v1 project API calls if GHES version is 3.17 or newer

Demo

GitHub.com

Source: Tiny Kanban (view)

Screenshot 2025-08-15 at 8 33 24 AM

Source: tinyfists/gh-nonsense#7

$ gh issue view https://github.com/tinyfists/gh-nonsense/issues/7
Working...
Demonstrate viewing issues on v2 projects tinyfists/gh-nonsense#7
Open • andyfeller opened about 6 months ago • 0 comments
Labels: documentation, enhancement
Projects: Tiny Kanban (In review)


  ## Circles                                                                                                          
                                                                                                                      
  │ I like circles                                                                                                    
  │ they're for me                                                                                                    
  │ because point A is point B                                                                                        


View this issue on GitHub: https://github.com/tinyfists/gh-nonsense/issues/7

Source: tinyfists/gh-nonsense#8

$ gh pr view https://github.com/tinyfists/gh-nonsense/pull/8
Working...
Script to create and delete discussion comment tinyfists/gh-nonsense#8
Open • andyfeller wants to merge 1 commit into main from v2-project-pr-demo • about 4 minutes ago
+109 -0 • No checks
Projects: Tiny Kanban (No Status)


  This is just a random example of a pull request contained on a v2 project.                                          


View this pull request on GitHub: https://github.com/tinyfists/gh-nonsense/pull/8

GHES 3.17

$ gh api /meta --hostname ghe.io
{
  "verifiable_password_authentication": false,
  "installed_version": "3.17.0"
}
Screenshot 2025-08-15 at 8 39 55 AM
$ gh issue view https://ghe.io/andyfeller/v1-repo-projects/issues/1
Working...
Seeing if GHES 3.17 blows up over v1 projects andyfeller/v1-repo-projects#1
Open • andyfeller opened about 20 days ago • 0 comments
Projects: v2 team planning (No Status)


  This is just a test of  gh issue create  experience on a feature branch to see how it handles the GHES version for  
  feature detection.                                                                                                  


View this issue on GitHub: https://ghe.io/andyfeller/v1-repo-projects/issues/1


$ gh pr view https://ghe.io/andyfeller/v1-repo-projects/pull/2
Working...
Create a simple example for demo andyfeller/v1-repo-projects#2
Open • andyfeller wants to merge 1 commit into main from v2-project-pr-demo • about 1 minute ago
+3 -0 • No checks
Projects: v2 team planning (In Progress)


  No description provided


View this pull request on GitHub: https://ghe.io/andyfeller/v1-repo-projects/pull/2

GHES 3.16

Screenshot 2025-08-15 at 9 10 49 AM Screenshot 2025-08-15 at 9 10 57 AM
$ gh issue view https://andyfeller-04bfba7b049b250e8.ghe-test.net/v1-project-demo/projects/issues/3
Working...
I'm on BOTH v1 and v2 projects! v1-project-demo/projects#3
Open • ghe-admin opened about 4 minutes ago • 0 comments
Projects: v2 kanban (No Status), v1 classy (Awaiting triage)


  Such a lucky issue, not many of us today!                                                                           


View this issue on GitHub: https://andyfeller-04bfba7b049b250e8.ghe-test.net/v1-project-demo/projects/issues/3


$ gh pr view https://andyfeller-04bfba7b049b250e8.ghe-test.net/v1-project-demo/projects/pull/4
Working...
Demo of a PR on v1 and v2 projects v1-project-demo/projects#4
Open • ghe-admin wants to merge 1 commit into main from v1-v2-project-pr-demo • about 2 minutes ago
+3 -0 • No checks
Projects: v2 kanban (In review), v1 classy (In progress)


  Nothing really special, not like #3                                                                                 


View this pull request on GitHub: https://andyfeller-04bfba7b049b250e8.ghe-test.net/v1-project-demo/projects/pull/4

andyfeller and others added 12 commits July 28, 2025 17:16
These changes are demonstrating how `gh` commands that support v1 classic projects can determine if support exists by checking the GHES server version.
…ction' into andyfeller/10716-project-featuredetection-api-version
This change updates the v1 project detection logic to retrieve the API version of GHES host to determine support.
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.
…tection-api-version

Report that v1 classic projects are detected on GHES 3.16.x or older
Display v2 projects in `gh issue view`
View v2 projects in `gh pr view` output
Copilot AI review requested due to automatic review settings August 15, 2025 12:26
@andyfeller andyfeller requested a review from a team as a code owner August 15, 2025 12:26
@andyfeller andyfeller requested a review from BagToad August 15, 2025 12:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enhances project support by displaying v2 projects in issue and PR views while properly handling v1 project deprecation for GHES 3.17+. This ensures users can see v2 project information and avoids v1 API calls on newer GHES versions.

  • Adds v2 project item support to issue and PR view commands
  • Updates feature detection to check GHES version for v1 project support cutoff at 3.17
  • Modifies tests to properly mock v2 project data

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/cmd/pr/view/view.go Adds projectItems field and v2 project display logic
pkg/cmd/pr/view/view_test.go Updates test expectations to include v2 projects
pkg/cmd/pr/view/fixtures/prViewPreviewWithMetadataByNumber.json Adds test fixture data for v2 projects
pkg/cmd/issue/view/view.go Adds projectItems field and v2 project display logic
pkg/cmd/issue/view/view_test.go Refactors tests to use mock functions for v2 project data
internal/featuredetection/feature_detection.go Implements GHES version checking for v1 project support
internal/featuredetection/feature_detection_test.go Adds comprehensive tests for version-based feature detection
api/queries_projects_v2.go Adds TotalCount field to v2 project queries
api/queries_issue.go Adds TotalCount field to ProjectItems struct

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
Member

@BagToad BagToad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyfeller andyfeller merged commit 9ae764b into trunk Aug 18, 2025
12 of 13 checks passed
@andyfeller andyfeller deleted the github-cli-937-v1-project-ghes-deprecation branch August 18, 2025 20:15
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 22, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://github.com/cli/cli) | minor | `v2.76.2` -> `v2.78.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.78.0`](https://github.com/cli/cli/releases/tag/v2.78.0): GitHub CLI 2.78.0

[Compare Source](cli/cli@v2.77.0...v2.78.0)

#### ℹ️ Note

This release was cut primarily to resolve a Linux package distribution issue. We recommend reviewing [the v2.77.0 release notes](https://github.com/cli/cli/releases/tag/v2.77.0) for the complete set of latest features and fixes.

#### What's Changed

##### ✨ Features

- Add `--force` flag to `gh run cancel` by [@&#8203;ankddev](https://github.com/ankddev) in [#&#8203;11513](cli/cli#11513)

##### 🐛 Fixes

- Fix failing to release Linux packages (affected v2.77.0). See [v2.77.0](https://github.com/cli/cli/releases/tag/v2.77.0) for more information.

**Full Changelog**: <cli/cli@v2.77.0...v2.78.0>

### [`v2.77.0`](https://github.com/cli/cli/releases/tag/v2.77.0): GitHub CLI 2.77.0

[Compare Source](cli/cli@v2.76.2...v2.77.0)

#### ⚠️ Incomplete Release

The v2.77.0 release experienced a failure publishing to our official Linux repos. This is resolved in [v2.78.0](https://github.com/cli/cli/releases/tag/v2.78.0), so we recommend using that release instead.

#### What's Changed

##### ✨ Features

- Report that v1 classic projects are detected on GHES 3.16.x or older by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11491](cli/cli#11491)
- Display v2 projects in `gh issue view` by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11496](cli/cli#11496)
- View v2 projects in `gh pr view` output by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11497](cli/cli#11497)
- Ensure users can see v2 projects when viewing issues and MRs, avoid v1 projects on GHES 3.17 and newer by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11514](cli/cli#11514)

##### 🐛 Fixes

- fix error for ErrReleaseNotFound when fetching ref by [@&#8203;ejahnGithub](https://github.com/ejahnGithub) in [#&#8203;11451](cli/cli#11451)
- add test for FetchRefSHA by [@&#8203;ejahnGithub](https://github.com/ejahnGithub) in [#&#8203;11481](cli/cli#11481)
- Fix `gh repo delete --yes` safety issue when no repository argument provided by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;11536](cli/cli#11536)

##### 📚 Docs & Chores

- Improve spam detection evals by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;11419](cli/cli#11419)
- Fix `help wanted` label regexp in CI automation by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;11423](cli/cli#11423)
- Update spam detection to comment on and close issue by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11435](cli/cli#11435)
- Adding a note to `gh search` docs to explain the usage of `--` to exclude certain results by [@&#8203;Sukhpreet-s](https://github.com/Sukhpreet-s) in [#&#8203;11162](cli/cli#11162)
- Update issue triage guidelines and label usage by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;11454](cli/cli#11454)
- Reorganize installation docs by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11473](cli/cli#11473)
- Update govulncheck workflow to scan source code by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;11482](cli/cli#11482)
- Hidden trusted root flag for release verify by [@&#8203;ejahnGithub](https://github.com/ejahnGithub) in [#&#8203;11511](cli/cli#11511)

##### :dependabot: Dependencies

- Regenerate third-party licenses on trunk pushes by [@&#8203;andyfeller](https://github.com/andyfeller) in [#&#8203;11370](cli/cli#11370)
- Update third-party license versions by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;11557](cli/cli#11557)
- Bump Go to 1.24.6 by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in [#&#8203;11467](cli/cli#11467)
- chore(deps): bump github.com/spf13/pflag from 1.0.6 to 1.0.7 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11319](cli/cli#11319)
- chore(deps): bump actions/download-artifact from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11458](cli/cli#11458)
- chore(deps): bump actions/checkout from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11490](cli/cli#11490)
- chore(deps): bump github.com/yuin/goldmark from 1.7.12 to 1.7.13 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11368](cli/cli#11368)
- Bump google.golang.org/grpc & other required dependencies by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;11510](cli/cli#11510)
- chore(deps): bump google.golang.org/grpc from 1.73.0 to 1.74.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11367](cli/cli#11367)
- chore(deps): bump github.com/cli/go-gh/v2 from 2.12.1 to 2.12.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11537](cli/cli#11537)
- chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.3.0 to 2.4.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11556](cli/cli#11556)

#### New Contributors

- [@&#8203;Sukhpreet-s](https://github.com/Sukhpreet-s) made their first contribution in [#&#8203;11162](cli/cli#11162)
- [@&#8203;Copilot](https://github.com/Copilot) made their first contribution in [#&#8203;11536](cli/cli#11536)

**Full Changelog**: <cli/cli@v2.76.2...v2.77.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi4xIiwidXBkYXRlZEluVmVyIjoiNDEuODIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
@omarshahen541-dotcom
Copy link

SECURITY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh should only recognize GHES 3.16 or older as supporting v1 classic projects

4 participants