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.

Flowcharts on the Filesystem

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:
  1. From Project List Page:

    On the Project List page, merge conflicts can be identified by checking for the following indicators:
    1. Number of projects that have merge conflicts.
    2. Specific project that has merge conflicts.
    3. Show only projects that have merge conflicts.
    These indicators are highlighted in the below image.
  2. From Project Details Page:

    On a Project Details page, merge conflicts can be identified by checking for the following indicators:
    1. Number of specific artifacts those have merge conflict.
    2. Project level merge conflict. (for flowchart/ddcsv tags and execution order, filters)
    3. Particular artifact that has merge conflict.
    4. Show only artifacts that have merge conflicts.
    These indicators are highlighted in the below image.
  3. From Flowchart Page:

    On a Flowchart page, merge conflicts can be identified by checking for the following indicators:
    1. Particular flowchart that has a merge conflict.
    These indicators are highlighted in the below image.
  4. From Automate Dialog:

    On an Automate dialog, merge conflicts can be identified by checking for the following indicators:
    1. Number of specific artifacts those have merge conflict.
    2. Particular artifact that has a merge conflict.
    These indicators are highlighted in the below image.
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:
  1. Project
  2. Flowchart
  3. Entity
  4. Screen
  5. Keyword
  6. DataSet


Below we have examples to resolve merge conflicts at the Flowchart level:
  1. 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 and Remote Head version of the flowchart. Merge conflicts information can be identified by checking for following indicators:
    1. The Total number of merge conflicts.
    2. The Different types of merge conflict changes
    3. 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.
    4. 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.
    5. 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.

  2. 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 the Diff Menu.
    info In situations where the Use Both option is not applicable, only the Keep Left Version, Use Right Version and Conflict options will be visible.
    The Conflict option also shows Type of Conflict (modified, added, removed) present on a specific change.
  3. 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 Diff State
    • Keep Left Version: Keep the left side change, ignore the right side change. Diff State
    • Use Right Version: Keep the right side change, ignore the left side change. Diff State
    • Use Both: Left + Right: Keep changes from both sides in order of Left side changes first then Right side changes. Diff State
    • Use Both Right + Left: Keep changes from both sides in order of Right side changes first then Left side changes. Diff State
    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.
  4. Once all merge conflicts are solved, click on Save button to save the changes to file system.
  5. 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:
    1. To compare with the Local Head version, click on Local Head under the Compare With dropdown. This will show the comparison between the Current system version and the Local Head version.
    2. To compare with the Remote Head version, click on Remote Head under the Compare With dropdown. This will show the comparison between the Current system version and the Remote Head version.
    3. Click on Save button to save the changes to file system.
    4. After solving all the merge conflicts, click on Mark as Resolved button.
  6. 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.