Change reviewer roulette to always pick the same reviewers for the same
branch name. We do this by:
1. Making the branch name 'canonical' across CE and EE by stripping a
leading 'ce-' or 'ee-' and a trailing '-ce' or '-ee'. If people are
following our branch naming guidelines, this should give the same
branch name in both repos.
2. Converting the branch name to a stable integer by taking the integer
form of its MD5.
3. Passing that integer as a seed to Ruby's `Random` class, which 'may
be used to ensure repeatable sequences of pseudo-random numbers
between different runs of the program' (from the Ruby documentation).
The upshot is that the same branch name (in CE and EE) should always
pick the same reviewers, and those should be evenly distributed across
the set of possible reviewers due to the use of MD5.
Trainee maintainers count as reviewers, but should get more reviews than
most reviewers, as they need practice to become a maintainer. This makes
them three times as likely to be picked (compared to another reviewer;
compared to before, it's roughly twice as likely at the current numbers
for each).
Also, switch to `Array#sample` because I think it looks nicer.
This extends Danger so it informs MR authors that single codebase merge
requests need to be approved by a specific group of engineers.
Co-authored-by: Yorick Peterse <yorickpeterse@gmail.com>
Make danger pick reviewers and maintainers at random, for feontend,
backend, database, etc, changes, whenever files belonging to those
teams get changed.