request_reviews๐
Note
GitHub does not allow to request more than 15 users or teams for a review.
The request_reviews
action requests reviews from users for the pull
request.
Options๐
Key Name |
Value Type |
Default |
Value Description |
---|---|---|---|
|
Mergify can impersonate a GitHub user to request a review on a pull request.
If no |
||
|
list of string or dictionary of login and weight |
The username to request reviews from. |
|
|
list of string or dictionary of login and weight |
The team names to get the list of users to request reviews from. |
|
|
integer between 1 and 15 |
Pick random users and teams from the provided lists. When
|
|
|
list of string or dictionary of login and weight |
The team name to request reviews from. |
Examples๐
๐ Flexible Reviewers Assignment๐
You can assign people for review based on any criteria you like. A classic is to use the name of modified files to do it:
pull_request_rules:
- name: ask jd to review changes on python files
conditions:
- files~=\.py$
- -closed
actions:
request_reviews:
users:
- jd
You can also ask entire teams to review a pull request based on, e.g., labels:
pull_request_rules:
- name: ask the security team to review security labelled PR
conditions:
- label=security
actions:
request_reviews:
teams:
- "@myorg/security-dev"
- "@myorg/security-ops"
๐ Random Review Assignment๐
It's not fair to ask for the same users or teams to always do the review. You can rather randomly assign a pull request to a group of users.
pull_request_rules:
- name: ask the security team to review security labelled PR
conditions:
- label=security
actions:
request_reviews:
users:
- jd
- sileht
- CamClrt
- GuillaumeOj
random_count: 2
In that case, 2 users from this list of 4 users will get a review requested for this pull request.
If you prefer some users to have a larger portion of the pull requests assigned, you can add a weight to the user list:
pull_request_rules:
- name: ask the security team to review security labelled PR
conditions:
- label=security
actions:
request_reviews:
users:
jd: 2
sileht: 3
CamClrt: 1
GuillaumeOj: 1
random_count: 2
In that case, it's 3 times more likely then the user sileht
will get a pull
request assigned rather than GuillaumeOj
.