Version Control and Collaboration
abstract
When working on any big software project, we need version control of automation artifacts. Version Control allows individuals to work independently with their own copy of files/artifacts
and prevents overwriting or clobbering another person's work. It also helps us associate specific artifacts with specific versions of the application under test.
We recommend using Git for version control.
We recommend using Git for version control.
Flowcharts on the Filesystem
-
When we create flowcharts, all the information about the flowchart project is stored as plain text (json or csv) files on the file system.
The path to the files is<sahipro>/userdata/scripts/flowchartsdata/<project_name>
. -
You can open the
flowchartsdata
folder from the Flowcharts UI by clicking on the folder icon on the Projects page. -
You can also click on the
Scripts Folder
icon on the Dashboard and then navigate toflowchartsdata
folder. -
We recommend adding the entire userdata folder to your version control system (VCS) since it contains all configurations,
script files and other user specific data.
Files and folders which need to be excluded are already added in a .gitignore file.
If you are using any other VCS, adapt from the .gitignore file accordingly.
info
Check if
.gitignore
file is present in your project folder
<sahipro>/userdata/scripts/flowchartsdata/<project_name>
.
If not present, copy <sahipro>/userdata/config/flowcharts.gitignore
file to
<sahipro>/userdata/scripts/flowchartsdata/<project_name>
directory.
Rename the copied file as .gitignore
. Likewise, copy <sahipro>/userdata/config/flowcharts.gitattributes
file as
<sahipro>/userdata/scripts/flowchartsdata/<project_name>/.gitattributes
file.
Merge Conflict in Flowcharts
Merge conflicts may arise when two users have changed the same content in an artifact. They can also occur when one user deletes an artifact while another user is modifying it.Identifying Merge Conflict
Following are ways to identify a merge conflict:-
From Project List Page:
On the Project List page, merge conflicts can be identified by checking for the following indicators:- Number of projects that have merge conflicts.
- Specific project that has merge conflicts.
- Show only projects that have merge conflicts.
-
From Project Details Page:
On a Project Details page, merge conflicts can be identified by checking for the following indicators:- Number of specific artifacts those have merge conflict.
- Project level merge conflict. (for flowchart/ddcsv tags and execution order, filters)
- Particular artifact that has merge conflict.
- Show only artifacts that have merge conflicts.
-
From Flowchart Page:
On a Flowchart page, merge conflicts can be identified by checking for the following indicators:- Particular flowchart that has a merge conflict.
-
From Automate Dialog:
On an Automate dialog, merge conflicts can be identified by checking for the following indicators:- Number of specific artifacts those have merge conflict.
- Particular artifact that has a merge conflict.
infoIf any artifact or project has merge conflicts, then that artifact or project will not be editable.
Resolving Merge Conflict
The artifacts in Sahi Pro Flowcharts inherently follow a noticeable hierarchical structure. Each Project consists of one or multiple flowcharts. Every Flowchart will have reference to multiple entities, screens, etc. Consequently, in Diff-Merge UI, if there is a conflict for an artifact, conflicts would also exist for for the references of this artifact.Lets say, there is a conflict for an Entity $user. Consequently, there may be a conflict inside Keyword 'Login $user' where this Entity $user is referred. In such a case, it would be linear to resolve the conflict in the Entity before resolving conflicts in the Keyword.
Conforming to this, it is recommended to resolve merge conflict in the following order:
- Project
- Flowchart
- Entity
- Screen
- Keyword
- DataSet
Below we have examples to resolve merge conflicts at the Flowchart level:
-
Open the flowchart that has merge conflicts. Click on Merge Conflict icon
near flowchart name to open Diff & Merge UI. This Diff & Merge UI shows a comparison between the
Local
andRemote
Head version of the flowchart. Merge conflicts information can be identified by checking for following indicators:- The Total number of merge conflicts.
- The Different types of merge conflict changes
- The
Keep All Left
option provides a quick way to resolve conflicts by prioritizing changes from the left side. However, it's essential to use this option judiciously and carefully review potential data loss. - The
Use All Right
option provides a quick way to resolve conflicts by prioritizing changes from the right side. However, it's essential to use this option judiciously and carefully review potential data loss. - The
Keep All Conflict
option provides a quick way to revert all resolved changes, effectively moving the merge back to a conflicted state.
Hovering the mouse over a specific change on one side will highlight the respective change on the other side.
-
By default, changes from the Local version will be chosen. To choose a specific version, hover over the specific change on the left side. When you hover the
Diff Menu
will be visible. Select the required option from theDiff Menu
.
info In situations where theUse Both
option is not applicable, only theKeep Left Version
,Use Right Version
andConflict
options will be visible.
The Conflict option also shows Type of Conflict(modified, added, removed)
present on a specific change. -
Once a conflict is resolved, the
conflict icon
associated with that conflict will change to the selected resolved state icon.
A Merge conflict can have five states:- Conflict state
- Keep Left Version: Keep the left side change, ignore the right side change.
- Use Right Version: Keep the right side change, ignore the left side change.
- Use Both: Left + Right: Keep changes from both sides in order of Left side changes first then Right side changes.
- Use Both Right + Left: Keep changes from both sides in order of Right side changes first then Left side changes.
info If a node has multiple branches in remote version but that node does not have few of these branches in the local version, a conflict occurs. Similarly, a conflict occurs if a node has multiple branches in the local version but the node does not have few of these branches in the remote version. You can resolve such conflicts using the Branch Diff Icon at bottom-center side of this node. - Conflict state
-
Once all merge conflicts are solved, click on
Save
button to save the changes to file system. -
Optionally, you can also compare the saved changes with the Local or Remote Head version.
To do this comparison, refresh the flowchart page and click on
Compare With
button:-
To compare with the Local Head version, click on
Local Head
under theCompare With
dropdown. This will show the comparison between the Current system version and the Local Head version. -
To compare with the Remote Head version, click on
Remote Head
under theCompare With
dropdown. This will show the comparison between the Current system version and the Remote Head version. -
Click on
Save
button to save the changes to file system. -
After solving all the merge conflicts, click on
Mark as Resolved
button.
-
To compare with the Local Head version, click on
-
In your
Git
client application, commit the changed files.
infoSimilarly, merge conflicts can be solved for
Keyword
, Entity
, Screen
and DataSet
. warningResolving merge conflicts in flowcharts depends on various factors such as version control settings, the project's structure and modularity, and bad practices while managing conflicts. Thus, at times it may not be feasible to resolve merge conflicts using the Diff-Merge UI.