gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Delete review requests as non-admin

Open jpraet opened this issue 4 years ago • 12 comments

  • Gitea version (or commit ref): 1.14
  • Can you reproduce the bug at https://try.gitea.io:
    • [X] Yes

Description

When I request a review, I am not able to delete this review request if I am no administrator. I would expect at least to be able to delete a review request I created myself in case I selected the wrong person by accident. But I think even someone else should be able to delete the review request as well. Everyone that can add reviewers should also be able to delete them in my opinion?

Screenshots

I add a review request:

image

But I cannot delete it:

image

Unless when I am admin:

image

jpraet avatar Jan 25 '21 19:01 jpraet

That's follow github style. see: https://github.com/go-gitea/gitea/pull/10756#discussion_r396892580

a1012112796 avatar Jan 26 '21 13:01 a1012112796

That's follow github style. see: #10756 (comment)

My understanding may be wrong. But to me it seems like the comment refers to review requests that have already been processed, i.e. approved or rejected by the reviewer. This issue mentions a pending review request.

I agree with jpraet that the person who requested the review should be able to delete the review request as long as it's not more than a request. What would be the reason do deny this?

PaulBol avatar Dec 09 '22 09:12 PaulBol

I want to create a PR to allow the person who requested the review to be able to delete the review request. But it looks like I cannot easily determine the author of the review request. It's not stored in the review table.

Would a PR get accepted that allows review request deletion to anyone that has permission to add review requests?

jpraet avatar Jan 14 '23 10:01 jpraet

Any news on this? Just landed here and would support such a change. @jpraet did you ever hear back from anyone?

jbartlau avatar May 08 '23 10:05 jbartlau

Maybe we can accept the person himself could remove the review request? Or everyone who have write permission to pull request could do that since the removal will be recorded in the comment timeline.

lunny avatar May 08 '23 10:05 lunny

everyone who have write permission to pull request could do that

That would totally suffice and was indeed what I had expected. And you could even restrict this to reviews that have not yet started. Our use case would be to assign a different reviewer if the originally requested reviewer is not available (e.g. vacation).

jbartlau avatar May 08 '23 11:05 jbartlau

Looks like the code is there, but I don't know whether there are some bugs.

https://github.com/go-gitea/gitea/blob/main/routers/web/repo/issue.go#L634-L644

lunny avatar May 09 '23 10:05 lunny

this would be great, i have opened a pr in gitea, accidentally assigned a reviewer, then i cannot remove the reviewer,

i have had pr's get stuck because i added a reviewer who may be away from their computer for a long time and this completly blocks the merge (merge when all checks pass but an accidentally requested reviewer will always block)

KevinBaileyCrum avatar Jul 06 '23 18:07 KevinBaileyCrum

Looks like the code is there, but I don't know whether there are some bugs.

https://github.com/go-gitea/gitea/blob/main/routers/web/repo/issue.go#L634-L644

https://github.com/go-gitea/gitea/blob/e962ade99cfd0471273f3dcf956c7cd222472758/routers/web/repo/issue.go#L634-L644

Which part of that code should allow me to remove a reviewer as long as I'm able to add it back?

aleb avatar Sep 22 '23 08:09 aleb

The actual validation check seems to be in IsValidReviewRequest() at https://github.com/go-gitea/gitea/blob/main/services/issue/assignee.go#L157 (called from UpdatePullReviewRequest() at https://github.com/go-gitea/gitea/blob/main/routers/web/repo/issue.go#L2475), and only allows you to remove yourself, unless you're an admin. This seems unnecessarily restrictive to me too.

hawicz avatar Jan 31 '24 20:01 hawicz

How about everyone who is a member of that repository with read-permissions can add/remove reviewer requests of every pull requests and the PR creators can also do that for their created PRs? If nobody against, I will send a PR to fix that.

lunny avatar Feb 02 '24 12:02 lunny

I think that is a good idea, if you opened the PR and you assigned someone, you should have the ability to remove them.

On Fri, Feb 2, 2024 at 4:55 AM Lunny Xiao @.***> wrote:

How about everyone who is a member of that repository with read-permissions can add/remove reviewer requests of every pull requests and the PR creators can also do that for their created PRs? If nobody against, I will send a PR to fix that.

— Reply to this email directly, view it on GitHub https://github.com/go-gitea/gitea/issues/14459#issuecomment-1923749566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBKWM3VLX6BFUYCH3Z2JKDYRTO5NAVCNFSM4WSG5AY2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJSGM3TIOJVGY3A . You are receiving this because you commented.Message ID: @.***>

KevinBaileyCrum avatar Feb 02 '24 17:02 KevinBaileyCrum