Merge Rules
Merge rules are at the core of how the Aviator bot behaves. MergeQueue primarily relies on GitHub Labels to communicate with pull requests. There are several attributes that you can customize for each repository using a yaml configuration file.

Option 1: Dashboard UI

The best option for a quick setup is via the Merge Rules page. However, the UI does not expose all possible customizations.
Some of the Rules listed in the yaml configuration below are not supported in the Dashboard UI. Your repo will require using one of the configuration file options if you want to use advanced rules. We only recommend using the Dashboard UI option if you require a simple setup.
The only required setting is the Label for trigger - this will default to mergequeue. Once you add this to a PR, Aviator will queue and merge the PR.
Label for trigger is the only required setting.
All of the settings in the UI are covered in the Rules section below. Each setting also has a tooltip that provides more information.
Hover over the tooltips for more information.

Option 2: Dashboard Yaml Configuration

On the Merge Rules page, there is a Yaml configuration tab that allows you to both update and validate a configuration file.

Option 3: Create Yaml File within your repository

You can also create a configuration file stored in .mergequeue/config.yml. The file will only be read once it is merged into the repository's default branch. It will also override any properties set in the Dashboard UI. The only required attribute is merge_rules.labels.trigger.
Complete Yaml configuration

Rules

Labels

Attributes
Example
Name
Type
Description
trigger
String
(Required). This label is used to identify that a pull request is ready to be processed by Aviator bot. Once labeled, the bot will verify that the PR has passed all the required conditions and then merge the PR.
skip_line
String
When tagged with this label, Aviator bot will move the PR to the front of the queue.
merge_failed
String
If the pull request fails to merge, Aviator bot will add this label.
skip_delete_branch
String
If delete_branch is enabled, Aviator bot will skip deleting a branch with this label after merging.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
skip_line: "skip_line"
5
merge_failed: "blocked"
6
skip_delete_branch: "do-not-delete"
Copied!

Preconditions

Attributes
Example
Name
Type
Description
number_of_approvals
Integer
Minimum number of reviewers that should approve the PullRequest before it can qualify to be merged. Defaults to 1.
required_checks
List[Union[String, ConditionalCheck]]
Checks that need to pass before Aviator bot will merge the PR. Also supports other acceptable CI statuses if your repo uses conditional status checks. See the Example tab.
use_github_mergeability
Boolean
Determines whether to use the default required checks specified in branch protection rules on GitHub. When this setting is enabled, Aviator bot will ignore required_checks. Defaults to true.
conversation_resolution_required
Boolean
Determines whether Aviator bot will queue the PR only after all conversations are resolved.
validations
List[Validation]
Custom validation rules using regexes for the PR body or title. See the Example tab for more details.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
preconditions:
5
number_of_approvals: 1
6
required_checks:
7
# Note: both a string or a more detailed conditional check is accepted
8
# for conditional_check, both skipped and success are considered passing
9
- check_1
10
- name: conditional_check
11
acceptable_statuses:
12
- skipped
13
- success
14
use_github_mergeability: true
15
conversation_resolution_required: false
16
validations:
17
- name: missing JIRA ticket in PR title
18
match:
19
type: title
20
regex:
21
- -\s\[[^\]]*\]
22
- ()
23
- name: validation_body
24
match:
25
type: body
26
regex:
27
- -\s\[[^\]]*\]
Copied!

Merge Modes

Name
Type
Description
type
String
Determines the mode. Options are: default, parallel, no-queue.

Parallel Mode

The following are only applicable if the above merge_mode is set to parallel. You can learn more about Parallel Mode here.
Attributes
Example
Name
Type
Description
max_parallel_builds
Integer
The maximum number of builds that Aviator bot will run at any time. Defaults to no limit.
max_requeue_attempts
Integer
The maximum number of times Aviator bot will requeue a CI run after failing. Note that PRs will only be requeued if the original PR CI is passing but the draft PR CI fails. Defaults to no requeuing.
stuck_pr_label
String
The label that Aviator bot will add if it determines a PR to be stuck.
stuck_pr_timeout_mins
Integer
Aviator bot will determine the PR to be stuck after the specified timeout and dequeue it. Defaults to no time out.
block_parallel_builds_label
String
Once added to a PR, no further Draft PRs will be built on top of it until that PR is merged or dequeued.
check_mergeability_to_queue
Boolean
If enabled, Aviator bot will only queue the PR if it passes all mergeability checks. Defaults to false.
use_affected_targets
Boolean
If enabled, allows using affected targets in your repo.
use_fast_forwarding
Boolean
If enabled, uses fast forwarding to merge PRs.
override_required_checks
List[String]
Use this attribute if you would like different checks for your original PRs and draft PRs. The checks defined here will be used for the draft PRs created in Parallel mode.
batch_size
Integer
The number of queued PRs batched together for a draft PR CI run. Defaults to 1.
batch_max_wait_minutes
Integer
The time to wait before creating the next batch of PRs if there are not enough queued PRs to create a full batch. Defaults to 0.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
merge_mode:
5
type: "parallel" # other modes: "default", "no-queue"
6
parallel_mode:
7
use_affected_targets: false
8
use_fast_forwarding: true
9
max_parallel_builds: 10
10
max_requeue_attempts: 3
11
stuck_pr_label: "label"
12
stuck_pr_timeout_mins: 90
13
block_parallel_builds_label: "block_batch"
14
check_mergeability_to_queue: false
15
override_required_checks:
16
- "check 1"
17
- check_2
Copied!

Auto Update

Attributes
Example
Name
Type
Description
enabled
Boolean
If enabled, Aviator bot will keep your branches up to date with the main branch. Defaults to false.
label
String
Aviator bot will only keep branches with this label up to date with the main branch. Leave empty to auto merge without a label. If no label is provided and auto_update is enabled, by default the Aviator bot will update all PRs.
max_runs_for_update
Integer
The maximum number of times Aviator bot will update your branch. Defaults to no limit.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
auto_update:
5
enabled: true
6
label: "auto_update"
7
max_runs_for_update: 10
Copied!

Merge Commit

Attributes
Example
Name
Type
Description
use_title_and_body
Boolean
Determines whether Aviator bot will replace default commit messages offered by Github. Defaults to false.
cut_body_before
String
A marker string to cut the PR body description. The commit message will contain the PR body after this marker. Leave empty for no cropping.
cut_body_after
String
A marker string to cut the PR body description. The commit message will contain the PR body before this marker. Leave empty for no cropping.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
merge_commit:
5
use_title_and_body: true
6
cut_body_before: "----"
7
cut_body_after: "+++"
Copied!

Merge Strategy

Name
Type
Description
name
String
Defines the merge strategy to use, the options are "squash", "merge", and "rebase". See the Github docs for more info.

Override Labels

You can specify overrides to the above merge strategy using Github Labels. When a PR is flagged with these labels along with the trigger label, Aviator bot will merge the PR using this strategy instead of the default strategy. Leave empty for no overrides.
Attributes
Example
Name
Type
Description
squash
String
If marked with this label, the PR will be squashed and merged.
merge
String
If marked with this label, the PR will be merged using a merge commit.
rebase
String
If marked with this label, the PR will be rebased and merged.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
merge_strategy:
5
name: "squash"
6
override_labels:
7
squash: "mq-squash"
8
merge: "mq-merge-commit"
9
rebase: "mq-rebase"
Copied!

Other

Attributes
Example
Name
Type
Description
update_latest
Boolean
Determines whether Aviator bot will merge the latest base branch into the current branch of your PR before verifying the CI statuses. Defaults to true.
delete_branch
Boolean
Determines whether Aviator bot will delete the branch after merging. Defaults to false.
use_rebase
Boolean
Determines if Aviator bot will use rebase to update PRs. This feature is only available in the Pro plan. Please note that you also need to enable update_latest for rebase to work. Defaults to false.
enable_comments
Boolean
Determines if Aviator bot can add comments on the PR to describe the actions performed on the PR by the bot. Aviator bot comments include information such as failure reasons and the position of the PR in the queue. Defaults to true.
ci_timeout_mins
Integer
The time before we determine that the CI has timed out. Defaults to no time out.
base_branches
List[String]
These branches are the ones that Aviator will monitor as valid branches to merge into. Defaults to only main/master. Regexes are allowed.
1
merge_rules:
2
labels:
3
trigger: "label_name"
4
update_latest: true
5
delete_branch: false
6
use_rebase: false
7
enable_comments: true
8
ci_timeout_mins: 60
9
base_branches:
10
- master
11
- /release-*/
Copied!