Skip to main content

How to add Gitlab to Coworker

How to Gitlab as a connected data source to Coworker

Updated over 5 months ago

ℹ Only Network Admins can add data sources to Coworker. Contact your network admin for assistance

ℹ You must be an admin for the connected data source in order to successfully connect the tool to Coworker. If you do not have admin access for this tool, you will need to either obtain admin privileges for the tool otherwise add an admin of that tool as an admin on Coworker so they can complete the connection

Prerequisites

  • A Gitlab account with access to the repositories you wish to sync with Coworker Labs.

  • Depending on the configuration, either a Free or a Premium/Ultimate Gitlab plan

Generating the credentials

  1. You can generate a personal access token at https://gitlab.com/-/user_settings/personal_access_tokens

  2. Click 'Add new token'

  3. Do not enter an expiration date, as you'll need to reconnect once it expires. You can always revoke Coworker Labs' access to this token in future if required.

  4. Select the required scopes:

    api

  5. Next click 'Create personal access token' and copy / save your token.

Note: Coworker will only read, and not write data from your Gitlab instance. The only reason why an api, and not read_api scope is required is because, during the connection's setup, a webhook is configured to push real-time updates from Gitlab to Coworker's infrastructure.

Information required for the Coworker connection:

  • access_token: The access token created above

  • groups_list: Your group ID, or a a comma-separated (no spaces) list of the group ids which should be synchronized. This field is required and cannot be left blank.

    • This requires a Gitlab Premium/Ultimate/Self-managed instance

  • projects_list: A comma-separated (no spaces) list of the projects (or repositories) that should be synchronized. If left empty, Coworker will synchronize all projects that can be accessed (or within the groups configured above).

    1. Premium Tiers: If you wish to synchronize all repositories (projects) under a group (see config below), a Gitlab Premium/Ultimate/Self-managed instance is required: data will be (in part) synchronized through group hooks, which are not available in the Free Tier.

    2. Free Tier: If you have a Free Tier Gitlab instance, you will need to provide an explicit list of the projects to synchronize: the data will be synchronized (in part) through project hooks.

  • start_date: Date of the first record to synchronize, in the following format: 2024-01-01T00:00:00Z . Commits before this date will not be synchronized.

ℹ You must share your token and credentials via a secure app like 1Password or LastPass. This is for SOC2 compliance and to protect your data

Did this answer your question?