Git Pull Issue with Local Commits in ReadyAPI |
We identified an issue in ReadyAPI 3.57.0 where pulling changes from the remote repository fails if a local commit exists. The expected behavior is for Git to merge the changes or prompt for conflict resolution. This issue disrupts workflow and prevents synchronization. SmartBear is actively addressing this, and a fix will be included in the January release. If you use git to pull changes into local ReadyAPI, we recommend you stay on your current version of ReadyAPI until we release the fix in January 2025.
About
It is considered a good practice to store tests and test projects in source control. This way, you can easily work on your tests along with your teammates, share your test cases, revert changes, and so on.
ReadyAPI includes built-in support for Git repositories. This allows you to put your test project files to and get them from a Git repository directly from within the ReadyAPI UI, without using any third-party tool.
Supported repositories
ReadyAPI supports Git repositories located in repository-hosting systems like GitHub, GitLab or Bitbucket, as well as Git repositories that reside on servers in your local network.
Manage Git accounts
To work with most Git providers, you need an account. ReadyAPI provides an account manager for Git accounts: you can add your Git account in ReadyAPI and then use it in any of your projects.
To open the Git account manager, click Preferences and select the Git tab. This will open the Git preferences page where you can add and edit Git accounts:
Add account
To add an account, select Connect (or Add Account, if you already have an account of that type):
Edit account
If you already have a Git account added to ReadyAPI, but you want to edit it, click Edit Account:
To test if your account can connect to the server or repository, select Test Connection.
Note: | The connection test will always be successful for public Git repositories because you can always connect to them, even without credentials. However, you will not be able to perform some actions like push if you are not authorized. |
Connect a project to a Git repository
To work with your project in Git, you should first connect it to a Git repository. To do that:
-
Double-click the project in the Navigator panel to open the project editor, and click the Configure Git button in the editor toolbar:
— or —
Click on the main toolbar and select Connect to Remote Repository:
-
To work with Git in ReadyAPI, you should convert your project into a composite project. These projects store test cases and other data as separate files instead of a single XML file. Click Continue to do that:
-
If your project was not saved, ReadyAPI shows the Save project dialog. Select the location where you want to save the project, enter the project name and click Save.
-
In the Choose Account dialog, select an account you will use to connect to a repository or add a new one if you haven't configured any Git accounts yet.
Alternatively, if you just want to initialize a local Git repo that doesn't require credentials, select Create in the New Local Repo section. This will initialize a repo in the project folder.
-
For GitHub, Bitbucket and GitLab accounts: select the repository you want to connect to. You can search for it in the list or input the URL and click Select.
Tip: To see details about a repo, click . For Git accounts: enter the URL of the repository and click Select:
Now, your project is connected to the Git repository, and you can commit and push your changes.
Best practices
We recommend that you enable the following two ReadyAPI settings:
-
Pretty print project files in the Preferences > WSDL dialog box, and
-
Normalize line-break in the Preferences > UI dialog box.
This will make your ReadyAPI project files friendlier to the “auto-merge” feature of Git. To learn more, see Merging changes.
Clone a project from a Git repository
ReadyAPI provides an easy way to clone a ReadyAPI project stored in a remote Git repository and import it into ReadyAPI. To do that:
-
Select File > Clone Project from Git from the main menu:
-
In the Choose Account dialog, select an account you will use to connect to a repository or add a new one if you haven't configured any Git accounts yet.
Alternatively, if you just want to import a local Git repo that doesn't require credentials, select Import in the Import a local repo section and select the repo folder.
-
For GitHub, Bitbucket and GitLab accounts: select the repository you want to clone. You can search for it in the list or input the URL and click Select.
Tip: To see details about a repo, click . For Git accounts: enter the URL of the repository and click Select:
Now, you can work with the cloned project and commit and push your changes to the remote repository.
Note: |
ReadyAPI automatically adjusts the settings.xml (or any auto-updated file) based on factors like version changes. For example, if a project created on 3.49 is cloned to 3.50, ReadyAPI detects and switches the settings accordingly, altering the settings.xml file. However, subsequent commits won't trigger this behavior unless the project is pulled onto a different machine with a different ReadyAPI version. Please refer to the section Required Settings in ReadyAPI to Optimize Git Integration to learn more about setting up Git integration correctly for optimal use. You can also learn more about this behaviour in Troubleshooting. |
Disconnect a project from the Git repository
To disconnect a project from the Git repository:
-
Click on the main toolbar.
-
Click and select Disconnect Account:
Note: | The local repository in your project folder will remain, and you will be able to reconnect anytime. |
How it works
ReadyAPI offers a number of commands to perform typical operations on the project files. You can perform them from the Git panel or from the main menu or context menu:
Once your project is in the repository, you use the Git panel or menu commands to work with it. For more information, see the following topics:
Required Settings in ReadyAPI to Optimize Git Integration
When collaborating on an API in ReadyAPI with multiple QA engineers, you need to:
Review the configurations outlined in the linked pages, as they are essential for optimizing your experience with Git, particularly when merging changes. To enable merging your changes automatically, ensure you configure the required settings.
Refer to the ReadyAPI Settings for Effective Git Collaboration section for proper setup and tips to avoid conflicts.
In case of an error ...
See Troubleshooting.