Gitea: Adding PR Reviews through API

Created on 15 Jan 2019  ·  22Comments  ·  Source: go-gitea/gitea

Hope to add PR comments through API

kinapi kinfeature

Most helpful comment

I'll finaly take it :)

All 22 comments

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.

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

@mojie126 please speak English :(

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".

Also see #5060

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 I think no others will work on this. Maybe you could also add a comment but without approval/rejection

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

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

I'll take a look at this later

What's up with this feature ? :)

dont have time to implement it jet :(

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

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

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

and the github api docs
may help you

I'll finaly take it :)

@6543 thats great!

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

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

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 :)

@MarkusAmshove :point_up: you perhaps want to have a look at it?

@MarkusAmshove :point_up: you perhaps want to have a look at it?

I’ll give it a try locally 🥳

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

Was this page helpful?
0 / 5 - 0 ratings