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

Add an option to disallow commiters to approve pull request #7072

Open
MarkusAmshove opened this issue May 29, 2019 · 6 comments
Open

Add an option to disallow commiters to approve pull request #7072

MarkusAmshove opened this issue May 29, 2019 · 6 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@MarkusAmshove
Copy link
Contributor

If there are multiple people committing into a branch which is then used as a source for a pull request it is currently possible for reviewers, who also committed, to approve the changes.

I think it would be valuable if the branch protection had a setting to disallow approval by commiters within the PR, as it is currently the default to disallow approval by the PR author.

@lunny
Copy link
Member

lunny commented May 31, 2019

This has been implemented in branch protection UI to just allow who can approve.

@MarkusAmshove
Copy link
Contributor Author

Is this for 1.9? I can't find a changelog.
We're on 1.8 and if I'm a configured approver (in branch protection) but I did commits to the PR of someone else, I can still approve it

@lunny
Copy link
Member

lunny commented Jun 1, 2019

Did you mean the author of a pull request should not approve himself?

@MarkusAmshove
Copy link
Contributor Author

Repository at try.gitea.io: https://try.gitea.io/prauthor/ApprovalTest

The user PRAuthor is the owner of the repository (password is same as name, all lower case).

Scenario:
PRContrib does some changes in a branch and pushes the branch upstream, while also creating a PR.
Now PRContrib and PRAuthor work together in pair programming at PRAuthors computer.
The commits of the PR now also have a commit of the owner of the repository.
PRAuthor can still approve the changes and merge the PR, as he is in the approvers list.

What I expect in this scenario, is that PRAuthor can't approve the PR and a third person has to do the review.
This would result in the same behavior as it currently is when PRAuthor would have created the PR (can't review your own).

So just to be clear: PRAuthor shouldn't be allowed to approve the PR now :)

@stale
Copy link

stale bot commented Jul 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 31, 2019
@lafriks lafriks added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed reviewed/invalid labels Jul 31, 2019
@stale stale bot removed issue/stale labels Jul 31, 2019
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Jul 31, 2019
@informeti
Copy link

It seems this is still an existing issue in 1.17.1 and I couldn't find any way to configure the behavior.

GitHub, for instance, handles this correctly: Neither the committer, nor the co-author(s) can approve the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants