Appendix: Using version control systems
Version control systems are software tools that help a team to manage changes made to code over time and track different versions of the software. This section shows how we use Git and Bitbucket at Arria to collaborate on Studio projects. Git is a distributed version control system and Bitbucket is a web-based tool that helps to manage the code in Git. The process should be similar for any other version control system.
Extracting scripts from an NLG Studio project
Arria NLG Studio projects can be exported into JSON objects that contain all the scripts and data. These JSON objects can be checked into version control systems for tracking the changes made to the project. However, the JSON representation is not easy to read so it can be difficult to compare changes between different versions.
To make an easily readable version of the Studio project, we created a Python script that extracts and saves the Studio scripts as separate ATL files. These files can then be checked into Git. For the Python script and instructions on how to run it, see Versioning NLG Studio projects with Git.
Checking-in NLG Studio scripts
Before you can check in the NLG Studio scripts, you must make sure you have everything set up. See Setting up the environment.
Once everything is set up, you can check in your Studio project into Git as follows.
Export your project from the Studio dashboard. This will give you a file in the JSON format.
Create a new Git repository.
We generally do this from the Bitbucket web page.
Clone the repository created above locally.
Set up a pre-commit hook locally on the Git repository. For instructions on how to do this, see Preparing the pre-commit and formatter.
Add the exported JSON file in the repository.
Check in the exported JSON file. As part of the pre-commit hook, the Studio scripts will be automatically extracted from the JSON file and checked in.