Commit 6844ba2d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '60035-weight-trainee-maintainers-higher-in-reviewer-roulette' into 'master'

Resolve "Weight trainee maintainers higher in reviewer roulette"

Closes #60035

See merge request gitlab-org/gitlab-ce!27043
parents 10cd5fdb dea11717
......@@ -31,13 +31,15 @@ MARKDOWN
def spin(team, project, category)
reviewers = team.select { |member| member.reviewer?(project, category) }
traintainers = team.select { |member| member.traintainer?(project, category) }
maintainers = team.select { |member| member.maintainer?(project, category) }
# TODO: filter out people who are currently not in the office
# TODO: take CODEOWNERS into account?
reviewer = reviewers[rand(reviewers.size)]
maintainer = maintainers[rand(maintainers.size)]
# Make traintainers have triple the chance to be picked as a reviewer
reviewer = (reviewers + traintainers + traintainers).sample
maintainer = maintainers.sample
"| #{helper.label_for_category(category)} | #{reviewer&.markdown_name} | #{maintainer&.markdown_name} |"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment