When working collaboratively on tests and flows across different branches, it’s important to understand how to safely resolve conflicts and merge branches to avoid accidental overwrites.
This article explains how to manage branches in mabl, including how to:
Resolve conflicts
Before you merge a test branch into master, open the branch details view to make sure there are no merge conflicts.
The branch details view
The branch details view provides a summary of tests and flows on the branch. If there is a red exclamation icon in the Conflicts column for a given test or flow, someone has made updates to the master branch of a test or flow since the last version on the test branch was saved.
If you merge the branch without resolving these conflicts, the test version will overwrite the master version. To safely resolve conflicts, click on the red exclamation icon to open the conflict resolution view.
Limitation
API tests do not support conflict resolution.
The conflict resolution view
The conflict resolution view appears as a three-columned table with the following sections:
- Master version: steps appear in red if they don’t exist on the test branch.
- New version: a space to create the new version that you will save to your test branch before merging.
- Test branch version: steps appear in green if they don’t exist on the master branch.
Steps that appear in white exist on the master and test branch version, and you cannot change them.
Create a new version
To create a new version, click on the arrows to move steps and flows into the new version column.
If there are conflicts in data-driven variables and flow parameters, the conflict resolution view also includes options for selecting the variables or values you’d like to use in the new version.
Preview the new version
When you’re satisfied with the steps, variables, and parameters selected for the new version, click Preview to check over the final version. You may return to the previous editing page and make changes if needed.
If everything looks correct, click Save to create the new version on the test branch.
Merge a branch
To merge a branch into master, click on the Merge button on the branch details page.
If you see a merge conflict warning, it indicates that someone has made updates to tests and/or flows on the master branch since the last version on the test branch was saved.
- To safely resolve these issues and avoid unintended overwrites, click Cancel and follow the steps for conflict resolution.
- To continue with the merge and overwrite the master version, click Merge anyway.
A merge conflict warning
Once a branch is merged, you cannot reopen it or run tests against the merged branch. If you need to revert to a previous version for a specific test or flow, follow the steps outlined in the section on reverting a merge.
Merging limitations
Note the following differences and limitations with merging:
- The mabl Desktop App only supports merging from a test branch to the master branch. You cannot merge changes to another test branch in the Desktop App.
- The mabl CLI supports merging from a test branch to any branch. However, unlike the Desktop App, the mabl CLI does not check for merge conflicts. If there are merge conflicts, the mabl CLI overwrites the version on the branch that you are merging to.
Revert a merge
Sometimes the merged version of a test or flow results in unintended consequences. While it is not possible to reopen all of the tests and flows on a branch in the previous version, you can take the following steps to restore a specific test or flow to an earlier version:
- Go to the details page of the test or flow that you wish to revert.
- Click on the Change history tab.
- Select the older version that you wish to revert to.
- Click on the Save as latest version button.
This action effectively creates a new version of the test or flow that contains the same information as the desired version. This process must be done separately for each merged test and flow that you wish to revert.
Delete a branch
After a branch is merged to master, it still appears on the branches page. To delete a branch, click on the trash icon next to it.
Once you delete a branch, it cannot be recovered.