Overview

Gated Commit is an integration pattern that means the commit does not happens until a set of checks is passed against the code. It helps the developers to avoid breaking the code and prevents bad code from going into the integration branch. This should take place before committing changes to the Version Control System(VCS i.e. central server).

Installation Steps:

  1. Download the installer file from your Embold Account’s section > Releases tab. There will be one file with names similar to the following: ‘embold_ubuntu_with_dependencies_1.7.3.0.run’.
  2. Go to the Corona path $CORONA_HOME/coronacli/config/cli.properties and add Embold credentials in CLI properties file.
  3. Make sure that installer file ‘embold_ubuntu_with_dependencies_1.7.3.0.run’ has execution permission. To check the permissions of the installer file, run the following command in the terminal.
    ||
    If the file does not have the execution permission, use the following command to grant the permission.
    sudo chmod 755 embold_ubuntu_with_dependencies_1.7.3.0.run
  4. Copy the file from Corona folder to source base directory.
    1. For Git: Copy “commit-msg” from $CORONA_HOME/coronacli/config/commit-msg to baseDir/.git/hooks
    2. For SVN: Copy “pre-commit” file to svn/hooks/pre-commit (This pre-commit files should always be present on the server)
      Check if commit-msg and pre-commit have execution permissions.
  5. Make the necessary code changes if required.
  6. Commit the changes done using the below command:
    git commit -m "Committing changes"
    1. If the commit is successful, no errors are displayed on the console.
    2. If the commit fails, the list of issues is displayed on the console.
Note:
Embold supports gated commit for Git as well as SVN.
To know about how to install corona, please refer to this article.

What if you still want to commit?

Sometimes, the user may have to accidentally commit and push their code to the main branch. There are 2 ways through which a user can commit these changes:

  • Force-commit: User may have to immediately commit the code changes due to any of the emergency condition. Embold analysis will be done and still, commit will not fail.
    There may be a list of issues present while committing these changes.
    Added issues will be attached to the commit-msg.
  • Below is the command for force-commit:
    git commit -m "Committing changes embold --force-commit"
    Required parameters: embold --force-commit
  • Skip: Users may have to skip gated commit if bad code is present. Embold analysis will not be done. The commit-msg will be updated.
  • Below is the command for skip:
    git commit -m "Committing changes embold --skip"
    Required parameters: embold --skip