Legacy - Source Control integration

  • Release version: Xanadu
  • Updated August 1, 2024
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Legacy - Source Control integration

    The Legacy Source Control integration in ServiceNow enables application developers to link applications on non-production instances with Git repositories. This integration allows for version management by importing applications, committing changes, pulling updates, creating branches, and tagging versions directly from ServiceNow Studio. This functionality is designed for development environments and is not recommended for production instances, where alternative deployment methods like update sets or the application repository should be used.

    Show full answer Show less

    Starting with the Xanadu release, the legacy ServiceNow Studio is being deprecated and hidden on new instances, though it remains supported. Customers are encouraged to use the current version of ServiceNow Studio for application development and source control integration.

    Key Features

    • Application Linking: Only admin users can link applications to Git repositories, which must have separate repositories per application with read/write credentials shared among developers.
    • ServiceNow Studio Capabilities: Developers can manage credentials, commit local changes, pull remote updates, create and switch branches, and import applications from Git repositories.
    • Git Repository Support: Limited editing outside ServiceNow Studio is supported, including moving application files within the repository structure by configuring a path parameter in a properties file (snsourcecontrol.properties).
    • File Validation and Sanitization: The system uses a checksum file to detect external changes, validating and sanitizing application files to remove unsupported content and ensure schema compliance before source control operations proceed.
    • MID Server Support: MID Servers can be configured to connect to Git repositories behind firewalls, including support for proxy configurations to facilitate secure communication between ServiceNow instances and Git repositories.
    • Additional Source Control Operations: Includes stashing changes, resolving conflicts, viewing commit history, setting default branches, migrating update set histories, and delta loading for optimized application loading.

    Important Considerations

    • Source Control integration is intended for non-production instances to avoid risks associated with production deployments.
    • Developers should avoid modifying application files across multiple update sets to prevent commit conflicts.
    • Legacy Studio and Source Control features will eventually be deprecated; transitioning to the current Studio version is recommended.
    • Source Control commits can be denoised to exclude system-generated metadata changes, streamlining branch merges and commit history clarity.

    Practical Benefits for ServiceNow Customers

    This integration facilitates collaborative application development by enabling version-controlled workflows directly within ServiceNow Studio, improving development efficiency and change tracking on non-production instances. The use of MID Servers expands secure access options for Git repositories behind firewalls. Validation and sanitization processes help maintain application integrity when changes are made outside of ServiceNow Studio.

    By leveraging source control branches and tags, developers can manage multiple application versions and maintain stable releases effectively. Customers should plan migration away from the legacy Studio and prepare for future deprecation while optimizing their application lifecycle management using Git source control integration features.

    Enable application developers to integrate with a Git Source Control repository. Save and manage multiple versions of an application from a non-production instance.

    Important:
    Starting with the Xanadu release, the legacy version of ServiceNow Studio is being prepared for future deprecation. It will be hidden and no longer activated on new instances but will continue to be supported. For details on the deprecation process, see the Deprecation Process [KB0867184] article in the Now Support Knowledge Base.

    Try building and editing apps in the current version of ServiceNow Studio instead. For more information, see Building applications with ServiceNow Studio.

    Linking an application to Source Control enables all application developers on a non-production instance to:
    • 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 given version of an application.
    • Create branches to maintain multiple versions of an application simultaneously.

    Integration requirements

    To link an application to source control:
    • The user must have the admin role.
    • The non-production instance must have network access to the Git repository.
    • Each application must be within its own Git repository.
    • The repository user credentials must grant read and write access.
    Note:
    All application developers on the instance share a single set of credentials per repository.

    Options available from ServiceNow Studio

    After linking an application to Source Control, application developers can use ServiceNow Studio to manage the repository. From Studio, developers can:
    • 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.

    It is not recommended to use Source Control to manage applications on a production instance, deploying to production may lead to unintended consequences, see Legacy - Production deployment tips. Instead, you can manage applications on a production instance using the application repository, an update set, or the ServiceNow Store. For more information about managing applications on a production instance, see Application sharing.

    Options available from a Git repository

    The ServiceNow platform offers limited support for modifying linked application files outside of an instance. From Git, developers can:
    • 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, application developers can set the path parameter to specify the subfolder path containing their application files. For example, if you moved your application to the src/app subfolder, set the path to path=src/app.

    The system generates a checksum.txt file in the Git repository to determine if any application files have been changed outside of Studio. When the checksum value from the file matches the current checksum value, the integration skips the validation and sanitization process. When the checksum values do not match, the integration validates and sanitizes the application files as part of the Source Control operation. The sanitization process:
    • 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 Source Control integration sanitizes only content within the application path listed in the sn_source_control.properties file. Repository content outside the application path is ignored.

    MID Server support

    Use an existing MID Server to connect to a Source Control repository. Linking or importing an application through a MID Server enables access to repositories behind a firewall.

    Configure MID server for source control integration

    Configure a MID server for Source Control Integration to enable communication and the movement of data between a ServiceNow instance and external applications, data sources, and services.

    • Add "bundle" extension to glide.attachment.extensions properties.
    • If the MID Servers must go through a proxy to access the remote git repository, do as follows:
      • Add the following line to agent\conf\wrapper-override.conf file:
      • wrapper.java.additionial.3=-Dhttps.proxyHost=<proxyHost>
      • wrapper.java.additionial.4=-Dhttps.proxyPort=<proxyPort>
      • Restart the MID
      • Add a new entry in "MID Security Policy":
      • Name: <proxy host name>
      • Check "Active" only

    Denoise source control commits

    Skip unloading into XML files of noisy update fields for any metadata record in source control.