Adding PR Reviews through API #2758

Closed
opened 2025-11-02 04:46:57 -06:00 by GiteaMirror · 22 comments
Owner

Originally created by @mojie126 on GitHub (Jan 15, 2019).

Hope to add PR comments through API

Originally created by @mojie126 on GitHub (Jan 15, 2019). Hope to add PR comments through API
GiteaMirror added the type/featuremodifies/api labels 2025-11-02 04:46:57 -06:00
Author
Owner

@zeripath commented on GitHub (Jan 15, 2019):

OK if logging in with basic authentication

curl -X POST "$APP_URL/api/v1/repos/$OWNER/$REPO_NAME/issues/$PULL_NUMBER/comments" -u "$USER" -H "Content-Type: application/json" --data '{ "body": "A new comment" }'

See the API information for other ways to log in.


I've just realised this is only for comments - I think review is not yet implemented in the API.

@zeripath commented on GitHub (Jan 15, 2019): OK if logging in with basic authentication ```bash curl -X POST "$APP_URL/api/v1/repos/$OWNER/$REPO_NAME/issues/$PULL_NUMBER/comments" -u "$USER" -H "Content-Type: application/json" --data '{ "body": "A new comment" }' ``` See the API information for other ways to log in. --- I've just realised this is only for comments - I think review is not yet implemented in the API.
Author
Owner

@mojie126 commented on GitHub (Jan 16, 2019):

这个不是添加到issues里了么...?
我的意思是能不能直接在PR里添加评论...

@mojie126 commented on GitHub (Jan 16, 2019): 这个不是添加到issues里了么...? 我的意思是能不能直接在PR里添加评论...
Author
Owner

@lunny commented on GitHub (Jan 16, 2019):

@mojie126 please speak English :(

@lunny commented on GitHub (Jan 16, 2019): @mojie126 please speak English :(
Author
Owner

@morph027 commented on GitHub (Apr 25, 2019):

Coming here from https://discourse.gitea.io/t/approve-reject-pull-requests-via-api/1115/3

Was looking for the same as we're trying to use Drone CI as "reviewer".

@morph027 commented on GitHub (Apr 25, 2019): Coming here from https://discourse.gitea.io/t/approve-reject-pull-requests-via-api/1115/3 Was looking for the same as we're trying to use Drone CI as "reviewer".
Author
Owner

@morph027 commented on GitHub (May 8, 2019):

Also see #5060

@morph027 commented on GitHub (May 8, 2019): Also see #5060
Author
Owner

@psychomario commented on GitHub (Sep 23, 2019):

I'd like to work on this if it's not already being worked on?

My thoughts are an extra endpoint at /repos/{owner}/{repo}/pulls/{index}/review:

  • GET returns array of approvals/rejections with the review comments if applicable
  • DELETE allows the current user (or sudo'd admin) to remove their approval
  • PATCH allows the current user (or sudo'd admin) to add their approval/rejection+comments

If this is agreed I can begin to implement this and I'll create a PR when done.

@psychomario commented on GitHub (Sep 23, 2019): I'd like to work on this if it's not already being worked on? My thoughts are an extra endpoint at `/repos/{owner}/{repo}/pulls/{index}/review`: - GET returns array of approvals/rejections with the review comments if applicable - DELETE allows the current user (or sudo'd admin) to remove their approval - PATCH allows the current user (or sudo'd admin) to add their approval/rejection+comments If this is agreed I can begin to implement this and I'll create a PR when done.
Author
Owner

@lunny commented on GitHub (Sep 30, 2019):

@psychomario I think no others will work on this. Maybe you could also add a comment but without approval/rejection

@lunny commented on GitHub (Sep 30, 2019): @psychomario I think no others will work on this. Maybe you could also add a comment but without approval/rejection
Author
Owner

@alexanderadam commented on GitHub (Oct 23, 2019):

Interesting issue! This would be required for integrating automated PR tools like Pronto (see also this issue) or Danger.

@alexanderadam commented on GitHub (Oct 23, 2019): Interesting issue! This would be required for integrating automated PR tools like [Pronto](https://github.com/prontolabs/pronto#pronto) (see also [this issue](https://github.com/prontolabs/pronto/issues/275)) or [Danger](https://github.com/danger/danger).
Author
Owner

@6543 commented on GitHub (Nov 5, 2019):

@mojie126 can you generalise the issue title to something like "API Endpoints for CodeReview"

@6543 commented on GitHub (Nov 5, 2019): @mojie126 can you generalise the issue title to something like "API Endpoints for CodeReview"
Author
Owner

@6543 commented on GitHub (Nov 5, 2019):

I'll take a look at this later

@6543 commented on GitHub (Nov 5, 2019): I'll take a look at this later
Author
Owner

@Tchoupinax commented on GitHub (Dec 21, 2019):

What's up with this feature ? :)

@Tchoupinax commented on GitHub (Dec 21, 2019): What's up with this feature ? :)
Author
Owner

@6543 commented on GitHub (Dec 21, 2019):

dont have time to implement it jet :(

@6543 commented on GitHub (Dec 21, 2019): dont have time to implement it jet :(
Author
Owner

@tbe commented on GitHub (Jan 25, 2020):

I'll get my feed wet on this feature, and will try to implement it over the weekend

@tbe commented on GitHub (Jan 25, 2020): I'll get my feed wet on this feature, and will try to implement it over the weekend
Author
Owner

@6543 commented on GitHub (Jan 25, 2020):

@tbe a hint: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#api-v1

describes the places you have to look at etc...

@6543 commented on GitHub (Jan 25, 2020): @tbe a hint: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#api-v1 describes the places you have to look at etc...
Author
Owner

@6543 commented on GitHub (Jan 25, 2020):

and the github api docs
may help you

@6543 commented on GitHub (Jan 25, 2020): and the [github api docs](https://developer.github.com/v3/pulls/reviews) may help you
Author
Owner

@6543 commented on GitHub (Apr 22, 2020):

I'll finaly take it :)

@6543 commented on GitHub (Apr 22, 2020): I'll finaly take it :)
Author
Owner

@markusamshove commented on GitHub (Apr 24, 2020):

@6543 thats great!

If you need any help or guidance on what different use-cases could be, feel free to ask :-)

@markusamshove commented on GitHub (Apr 24, 2020): @6543 thats great! If you need any help or guidance on what different use-cases could be, feel free to ask :-)
Author
Owner

@6543 commented on GitHub (Apr 27, 2020):

@MarkusAmshove you can look at https://github.com/go-gitea/gitea/pull/11224#issuecomment-619637195 to see the progress

@6543 commented on GitHub (Apr 27, 2020): @MarkusAmshove you can look at https://github.com/go-gitea/gitea/pull/11224#issuecomment-619637195 to see the progress
Author
Owner

@6543 commented on GitHub (Apr 28, 2020):

everybody who want to test it ... #11224 is considered as ready (by me), only tests have to be added and in some cases there could be a code optimisation ... but the functionalety is ready :)

@6543 commented on GitHub (Apr 28, 2020): everybody who want to test it ... #11224 is considered as ready (by me), only tests have to be added and in some cases there could be a code optimisation ... but the functionalety is ready :)
Author
Owner

@6543 commented on GitHub (Apr 28, 2020):

@MarkusAmshove ☝️ you perhaps want to have a look at it?

@6543 commented on GitHub (Apr 28, 2020): @MarkusAmshove :point_up: you perhaps want to have a look at it?
Author
Owner

@markusamshove commented on GitHub (Apr 28, 2020):

@MarkusAmshove ☝️ you perhaps want to have a look at it?

I’ll give it a try locally 🥳

@markusamshove commented on GitHub (Apr 28, 2020): > @MarkusAmshove :point_up: you perhaps want to have a look at it? I’ll give it a try locally 🥳
Author
Owner

@markusamshove commented on GitHub (May 1, 2020):

I’ve given it a try and this works really well! It covers all the use cases I have in mind 🤗

@markusamshove commented on GitHub (May 1, 2020): I’ve given it a try and this works really well! It covers all the use cases I have in mind 🤗
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2758