This article is intended to get started with the Gitlab connector in Qlik Application Automation.
An app can only be used once per user. When the same Gitlab user has multiple connections using the same app an issue occurs when the access token needs to be refreshed.
Authentication and Authorization
First start by creating an app in your Gitlab to obtain a client ID and client secret. This can be done in Preferences -> Applications. For redirect URI provide the following values: https://connector.qlikcloud.com/callback.
Scopes: Select all scopes apart from the sudo scope. Note the client ID and client secret that are provided when registering the app. You will need those when connecting.
To authenticate with Gitlab you create a new connection. The connector makes use of OAuth2 for authentication and authorization purposes. First you will have to provide the client ID and client secret that you obtained in the previous step. If you are using a self hosted version of Gitlab you will have to provide the domain as well, otherwise leave it blank and it will default to gitlab.com. When you click connect you will be prompted with a popup screen to consent a list of permissions for Qlik Application Automation to use.
The connector blocks are built around the following objects and have create, get and list actions available:
Furthermore, blocks are available to perform commit actions which can be creating new files, updating a file, moving a file, deleting a file or modifying the execution mode of a file. Webhooks are also available so that automations can be triggered as actions in Gitlab occur.
Example creating a commit and a merge request.
The following automation will create a file, update a file, move a file, delete a file and perform all this in a single commit. Next it will create a merge request from the branch feature/my-feature to the main branch:
Webhooks are available for the following actions:
New push event
New merge request
New tag push event
New pipeline event
New job event
The following example registers a webhook for new merge requests in a project and sends a message to Microsoft Teams: