Written by marcelpetrick
on January 30, 2019
Most teams have a certain code-review-process. But most of the time there is no “round robin”-implementation who will be the reviewer, but the coder itself should select the reviewer. Because of domain-knowledge, etc. And then you her lots of times “I am currently busy. Not me!”
Solution: random and fair selection via bash.
1 2 3 4 5 6 7 8 |
#!/bin/bash # initialize the array array=(MSA MBH HGA GSC MPE NLE RNI MLA) size=${#array[@]} index=$(($RANDOM % $size)) echo "Mister ${array[$index]} is your candidate as reviewer. Congratulations!" echo "In case you picked yourself - just rerun ;))" |
Current version of the script can be found at: https://github.com/marcelpetrick/bashCollection/blob/master/randomReviewer.sh
Inspired by a stack-overflow answer.