Plug-in Documentation

GitLab

 

Overview


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

Compatibility

Must be running UrbanCode Velocity version 1.2.1 and later to use the plug-in.

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.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
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
URL String The URL of the GitLab server. Yes
Private Token String The Gitlab server access token. For more information, see the GitLab documentation at https://gitlab.com/profile/personal_access_tokens. Yes
Project IDs Array A list of Projects Ids to import the source data. Yes
UrbanCode Velocity User Access Key String The user access key to authenticate with the UrbanCode Velocity server. Yes

Example

The following example can be used as as 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"
         ]
      }
   }
]