wpt-pr-bot
wpt-pr-bot copied to clipboard
wpt-pr-bot can assign a PR to the author if they 'reviewed' it last
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...