Version control is a critical aspect of software development that allows teams to collaborate effectively and manage changes to code over time. In the context of Qlik Cloud, version control becomes even more important, as it enables users to track changes to their data models, visualizations, and other assets in a centralized and secure manner.
One way to implement version control in Qlik Cloud is by using Qlik Application Automations and GitHub, a popular platform for hosting and sharing code repositories. By leveraging automations, users can streamline the process of committing changes to their Qlik Cloud projects and pushing them to GitHub, while also ensuring that their code is properly tested and validated before being merged into the main branch.
In this insight, we will explore the benefits of using version control in Qlik Cloud, as well as the specific steps involved in setting up automations and integrating with GitHub and how a possible dashboard looks to control all automations from one app in Qlik. We will also discuss best practices for managing code changes and collaborating effectively with other team members.
For the flow, we will follow the principles of Gitflow. Here we have the main branch to store the official release history, a develop branch as an integration branch for features and a branch for each feature.
In this insight, we will demonstrate the flow using a dashboard app. This app allows users to execute multiple automations with a single tool. It also provides some extra information about the GitHub component.
Flow using a dashboard app
Step 1: Copy from DEV version
In Step 1, start with the most recent version of the app you want to work on. Here, you create a duplicate of the app you wish to develop in Qlik. As this sample only works with an app's load script, this way the developer may see the front end as well.
You should enter the AppID and also give a name to the new branch that will be created. The automation used will automatically create a separate branch in GitHub for this specific feature. There is also a GitHub button, which takes you directly to the GitHub repository.
Once both fields are filled in you copy the app by simply clicking the button ‘Create feature app’. Now a copy of the app will be available in a specified shared space. The button activates the following automation, a basis for the automations used in this sample is already available in Qlik. These automations have been modified to work with the dashboard app.
At this moment you are ready to develop and make changes to the script.
Step 2: Push development to GitHub.
Once you are ready to develop, you go to Step 2: Push development to GitHub.
As you can see on the dashboard app you just fill in the AppID of the app you worked on and click the button. An alternative is to use a dropdown to select the App. Now the load script of the app is automatically committed to the corresponding feature branch.
Step 3: Pull request and wait for approval
For the next steps, you have to go to GitHub using the button. Step 3 in the dashboard app doesn’t have any functionalities besides giving a short explanation on what needs to be done on GitHub. Therefore it is not shown in this insight.
In GitHub, you will create a pull request. By creating a pull request a Qlik Automation will automatically be triggered creating a temporary app checking if the new load script still runs and adding a comment to the pull request if it still does or not. By adding tags to your apps you could even add more tests.
Once the pull request is created, the next step is to merge the changes to the development branch. A member of the team should be responsible for checking pull requests for merge conflicts and should manually merge. This way there is still a last line of control. Once the pull request is merged an automation will automatically take the latest version of the load script and load it into the development app in Qlik. Now the development app is up to date.
As the DEV app is now completely up to date and was tested it can be manually published in Qlik to the managed space.
Best practices and rules
Some things should still be considered in the team using these automations and following this flow. A good practice could be to appoint a single person to be responsible for the GitHub part of this flow. Developers shouldn’t be able to merge their own pull requests.
Secondly, there should be naming conventions for the feature apps and feature branches. For example the feature app should always start with ‘F_’, the feature branch should be the name of the app followed by ‘..._feature X’ and you could also opt for some rules on adding comments to the pull requests to give more information to the person responsible for the merge.
These are all suggestions, but some well-defined rules could make this flow easier to understand for everyone of the team.
Conclusion
In conclusion, implementing effective version control in Qlik Cloud using GitHub and automations can greatly improve collaboration and streamline the process of managing code changes. By following the Gitflow principles and using a dashboard app to execute multiple automations, teams can ensure that their code is properly tested and validated before being merged into the main branch. However, it's important to consider best practices for managing code changes and collaborating effectively with other team members, such as appointing a single person to be responsible for the GitHub part of the flow and establishing naming conventions for feature apps and branches. By following these guidelines, teams can ensure that their version control process is efficient, secure, and effective.