A less confusing approach to count approvals required for protected branches (OD-120)
Michael Weimann opened 6 years ago

In my project I face the following problem:

  • I am in the Reviewer Group defined by a protected branch of the project
  • If I open a PR I am in the reviewer list as well
  • I can confirm my own PR

What I want to achieve is that another person has to do the review.
So far I couldn't find out how to configure it. Is this possible?

  • Robin Shen commented 6 years ago

    If required reviewer of the protected branch is specified as a group containing yourself and some other persons, OneDev will only add other person as reviewer for your own pull requests. Are you observing different behavior? If so, please attach screenshot of the branch protection setting.

  • Michael Weimann commented 6 years ago

    Are you observing different behavior?

    Nope - while creating it it is fine.

    I investigated further:

    • I was the only one in the group. So OneDev chose me
    • But if there are other users I am still able to remove the other reviewers and add myself. That means I can trick the system to approve my own code changes. This is not good because I want a mandatory peer review.
  • Robin Shen commented 6 years ago

    This can be solved by requiring at least two reviewers from the group. For instance if review requirement is specified as group(reviewers):2, for any pull request pushing to protected branches, two persons from reviewer group will be required to approve it:

    1. If the submitter is already a member of group reviewers, only one other reviewer is required as submitter already counts as a reviewer
    2. If the submitter is not a member of group reviewers, two reviewers will be required
  • Michael Weimann commented 6 years ago

    Okay. This is tricky ;)

    Maybe it should be documented somewhere that the submitter counts as a reviewer?

  • Robin Shen commented 6 years ago

    Agreed that this is counter-intuitive. Will think about a less confusing approach...

  • Robin Shen batch edited 6 years ago
    Name Previous Value Current Value
    Iterations
    empty
    3.1.2
  • Robin Shen changed title 6 years ago
    Previous Value Current Value
    How to disallow myself being in PR reviewer list opened by myself?
    A less confusing approach to count approvals required for protected branches
  • Robin Shen changed fields 6 years ago
    Name Previous Value Current Value
    Type
    Support Request
    Improvement
  • OneDev changed state to 'Closed' 6 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev changed state to 'Released' 6 years ago
    Previous Value Current Value
    Closed
    Released
issue 1/1
Type
Improvement
Priority
Normal
Assignee
Iterations
Issue Votes (0)
Watchers (2)
Reference
OD-120
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover