When a token (GitHub App, fine-grained PAT, or GITHUB_TOKEN) lacks the
project permission, querying projectItems on a PR or issue fails with
"Resource not accessible by integration" or "Resource not accessible by
personal access token". ProjectsV2IgnorableError did not match these
errors, causing commands like pr view, pr edit, and issue view to fail
entirely instead of gracefully omitting project data.
Add "Resource not accessible by" as an ignorable error prefix. This is
safe because ProjectsV2IgnorableError is only called in project-specific
code paths.
Closes#13280
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The GraphQL API can return `null` nodes in the `projectItems`
connection, causing a runtime panic (nil pointer dereference) when the
CLI attempted to access fields on these nil nodes. This crash occurs
even with personal access tokens with full read access.
Adds a check to safely skip `nil` nodes in `ProjectsV2ItemsForIssue` and
`ProjectsV2ItemsForPullRequest`.
Signed-off-by: Chris Henzie <chrishenzie@google.com>
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.