Advanced Review Settings

How to use review settings and advanced review settings

About Advanced Settings rules

PullRequest makes it easy to automate which pull or merge requests are sent to our network by default, which are restricted, and which are canceled if a certain state is detected.

These configuration rules can be applied to the Organization-level (all connected repositories) and for specific repositories.

Examples:

  • Automatically send to PullRequest if the author matches "JohnDoe"

  • Automatically cancel PullRequest review if a commit message contains "final"

  • Don't send to PullRequest if the base branch matches "main"

These settings are evaluated in a configurable, descending order.

How to configure Advanced Review Settings rules

For all repositories in your Organization

With your Organization selected, click Settings -> Review Settings -> Advanced Settings

For a specific repository in your Organization

Select a Project -> Project Settings -> Advanced Settings

For transparency, any rules applied to the Organization-level will be visible here so it's easier to view the full evaluation criteria. Though visible, Organization-level rules cannot be edited here.

Adding an evaluation criteria rule

Clicking the Add rule or Add another rule will render a prompt where you can add evaluation criteria.

See Supported rules below for details on each available option.

Default Behavior

If none of the criteria defined by the rules are met, whether or not a pull or merge request is sent to the network to be reviewed will depend on the basic Review Settings.

If configured to Automatically send pull requests to the network, it will be sent to the network to be reviewed by default. This is the best approach if you wish to have most of your pull or merge requests reviewed by our engineers with a few exceptions.

If configured to I'll manually select individual pull requests, it will not be sent to the PullRequest network by default. This is the best approach if you wish to have most of your pull or merge requests withheld from being reviewed by our engineers, but in some circumstances, you'll always want them reviewed if they match a predictable condition.

Manual Override

You can always override these settings by canceling or sending a review to the network manually from the PullRequest dashboard.

Supported Rules and Operations

Conditions and Operations

There are 2 types of arguments in Advanced Reviewer Settings rules. The first is the Operation:

Operations:

There are 3 types of operations, if a condition evaluates to true the operation will execute and evaluation with stop for that PR.

  • Don't send to PullRequest: This operation will prevent PRs from being sent to the network if a condition is met. This rule should be primarily used in the case that the project or org has most repositories set to auto-send. Note: This type of operation is most useful when paired with rules such as .

  • Automatically send to PullRequest: This operation will send to the network if the repository default setting is manual and a condition is met.

  • Automatically cancel PullRequest: This operation will cancel an active request that has already been sent to the network or (this effectively operates as a don't send pull request command) if the repository default settings is automatic and the condition is met.

Conditions:

The following is a list of the conditions that can be checked and cause operations to execute.

Field

Comparators

Example

Title

matches

does not match

contains

does not contain

Automatically send to PullRequest if the title contains "JIRA"

Description

matches

does not match

contains

does not contain

Don't send to PullRequest if the description contains "no review needed"

Head branch

matches

does not match

contains

does not contain

Automatically send to PullRequest if the head branch contains "feature"

Base branch

matches

does not match

contains

does not contain

Don't send to PullRequest if the base branch matches "main"

Author

matches

does not match

contains

does not contain

belongs to team [3]

does not belong to team [3]

Automatically send to PullRequest if the author name matches "JohnDoe"

Is a draft [1]

= true

= false

Don't send to PullRequest if the pull request is a draft

Created

after MM/DD/YYYY HH: MM AM/PM

before MM/DD/YYYY HH: MM AM/PM

Don't send to PullRequest if the review was created before 2020-01-01 12:00

Label

matches

does not match

contains

does not contain

Cancel PullRequest if the label matches "no-pullrequest"

Commit message

matches

does not match

contains

does not contain

Automatically send to PullRequest if the commit message does not contain "work in progress"

Commit author name

matches

does not match

contains

does not contain

Don't send to PullRequest if the commit author name matches "JohnDoe"

Comment message

matches

does not match

contains

does not contain

Automatically send to PullRequest if the commit message contains "needs review"

Comment author name

matches

does not match

contains

does not contain

Don't send to PullRequest if the comment author name matches "JohnDoe"

Summary comment message

matches

does not match

contains

does not contain

Automatically send to PullRequest if the summary commant message contains "Needs PullRequest review"

Summary comment author name

matches

does not match

contains

does not contain

Automatically send to PullRequest if the summary comment author name matches "JohnDoe"

Diff line count

=

>

<

≤ ≥

Don't send to PullRequest if the diff line count is less than 10.

Any diff file path

matches

does not match

contains

does not contain

Don't send to PullRequest if any diff file path contains "legacy"

All diff file paths

matches

does not match

contains

does not contain

Don't send to PullRequest if all diff file path contains "legacy"

Percentage of commits already reviewed

=

>

<

≤ ≥

Don't send to PullRequest if the percentage of commits already reviewed is greater than 90

Review cost for the month [2]

=

>

<

≤ ≥

Don't send to PullRequest if review costs for the month have exceeded your specified budget

[1] - The "Is draft" field is only applicable for source control services that provide "Draft" features such as GitHub's Drafts.

[2] - The "Review cost for the month" field is only applicable for teams with usage-based billing. This field does not apply for teams billed on a per-seat subscription basis.

[3] - Currently, PullRequest only supports author-based Team membership rules for GitHub Teams.

Last updated