Skip to content

State correct permissions for requesting a reviewer via the API #35057

Open
@NovemberTang

Description

@NovemberTang

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request

What part(s) of the article would you like to see updated?

The docs for this request say that the only required permission for this request is pull-requests:write. When I tried to request a review from a team using an app with this permission scope, I got the following error message, which was quite obscure, only vaguely hinting that it might be trying to validate a team slug. "errorMessage": "Validation Failed: \"Could not resolve to a node with the global id of 'BUNCH_OF_RANDOM_CHARACTERS'.

I fixed this by applying the permission members:read to the GitHub App making the request, and I think it would be helpful to amend the docs to state that this permission is required for the request to succeed. I think it also might be be useful to indicate that the object that has failed to validate is the team slug, if that is the source of the error (which is just an educated guess)

Additional information

Please see the following screenshot

Screenshot 2024-10-23 at 21 04 41

Metadata

Metadata

Assignees

No one assigned

    Labels

    SME reviewedAn SME has reviewed this issue/PRcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issuenever-staleDo not close as stalerestContent related to rest - overview.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions