Mergebots (beta)
A mergebot is a tool that you can use to automate parts of your merge process. Mergebots check that a merge request meets specified conditions before it merges into your destination branch. This automation can help you can work faster and reduce room for errors.
For example, you can set up a mergebot to automate the following tasks:
- Check merge request review statuses and merge conflicts.
- Use individual status parameter attributes and values to trigger a merge request automatically.
- Re-queue merge requests that fail due new changes in the destination branch.
- Notify team members of successful merges and trigger external tools.
For information on how to set up a mergebot, refer to Create a mergebot. For a full tutorial on how to create a Trunk bot, refer to the Create a mergebot Unity Learn tutorial.
Note: In beta, you can create and use only one mergebot.
Mergebot configuration
Branch configuration
The Destination branch that you select is the branch that a trunk bot merges task branches into, and the branch that a conflicts bot checks for merge conflicts. The destination branch is usually your main branch.
You can enter a specific Branch prefix to further filter the branches that your mergebot processes. [what format?]
Types of mergebot
Mergebot type | Description |
---|---|
Trunk bot | A trunk bot automatically merges task branches into your destination branch. You can further configure your trunk bot behavior and which branches the trunk bot processes. You can also set up an integration to automatically trigger builds. |
Conflicts bot | A conflicts bot automatically detects merge conflicts on task branches before you merge your changes. |
Status parameters
Mergebots use a branch's status attribute to detect which branches the mergebot should process. You can edit the attribute name according to your workflow.
Status parameter | Default value | Description |
---|---|---|
Status attribute | status | The name of the attribute that the mergebot detects to process a branch. |
Resolved value | resolved | The mergebot processes branches with this attribute value. |
Failed value | failed | When a merge fails, the mergebot sets the status attribute to failed . |
Merged value | merged | When a merge completes, the mergebot sets the status attribute to merged . |
Testing value | testing | A test value for the status attribute. |
Trunk bot options
The following configuration options are only available for a trunk bot.
Field | Description |
---|---|
Only process reviewed branches | This option ensures that the mergebot only merges reviewed branches. |
Re-enqueue branches that failed due to detected changes in the destination branch | This option ensures that when the destination branch has new changes, the mergebot re-queues a merge to include the new changes. |
Label merged changeset | This option ensures that the mergebot labels all merged changesets. You can then enter a Label pattern to define what label the mergebot adds. For example, LABEL.${AUTO_INCREMENT_NUMBER}_${BUILD_DATE_FORMATTED, yyyy-MM-dd} adds a label in this format: LABEL.128.2018-10-23 . |
Advanced settings
CI integration
You can set up Continuous Integration (CI integration) so that your trunk mergebot triggers a build when it merges changes. The mergebot integrates with Jenkins, Bamboo, and Team City.
To set up a CI integration, you need the base URL of your system server, and your username and password to connect to the platform system.
Note: CI integration is only available for trunk bots.
Notifier integration
You can add a Notifier integration to both conflict and trunk mergebots so that the mergebot can send users status notifications. You can send notifications through either Slack or email.
To use Slack, you need your Slack Token to connect to the Slack API. To use Email, you need the sender email address and password. You also server URL and port of the SMTP server that you want to use to send the emails.