# GitLab

The GitLab extractor pulls raw data from GitLab's REST API and extracts the following resources from GitLab:

For more information you can check the documentation for tap-gitlab.

# GitLab Setup

In order to access your GitLab data, you will need:

  • GitLab Instance
  • Access Token
  • Group OR Project
  • Start Date

GitLab Instance

Configuration Notes

Access Token

Configuration Notes

  • Full access to GitLab's API requires a personal access token that will authenticate you with the server

The process for getting the access token is very simple:

  1. Navigate to your profile's access tokens.

  2. Fill out the personal access token form with the following properties:

  • Name: meltano-gitlab-tutorial
  • Expires: leave blank unless you have a specific reason to expire the token
  • Scopes:
    • api
  1. Click on Create personal access token to submit your request.

  2. You should see your token appear at the top of your screen.

  3. Copy and paste the token into the Private Token field. It should look something like this: I8vxHsiVAaDnAX3hA

# Group

Configuration Notes

  • Leave empty if you'd like to pull data from a project in a personal user namespace

This property allows you to scope data that the extractor fetches to only the desired group. The group name can generally be found at the root of a repository's URL. If this is left blank, you have to at least provide a project.

For example, https://www.gitlab.com/meltano/tap-gitlab has a group of meltano. This can be confirmed as well by visiting https://gitlab.com/meltano and noting the Group ID below the header.

Group ID verification example

# Projects

Configuration Notes

  • Space separated paths of projects to pull data from, in namespace/project format
  • Leave empty if you've specified one or more groups and would like to pull data from all projects inside these groups

This property allows you to scope the project that the service fetches, but it is completely optional. If this is left blank, the extractor will try to fetch all projects that it can grab.

If you want to configure this, the format for it is group/project. Here are a couple examples:

# Ultimate License

Configuration Notes

  • Pull in extra data (like Epics, Epic Issues and other entities) only available to GitLab Ultimate and GitLab.com Gold accounts.

# Start Date

This property determines how much historical data will be extracted.

Please be aware that the larger the time period and amount of data, the longer the initial extraction can be expected to take.

# Advanced: Command Line Installation

  1. Navigate to your Meltano project in the terminal
  2. Run the following command:
meltano add extractor tap-gitlab

If you are successful, you should see Added and installed extractors 'tap-gitlab' in your terminal.

# Configuration

  1. Open your project's .env file in a text editor
  2. Add the following variables to your file:

Required:

export GITLAB_API_TOKEN="private access token"
export GITLAB_API_GROUPS="myorg mygroup"
export GITLAB_API_PROJECTS="myorg/repo-a myorg/repo-b"
export GITLAB_API_START_DATE="YYYY-MM-DDTHH:MM:SSZ" # e.g. 2019-10-31T00:00:00Z

Optional:

export GITLAB_API_ULTIMATE_LICENSE="true"

If ultimate_license is true (defaults to false), then the GitLab account used has access to the GitLab Ultimate or GitLab.com Gold features. It will enable fetching Epics, Epic Issues and other entities available for GitLab Ultimate and GitLab.com Gold accounts.

Check the README for details.