Review and ReviewComments

At the moment reviews and review comments are in the same JSON file.

The Gitea UI does not use the API when creating a new review comment.

image

It POST to https://gitea.com/earl-warren/gitea/pulls/2/files/reviews/comments in the example above, which has no equivalent in the Gitea API. The closest is /repos/{owner}/{repo}/pulls/{index}/reviews which creates an entirely new review, with all the comments it contains. There is no API endpoint to add a comment to an existing review.

It the GitHub API endpoint to add a comment to a review is /repos/{owner}/{repo}/pulls/{pull_number}/comments which contains a reference to a review created with the /repos/{owner}/{repo}/pulls/{pull_number}/reviews endpoint.

The GitLab API does not allow working with merge request reviews at all (see here, here, here and there). The only solution seems to be using the same POST that are used by the web ui, which is fragile.

This will need work down the line and in the meantime it would be better to have two separate objects for reviews and review comments. The F3 driver will have more work to do if that does not match the native API (GitLab & Gitea) but will be a natural fit for the GitHub API.

In Gitea POST to https://gitea.com/earl-warren/gitea/pulls/2/files/reviews/comments eventually calls calls the CreateCodeComment that links the comment to the current review, if any. This is essentially the same thing the /repos/{owner}/{repo}/pulls/{index}/reviews does, but all in one instead.