Legacy - Migrate completed update set history to Source Control
Summarize
Summary of Legacy - Migrate completed update set history to Source Control
This feature in the Xanadu release allows ServiceNow application developers to migrate completed update set histories into Source Control commits when linking an application to Source Control. It offers a choice to preserve update set history as commits or discard it during the linking process, enabling better version tracking and historical reference within Git repositories.
Show less
Important: The legacy version of ServiceNow Studio is being deprecated and hidden in new instances. Customers are encouraged to use the current version of ServiceNow Studio for building and editing applications.
Before migrating
- Ensure you have the admin role.
- Complete all update sets for the application you want to migrate.
- If desired, export completed update sets to preserve them externally, as linking deletes update sets and customer update records.
- Review the process for linking an application or customization to Source Control before migration.
Migration process and options
When linking an application to Source Control, if completed update sets exist, you will be prompted to either:
- Retain update set history as commits: Converts update set history into Source Control commits.
- Do not retain update set history: Update set history is discarded.
Regardless of choice, selecting Continue deletes all completed update sets and customer update records. Select Cancel to abort if further update sets need completion.
Commit generation details
- Commits are generated automatically from
sysupdatexmlrecords ordered bysysrecordedattimestamp. - For Global applications, completed Global update sets’ records are included as historical commits.
- The final commit represents the current full application state and can be viewed in Git or via the Source Control > View History menu.
- Multiple commits may be created per update set to maintain ordered file histories, especially when updates are out of chronological order or multiple updates exist for a file.
- Commits prefixed with
[Historical Commit]are for history display only and should not be used as development checkpoints. - The
authorelectiveupdatefolder is created only at the initial commit; file movements into this folder may be visible then. - Deleted files in historical commits are removed rather than moved to the elective update folder, with DELETE payloads created accordingly.
Commit message format and customization
Commit messages include:
- Update set name and description
- Completion/install date
- User details for the person who completed the update set
- Additional batch update set information if applicable
Batch update sets append hierarchical parent update set information to the commit message.
Customers can customize commit messages by specifying additional fields from sysupdateset XML fields via the glide.sourcecontrol.historicalcommitfields property. This comma-separated list controls which fields are included, ignoring invalid entries. Only field values are included (e.g., sysid instead of referenced names).
When linking to Source Control, this feature allows application developers the choice of migrating the information in completed update sets to Source Control history.
Try building and editing apps in the current version of ServiceNow Studio instead. For more information, see Building applications with ServiceNow Studio.
Before migrating
- Role required: admin
- Read the Legacy - Link an application or application-customization to source control topic
- Complete any update sets for your application that you want to export as Source Control history.
- Export the completed update set if you want to preserve it.
- If you select “Yes, do retain update set history as commits”, the update set history is preserved as Source Control commits.
- If you select “No, do not retain update set history as commits,” they are not preserved as commits.
For every completed update set with updates to the application that you are linking to Source Control, commits are generated automatically by the system based on the sys_update_xml records in the update sets. The commits are ordered by the sys_recorded_at timestamp. For Global applications: Any sys_update_xml records that belong to the application and are part of a completed Global update set are captured as historical commits.
- If there are updates for a file that are out of order between different update sets.
- If an update set contains multiple update records for a single file.
The commits for an update set are split into multiple commits ([Historical Commit 1], [Historical Commit 2]...) to represent each update. This is done so that each file has an ordered history of updates.
The author_elective_update folder is not created until the initial commit. That means that in the initial commit you might see files such as sys_choice files being renamed and moved from the update folder to the author_elective_update folder. Any files that are deleted from update sets in historical commits are deleted, and not moved to the author_elective_update folder as they would be for actual commits. During the initial commit, DELETE payloads are also created for any DELETE sys_update_xml records that were deleted as part of completed update sets.
[Historical Commit 1] <Name of update set that this commit belongs to>
Description: <Description of update set that this commit belongs to>
Update Set was completed on / installed on <date>
Update Set was completed by <sys_user user_name > <sys_user email>
{}
{Batch update set information (See the Batch update sets section below) }
Batch update sets
If an update set is part of a batch update set, that information is appended to the commit message in the following format, with the highest number being the Batch Base:
{
"1": {
"parent": "<name of parent update set>",
"description": "<description of parent update set>"
},
"2": {
"parent": " <name of parent 1’s parent update set> ",
"description": " <description of parent 1’s parent update set> "
}
}
Customization
You can add additional fields to include in the commit message by adding a glide.source_control.historical_commit_fields property. The value is a comma-separated list of fields the user wants to include from sys_update_set XML fields. Spaces and invalid or misspelled field names are ignored. This property is used for all applications that are linked to Source Control from the instance if the committer chooses to retain update set history.