Plug-in Documentation

GitLab

 

Overview


The GitLab plug-in provides for integration with a GitLab server. This plug-in imports issues, commits, merge requests and builds from a GitLab server and provides a single view of GitLab data in UrbanCode Velocity value stream map. Data between the GitLab server and the UrbanCode Velocity server is synchronized every five minutes.

Compatibility

  • This plug-in requires UrbanCode Velocity version 1.2.1 or higher
  • The plug-in version 2.0.3 or higher requires UrbanCode Velocity version 1.5.5 or higher
  • This plug-in supports GitLab version 9 or higher
  • This plug-in supports Cloud and On-Premises platform

Note: For integrations created before upgrading to version 2.4.0 of UrbanCode Velocity, Auto-generated User Access Key is not present, so the integration will fail after upgrading. In this case, you have to manually add a new User Access Key in the hidden property named UrbanCode Velocity User Access Key.

Versions

There is no install process for this plug-in. The GitLab plug-in is identified to UrbanCode Velocity as a value stream integration. UrbanCode Velocity plug-in images are located in DockerHub and the UrbanCode Velolcity code accesses the version that you select. To view available versions, see the UrbanCode DockerHub.

History

Version 2.0.36

  • Support for priority using Gitlab labels.

Version 2.0.31

  • ReSync support added (support starts with UrbanCode Velocity version 2.4.4 or later).

Version 2.0.30

  • Auto-generated User Access Key support added (support starts with UrbanCode Velocity version 2.4.0 or later).

Version 2.0.28

  • Minor bug fix

Version 2.0.25

  • Added history to Issue and PR

Version 2.0.10

  • Update plug-in to incorporate bug fixes

Version 2.0.9

  • Added HTTP proxy support

Version 2.0.7

  • Imports GitLab issues

Version 2.0.3

  • Performance Improvements for Build Feature (Requires Velocity Version 1.5.5 or above)

Version 2.0.2

  • Performance Improvements

Version 2.0.1

  • Added support for multiple project IDs (Renamed projectId field to projectIds)
  • Build data will be pulled from GitLab into Value Stream

Version 1.0.6

  • Customize integration from the user interface.

Version 1.0.5

  • Update plugin version from 0.x.x to 1.x.x format.

Version 0.0.4

  • Initial release

Usage

To use the GitLab plug-in you must define the integration, create a value stream, and upload the integration.

The value stream map contains the properties, you will use to define the plug-in integration. Basically, the plug-in integration is defined with a value stream within the UrbanCode Velocity user interface. Defining the integration includes defining configuration properties that connect the UrbanCode Velocity server to the GitLab server.

The basic flow to use the plug-in includes:

  1. Download the value stream map. The value stream map is a JSON file used to define integrations.
  2. Edit the JSON file to include the plug-in configuration properties.
  3. Save and upload the JSON file. This replaces the current JSON file with the new content.
  4. View the new integration on the Integration user interface page.

Integration type

The GitLab plug-in supports scheduled events integration which are listed in the following table.

Scheduled events
Name Description
syncGitLabIssue Queries the GitLab Server for issues in a project.
syncGitLabPull Queries the GitLab Server for merge requests in a project.
syncGitLabCommit Queries the GitLab Server for commits in a project.
syncGitLabBuild Queries the GitLab Server for builds in a project.

Integration

From the user interface Value Steam page, click Upload to upload the value stream map which is a JSON file.

The JSON file contains the information for creating a value stream and integrating with the GitLab server. The following table describes the information for the creating a UrbanCode Velocity value stream map.

Value stream map information
Name Description Required
image The version of the plug-in that you want to use. To view available versions, see the UrbanCode DockerHub. If a value is not specified, the latest version is used. No
loggingLevel The level of Log4j messages to display in the log file. Valid values are: all, debug, info, warn, error, fatal, off, and trace. No
name An assigned name to the value stream. Yes
properties List of configuration properties used to connect and communicate with the GitLab server. Enclose the properties within braces. Yes
tenant_id The name of the tenant. Yes
type Unique identifier assigned to the plug-in. The value for the GitLab plug-in is ucv-ext-gitlab. Yes

Configuration Properties

The configuration properties which are included in the properties field are unique to the GitLab plug-in and define the connection and communication to the GitLab server.

Configuration properties
Name Type Description Required Project Name
URL String The URL of the GitLab server. Yes baseUrl
Private Token String The Gitlab server access token. For more information, see the GitLab documentation at https://gitlab.com/profile/personal_access_tokens. Yes private_token
Project IDs Array A list of GitLab Project IDs to import the source data. Yes projectIds
UrbanCode Velocity User Access Key String The user access key used to authenticate with the UrbanCode Velocity server. Yes ucvAccessKey
Priorty Field Mapping using Labels Array Map GitLab label for Priorty to this server. The priorty field label must be a key vaule pair connected by “:” or “-“. Example: If Gitlab Label for priorty is priortyKey:High, then pass priortyKey in this field. No fieldMapping
Proxy Server String The URL of the proxy server including the port number. No proxyServer
Proxy User Name String The user name used to authenticate with the proxy server. No proxyUsername
Proxy Password String The password used to authenticate with the proxy server. No proxyPassword

Example

The following example can be used as a template to include the GitLab plug-in integration into the JSON file.
Copy and paste the template into the JSON file and make the appropriate changes.


"integrations":[
   {
      "type":"ucv-ext-gitlab",
      "tenant_id":"tenantId",
      "name":"my-repo",
      "disabled":false,
      "properties":{
         "ucvAccessKey":"key",
         "baseUrl":"https://gitlab.com",
         "private_token":"token",
         "projectIds":[
            "8918",
            "12345"
         ],
        "proxyServer": "http://localhost:3128",
        "proxyUsername": "admin",
        "proxyPassword": "1234",
        "fieldMapping:[
            "priorityKey1",
            "priorityKey2"
        ]
      }
   }
]