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

If Required Reviewers is not specified, PR can't be merged at all even it is approved by member of RequiredReviewerGroups #43

Open
indrgun opened this issue Apr 26, 2016 · 0 comments

Comments

@indrgun
Copy link

indrgun commented Apr 26, 2016

If Required Reviewers field is empty, and the Required Reviewers Group(s) is specified, Pull Request can't be merged even if a user in Required Reviewers Group approves it regardless of the specified number of reviews required.

This:

public Set<String> missingRevieiwers(PullRequest pr) {
    Map<String, PullRequestParticipant> map = transformReviewers(pr);
    Set<String> missingReviewers = newHashSet();

    for(String req : concat(config.getRequiredReviewers(), utils.dereferenceGroups(config.getRequiredReviewerGroups()))) {
      if(reviewerIsMissing(map.get(req)) && !(submitterIsRequiredReviewer(pr, req) && exactlyEnoughRequiredReviewers())) {
        missingReviewers.add(req);
      }
    }
    return missingReviewers;
 }

The

!(submitterIsRequiredReviewer(pr, req) && exactlyEnoughRequiredReviewers())

will always be true because exactlyEnoughRequiredReviewers() is always false.

Boolean exactlyEnoughRequiredReviewers() {
    return Objects.equals(config.getRequiredReviewers().size(), config.getRequiredReviews());
  }

it is always false because the size of Required Reviewers is 0 (empty vs. the specified number of reviews required.)

Stash version : v3.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant