SEI GitLab Cloud integration
GitLab is a DevOps platform that provides Git repos, CI/CD pipelines, issue management, and more.
SEI supports two integrations to integrate SEI with GIthub.
- Gitlab Cloud
- Gitlab Enterprise
To integrate with Gitlab Enterprise, use the SEI Gitlab Enterprise integration.
Configure authentication
The SEI GitLab integration can use either OAuth or personal access token authentication.
For OAuth, your account must have the Reporter role or higher.
If you can't use OAuth, you must create a GitLab personal access token to configure the SEI GitLab integration.
- Log in to your GitLab account and create a personal access token. For instructions, go to the GitLab documentation on Personal Access Tokens.
- Select the
api
scope with complete read/write API access. - Copy the token somewhere that you can retrieve it when you configure the integration.
Configure the integration
- Cloud
- Satellite
- In your Harness Project, go to the SEI Module, and select Account.
- Select Integrations under Data Settings.
- Select Available Integrations, locate the GitLab Cloud integration, and select Install.
To integrate with an on-premises, privately-hosted GitLab instance, install the GitLab Enterprise integration with API key (personal access token) authentication and an Ingestion Satellite.
-
Select an authentication method for the integration:
- To use OAuth, select Authorize and follow the prompts to grant access to GitLab.
- To use a Personal Access Token, enter the URL for your GitLab instance and paste your Access Token.
-
In Integration Name, enter a name for the integration.
-
Finish configuration and Save the integration.
The steps for configuring the integration using Satellite is similar to configuring the integration on cloud using the Personal Access Token, with the exception of using satellite to communicate with the Gitlab server.
Make sure to select the satellite integration checkbox while configuring the integration. If you experience any issues while configuring the integration using the Ingestion Satellite, refer to the Ingestion Satellite Troubleshooting and FAQs.
- Enter the Personal Access Token and click Next.
- In Integration Name, enter a name for the integration.
- Add a Description for the integration. (Optional)
- In the URL field, add the URL where your Gitlab repository is deployed.
- If applicable, configure Additional Options:
- Fetch PRs: Allow SEI to ingest PR data from Gitlab.
- Fetch Issues: Allow SEI to ingest data from Gitlab Issues.
- Fetch Projects: Allow SEI to ingest data from Gitlab Projects.
- Fetch Commits: Allow SEI to ingest commit metadata from Gitlab.
- Fetch Commit Files: Allow SEI to ingest data within commits from Gitlab.
- Select Next and click on Download Config and save the
satellite.yml
file. Update it following the instructions here.
Here’s a sample satellite.yml
file:
satellite:
tenant: <ACCOUNT_ID>
api_key: <ACCOUNT_API_KEY>
url: 'https://app.harness.io/gratis/sei/api' # Note that this URL is relative to the Environment of your Harness Account.
integrations:
- id: '<INTEGRATION_ID>' # For ex: 4691
application: gitlab
url: '<GITLAB_INSTANCE_URL>'
metadata:
fetch_prs: true
fetch_issues: true
fetch_projects: true
fetch_commits: true
fetch_commit_files: true
authentication: apikey
Use the following optional metadata fields to optimize the ingestion functionality while configuring the integration using the Ingestion Satellite:
Name | Field | Values | Properties |
---|---|---|---|
Check Project Membership | check_project_membership | The supported values are True/False. By default, this field is set to True . | When set to True , SEI selectively considers projects based on token owner membership. For self-hosted Gitlab instances, switching to False enables SEI to fetch all projects, regardless of the membership. You should never disable this for cloud Gitlab instances. |
Fetch PR Patches | fetch_pr_patches | The supported values are True/False | This field determines whether to retrieve patches or file differentials for Pull Requests (PRs). |
Fetch Commit Patches | fetch_commit_patches | The supported values are True/False | This field governs the inclusion of commit patches or file differentials in the data. |
Fetch Pipelines | fetch_pipelines | The supported values are True/False | This field specifies whether to fetch pipeline data. |
PR Commit Limit | pr_commit_limit | Default value: 250 | This field sets a cap on the number of commits fetched per Pull Request. |
If you encounter any issues during the integration process, go to the Satellite integration Troubleshooting and FAQs.