Select users depending on the subject of the MR
Some MR could be reviewed by some on the infra documentation I would Some MRs can't be reviewed without some prerequisites. For example I have been marked as reviewer on a MR on our infrastructure documentation. Maybe we could select user depending on some conditions. We could for example add a key "exclude tags" in the user preferences :
alice:
max_auto_review_per_week: 15
max_auto_review_per_day: 3
exclude_tags: ["js", "magic"]
bob:
max_auto_review_per_week: 15
max_auto_review_per_day: 5
exclude_tags: ["k8s", "magic"]
harry:
max_auto_review_per_week: 12
max_auto_review_per_day: 3
exclude_tags: ["js", "k8s"]
hermione:
max_auto_review_per_week: 500
max_auto_review_per_day: 100
When a MR is created with the "k8s" tag:
- the user list is split in two lists :
["alice", "hermione"] and ["bob", "harry"]
- the two lists are suffled and then concatenated:
["hermione", "alice", "bob", "harry"]
- if the first user of the list has not reached its limit, assign him/her as reviewer, otherwise drop him/her and repeat