cody
cody copied to clipboard
Reviewers API
Some users might want to have other sources for adding reviewers. Maybe an external service that runs security and vulnerability checks on PRs and adds appropriate reviewers depending on the result of the scan. We can't anticipate all the ways users might want to add reviewers so instead we should add an API to allow external services to access and update the review list.
This should have a few endpoints:
- GET /repo/:repo/pulls/:number/reviewers
- Retrieve the current list of reviewers for a PR
- PATCH /repo/:repo/pulls/:number/reviewers
- Add the specified reviewers to the current list of reviewers
- PUT /repo/:repo/pulls/:number/reviewers
- Replace the current list of reviewers with the specified list of reviewers
The :number key should be the PR number from GitHub while :repo should be the full name-with-owner GitHub repository identifier.
Other considerations:
- Authorization: probably via tokens
- API versioning: HTTP headers (assess if this is really necessary from the start)
This API should be GraphQL instead of REST