Skip to main content

Github/Gitlab Integration

Introduction

This page explains how you can link your Holistics project with Github/Gitlab.

Benefits

  • You can have a backup version of the analytics code.
  • You can apply proper data governance and quality control protocols by enforcing review (i.e pull requests/merge requests) before someone click Deploy to production.
  • You can leverage your own local editor (i.e VS Code) to manage Holistics modeling layer and push changes back to Holistics conveniently.

How to connect to your External Git Repository

danger

Ensure that your external Git repository is a bare repository. It must not have any commit, or contain any default file like README.md, LICENSE.md, etc.

  1. Create an empty Git repository (without a README) on GitHub, GitLab or any Git-based version control platform of choice.

    If you use Github to initialize a new repository

    When initializing a new repository in Github, be careful not to select the options to generate default files.

  2. Navigate to the Version Control Settings page.

  3. Get the SSH URL for the external Git repository.

  4. Paste the SSH URL into the “SSH URL” field on the Version Control Settings page.

  5. Copy the Deploy Key which Holistics provides on the Version Control Settings page and paste it into the Settings for the repository:

    - Be sure to select the **Allow write access** option because Holistics requires this setting in order to make and deploy changes.
  6. Navigate back to the Version Control Settings page and click Test connection.

  7. Once the connection is successfully established, a new master branch will appear in the repository, along with a set of folders, one for each object type that is synced. Holistics will then sync with the master branch in the repository as the Production branch.

Important Notes

  • Any changes made in Holistics will be synced to the External Repository at the corresponding branches
  • Any changes merged into the master branch in Git will be reflected in the Holistics. However, it won't affect your production directly. You will need to pull changes from master branch and merge to your current branch in Holistics. After that, you can click Deploy to production.

The workflow when using AML studio with External Git repository

Besides 3 simple steps when using Holistics' default repository, the workflow should include a manually enforced Pull Request (PR) process in External Git Repository.

The workflow when using AML studio with External Git repository

⚠️ IMPORTANT: After pushing, do not click Deploy right away.

Instead, go to the external Git repository, and create a Pull Request (PR). Ask for a review from another team member.

  • If the PR is approved, merge the PR to master. Then go back to Holistics AML studio and Deploy.
  • If the reviewer requests some changes, go back to AML studio, add more changes, and push. Repeat the review process.

How to turn off direct production deployment via Holistics UI?

info

Q: Can we turn off the ability to directly deploy to production in Holistics UI? We require multiple code reviews before deployment, and want to do it within the Github's PR (or Gitlab's MR) workflow.

Currently, we do not offer a feature to prevent users from directly deploying to production without enforcing the pull request (PR) process. However, there's a workaround: Branch protection.

  1. Go to your Github repository and turn on branch protection rule for master branch (Learn More)

  2. Now you're unable to deploy to production without going through a pull request review, followed by merging into master branch.

    In this step, you must use option Create a merge commit instead of either Squash and merge or Rebase and merge.

    The reason is that our Git Actions depend on Commit History. Thus, if you use either Squash and Merge or Rebase and merge method, the commit history is modified so that Holistics cannot detect if the deployed commit is merged to master or not. Merge Pull Request

  3. After the PR has been successfully merged to master, return to Holistics and click 'Deploy to Production'.

Refer to the video below:


Let us know what you think about this document :)