CLI Feedback
Consider the following:
- A fine-grained access token exists for a particular repo
- That token has the "Repository: Pull requests" permission and nothing else
- An end-user runs
gh pr create […] --reviewer FooTeam to create a new PR with the FooTeam Team as a reviewer
In this case, the request fails with this message:
GraphQL: Resource not accessible by personal access token (organization.t000)
The problem
The error does not clearly indicate what the problem is and is confusing to debug.
The reason the request was rejected is that the fine-grained access token does not have the "Organization: Member" permission and thus cannot validate that the Team in question exists.
As-is, this is not communicated well. It is not immediately apparent that the request failed due to the --reviewer flag and that organization.t000 corresponds with FooTeam. No information is given about how to resolve the issue.
Possible solutions
Some possible alternative error messages that would clarify the situation:
Cannot set reviewers because personal access token does not have "Organization: Member" permissions
Personal access token is unable to access reviewer "FooTeam"
Reviewer not accessible by personal access token (FooTeam)
Personal access token cannot set reviewers due to lacking "Organization: Member" permissions
CLI Feedback
Consider the following:
gh pr create […] --reviewer FooTeamto create a new PR with theFooTeamTeam as a reviewerIn this case, the request fails with this message:
The problem
The error does not clearly indicate what the problem is and is confusing to debug.
The reason the request was rejected is that the fine-grained access token does not have the "Organization: Member" permission and thus cannot validate that the Team in question exists.
As-is, this is not communicated well. It is not immediately apparent that the request failed due to the
--reviewerflag and thatorganization.t000corresponds withFooTeam. No information is given about how to resolve the issue.Possible solutions
Some possible alternative error messages that would clarify the situation: