Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PR Reviews through API #5733

Closed
mojie126 opened this issue Jan 15, 2019 · 22 comments · Fixed by #11224
Closed

Adding PR Reviews through API #5733

mojie126 opened this issue Jan 15, 2019 · 22 comments · Fixed by #11224
Labels
modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Milestone

Comments

@mojie126
Copy link

Hope to add PR comments through API

@zeripath
Copy link
Contributor

zeripath commented 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.

@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. modifies/api This PR adds API routes or modifies them labels Jan 16, 2019
@mojie126
Copy link
Author

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

@lunny
Copy link
Member

lunny commented Jan 16, 2019

@mojie126 please speak English :(

@morph027
Copy link

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
Copy link

morph027 commented May 8, 2019

Also see #5060

@psychomario
Copy link
Contributor

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.

@lunny
Copy link
Member

lunny commented Sep 30, 2019

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

@alexanderadam
Copy link

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

@6543
Copy link
Member

6543 commented Nov 5, 2019

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

@6543
Copy link
Member

6543 commented Nov 5, 2019

I'll take a look at this later

@Tchoupinax
Copy link
Contributor

What's up with this feature ? :)

@6543
Copy link
Member

6543 commented Dec 21, 2019

dont have time to implement it jet :(

@tbe
Copy link
Contributor

tbe commented Jan 25, 2020

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

@6543
Copy link
Member

6543 commented 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
Copy link
Member

6543 commented Jan 25, 2020

and the github api docs
may help you

@6543
Copy link
Member

6543 commented Apr 22, 2020

I'll finaly take it :)

@MarkusAmshove
Copy link
Contributor

@6543 thats great!

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

@6543
Copy link
Member

6543 commented Apr 27, 2020

@MarkusAmshove you can look at #11224 (comment) to see the progress

@6543
Copy link
Member

6543 commented 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
Copy link
Member

6543 commented Apr 28, 2020

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

@MarkusAmshove
Copy link
Contributor

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

I’ll give it a try locally 🥳

@MarkusAmshove
Copy link
Contributor

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

@lafriks lafriks added this to the 1.12.0 milestone May 2, 2020
@lafriks lafriks removed the type/proposal The new feature has not been accepted yet but needs to be discussed first. label May 2, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging a pull request may close this issue.