GitLab

Description

Integration allows you to:

  • receive in card comments messages that contain links to commits related to this card

  • automatically create links to Kaiten cards in every GitLab commit;

  • automatically move cards to the selected column if a branch is created in the repository;

  • automatically move cards to the selected column if the branch related to the card merges into the specified repository branch;

Setup

GitLab repository setup

1. Open the menu. In the Spaces section, hover over the space whose events you want to integrate into your calendar. Click on the three dots to the right of the space name, then in the Space Settings drop-down menu

  1. In the window that opens, go to the GitLab section. There will be GitLab Secret and Webhook URL for your company.

  1. In the "Integrations with repositories" section, click the "Create Integration" button

Repository name

`awesome-project` in URL `https://gitlab.com/koshkarik/awesome-project`

Prefix

With specified prefix you have an ability to receive comments in Kaiten card with link to GitLab commit on every commit.

Specify prefix and use it in commit messages. For example, for prefix KAITEN commit message could be bug fix KAITEN-157834.

Integration setup in GitLab

You have to setup external task tracker in GitLab.

  • Go to GitLab and in menu select Settings → Integrations.

  • Fill Webhook URL and Gitlab Secret inputs.

  • Press button Add webhook.

Make sure that the Push events checkbox is checked in the Trigger section.

Automatic Card Movements

The card can be moved automatically: when a branch is created, in the name of which there is an ID of the card, when Pull Request is merged

Choose board / column in which card will be moved automatically on certain actions.

Now, if you create a branch in your project with a name, for example, branch-XXXX, where XXXX is the id of your card, then the card will move to the column specified for the branch created event. How to call a branch - it does not matter, as long as there is an ID card there.


Links to Kaiten cards in gitlab

If you configure Kaiten as an external issue tracker in gitlab, then if there are card id in the commits, gitlab will make such id links to cards in Kaiten. This functionality is provided by Gitlab.

https://docs.gitlab.com/ee/user/project/integrations/custom_issue_tracker.html

To set up an external tracker, go to integrations and select "Custom issue tracker".

Next, add links to Kaiten (in the image below, replace your_domain with your Kaiten domain).

After saving these settings, Gitlab will substitute links to cards in Kaiten instead of card id in commits.

Please note that this functionality is implemented on the Gitlab side and does not depend on Kaiten. At the time of this writing, card ids were not converted along with the hash (i.e. #123456), but only ABC-123456.

Example of integration settings

On the example of a card with ID 100:

When creating a branch, for example, fix-branch100, the card will be moved to the `Work / To Do` column;

After merging with the master branch, the card will be moved to the `Work / Done` column.

Checking integration

Adding comments to the card based on commit messages

1) If the prefix is ​​specified in the settings, then only comments with the prefix will be added;

2) By default, `#` is used instead of the prefix (example of the commit message `bug fix #12345`)

3) The prefix in the commit message must fully match the prefix from the settings (keyboard layout, case of letters)

4) Completely deleting the settings for the repository will reset the prefix setting. After removing use `#` in the commit message to create comments

5) In the GitLab settings, Push Events must be enabled in the settings (Settings → Webhooks → Integration with Kaiten by url. For example, https://hq.kaiten.io/gitlabwh).