wpt-pr-bot icon indicating copy to clipboard operation
wpt-pr-bot copied to clipboard

wpt-pr-bot can assign a PR to the author if they 'reviewed' it last

Open stephenmcgruer opened this issue 5 years ago • 0 comments

This just happened in https://github.com/web-platform-tests/wpt/pull/21194#event-2982388384

I believe what happened is in lib/metadata/choose-assignee.js, there is the following code:

    // Check for existing reviews and grab the reviewer who "touched it last".
    var reviews = metadata.reviews;
    if (reviews && reviews.length) {
      return reviews[reviews.length - 1].user.login;
    }

    var reviewers = metadata.reviewersExcludingAuthor;
    if (reviewers.length) {
      var index = Math.floor(Math.random() * reviewers.length);
      return reviewers[index].login;
    }

The first conditional fails to make sure that the user.login it chooses is not in metadata.reviewersExcludingAuthor...

stephenmcgruer avatar Jan 27 '20 16:01 stephenmcgruer