Source control integration in ServiceNow Studio
Summarize
Summary of Source control integration in ServiceNow Studio
ServiceNow Studio enables you to link your scoped or global application on a non-production instance to a Git source control repository. This integration allows you to save, manage, and share multiple versions of your application through metadata source control. It supports importing, committing, pulling changes, creating tags, and branching to maintain multiple application versions simultaneously.
Show less
Key Features
- Metadata Source Control: Manage application metadata changes efficiently by linking to Git repositories.
- Repository Management within Studio: Edit repository credentials, commit local changes, apply remote updates, create and switch branches, and import applications from Git directly in ServiceNow Studio.
- Git Repository Support: Allows limited modification of linked application files outside ServiceNow Studio. Supports moving files within the Git directory using the
snsourcecontrol.propertiesfile and validates files via checksum and XML schema during synchronization. - MID Server Connectivity: Use existing MID Servers to connect to Git repositories behind firewalls, ensuring secure access.
Integration Requirements
- Admin role required to link applications to source control.
- Non-production instance must have network access to the Git repository.
- Each application must reside in its own Git repository.
- Repository credentials must provide read and write permissions; credentials are shared by all developers on the instance for that repository.
Operational Details
- The system generates
snsourcecontrol.propertiesto specify application file paths andchecksum.txtto detect outside changes. - Sanitization removes unsupported files, creates upgrade logs, and aborts or skips operations if XML schema validation fails on system or non-system files respectively.
- Only content within the application path is sanitized; repository content outside this path is ignored.
Limitations and Additional Notes
- Source control integration is not supported on production instances; use update sets or Studio for production application management.
- ServiceNow AI Platform offers limited external editing of linked application files.
- Role permissions and collaborator management align with Application collaboration features.
Benefits for ServiceNow Customers
By integrating Git source control with ServiceNow Studio, development teams can collaborate more effectively, maintain application version history, manage multiple development branches, and streamline deployment processes on non-production instances. This integration enhances application lifecycle management and supports best practices in DevOps and source control workflows within the ServiceNow platform.
Link your application to a Git source control repository in ServiceNow Studio to save, manage, and share multiple versions of a global or scoped application from a non-production instance.
Metadata source control
- Import applications from a Git repository.
- Pull and apply remote changes from a Git repository.
- Commit all local changes on the instance to a Git repository.
- Create tags to permanently link to a specific version of an application.
- Create branches to maintain multiple versions of an application at the same time.
What are the integration requirements?
- You must have the admin role.
- The non-production instance must have network access to the Git repository.
- Each application must be in its own Git repository.
- The repository user credentials must grant read and write access.
What can you do with source control in ServiceNow Studio?
- Edit the application repository credentials.
- Commit all local changes on the instance.
- Apply remote changes from the repository.
- Create a branch.
- Switch branches.
- Import an application from a remote repository.
Source control integration does not support managing applications on a production instance. To manage applications on a production instance, use the application repository, an update set, or ServiceNow Studio. For more information, see Application sharing.
What can you do with source control from a Git repository?
- Move application files to a different Git directory structure.
- Edit application files outside of ServiceNow Studio.
The system generates a properties text file called sn_source_control.properties at the root level of the repository. To move application files to a different Git directory structure, set the
path parameter to specify the subfolder path containing the application files. For example, to move your application to the src/app subfolder, set the path to
path=src/app.
- Creates upgrade log entries for each sanitization action taken.
- Removes unsupported folders and files from the repository.
- Aborts all source control operations when a system application file fails XML schema validation. For example, if a database dictionary record fails XML schema validation, the system aborts all operations.
- Skips the current source control operation when a non-system application file fails XML schema validation.
The Git integration sanitizes only content within the application path listed in the sn_source_control.properties file. Repository content outside the application path is ignored.
How do I connect through a MID Server?
Use an existing MID Server to connect to a source control repository. Connecting an application through a MID Server enables access to repositories behind a firewall.
Source control role permissions
For more information about roles and collaborators, see Application collaboration.