State correct permissions for requesting a reviewer via the API
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's 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
@NovemberTang Thank you for raising this issue! I'll get this triaged for review :sparkles: Our team will provide feedback regarding the best next steps for this issue - thanks for your patience! 💛
curl -fsSL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh -o install-scout.sh sh install-scout.sha
cat ~/my_password.txt | docker login --username foo --password-stdin
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
<@>
@NovemberTang Hello! 👋 Thank you so much for your patience while our SME team reviewed. They agree with your assessment, and that logically it makes sense members:read would be needed 💛
Would you be open to raising a PR to amend our docs? If not, no problem at all - we can open this to the community ✨
I've gone ahead and added the help wanted label so that anyone in the community may open a PR for this update 💛
[maintainer edit for spammy content]
A customer in ticket 3415316 just ran in to this same problem, and they fixed it by adding members:read permission to their GitHub App.
It would be helpful to our customers and Support if the documentation could be updated to clarify that this permission is needed.
Hi @nguyenalex836, I would like to raise a PR for this issue, Could you confirm if the below lines are ok to proceed?
"Members" organization permissions (read), when requesting team reviewers via GitHub App
@SoundaryaKoutharapu Hi! I'm so sorry for the late reply, I tried looking into this and it was weird and so old that there's not a lot of information available about it anymore, so I put it aside and it got a bit lost. I'm guessing that it was opened before we changed most of our REST API content to be auto-generated (before I started), and no one realized this needed to be fixed internally now. I really wish I could tell you to have at it, but I need to go look up the team who is responsible for the endpoint and instead ask them to update it.
It's not the ideal situation, but at least now I'm aware that there may be other issues that need to be fixed internally, so I'm grateful for your interest in helping out.
Hi @Sharra-writes,
Thanks for looking into this and explaining the situation! I completely understand and appreciate you taking the time to check and am happy to help in any way if needed.