Synchronizing an SCM Instance
Whenever you add an SCM instance or edit any of the fields that define an existing instance, first test its connection to the remote repository (see Testing an SCM Instance Connection). If the connection is successful, you should manually initiate a synchronization to ensure that the codebases across all SCM instances for the project are properly synchronized to the Scan Server.
Use the following procedure to manually initiate a synchronization.
Note:Even though the scan process automatically performs a synchronization before actually scanning, a synchronization test initiated manually after any changes to a project’s SCM instances can help to avoid problems with a subsequent scan and its results.
To synchronize SCM instances to the Scan Server, do the following:
1. | Navigate to the Summary tab for the project for which you are synchronizing remote codebase files to the Scan Server. |
2. | From the Manage Project menu, select Edit Project. The Edit Project page opens. |
3. | Select the Version Control Settings tab. |
4. | Click Sync Now to synchronize the codebase repositories from all the project’s SCM instances to the following location on the Scan Server: |
<scanroot>/<projectID>/<scm_instance_ID>
where <scanroot> is the Scan Server root directory, <projectID> is the ID of project for which you have added or edited SCM instances, and <scm_instance_ID> is the internal ID for the SCM instance, such git.0, git.1, and so forth.
5. | If the synchronization successfully completes, a message in the upper right corner of the screen confirms this success. |
If the synchronization encounters an error, an error pop-up is displayed, explaining the problem. You can address the issue and retry the synchronization.
Additional Information About Synchronizations
Note this additional information about synchronizations:
• | If multiple SCM instances have been added, clicking Sync Now will synchronize all instances in your project to the Scan Server. If the synchronization fails for one instance, the overall synchronization fails. |
• | If the Scan Server assigned to the project to which you are synchronizing codebase files is disabled, the Sync Now button is also disabled. Consider reassigning the project to an enabled Scan Server. (If necessary, see your Code Insight System Administrator for information about which servers are enabled). |
• | The numbered labels for the SCM instance tabs on the Version Control Settings tab are not the same as the SCM instance IDs, which are generated internally and used to identify the instance subdirectory on the Scan Server. (You can retrieve these internal IDs by calling the GET scminstances REST API for a project.) When using the REST interface to manage SCM instances, you must use the internal instance IDs. |
• | Unlike the other SCM instance types, an SCM Git instance allows URLs for multiple repositories. For more information about the synchronization of multiple URLs, see Processing of Git Repository URLs During a Synchronization. |