Source control integrations can be configured for both Self-Hosted Runners and Gitpod Desktop. You can set up a GitLab integration during runner creation or in the runner settings. Self-hosted GitLab instances are supported by changing the Host during setup.
You can skip this step if someone has already set up the runner for you and SCM
integration with GitLab has already been configured. In that case, you can go
directly to Authorizing GitLab Access. This step
allows administrators to configure what authorization methods (OAuth, PATs) and
SCM providers (GitHub, GitLab, Bitbucket, Azure DevOps) will be available for
authorization.
For self-hosted runners (like AWS), GitLab integration is configured during runner creation or in the runner settings.There are two ways to integrate with GitLab. Both can be used simultaneously:
OAuth App (Recommended): Using an OAuth app allows users to sign in more quickly. You’ll need to set up an OAuth app within Gitpod.
Personal Access Token (PAT): Each user will need to create a Personal Access Token. They will be provided with a deep link to do so on their first environment creation.
Go to Settings > Runners and select the runner for which you want to configure OAuth.
Navigate to the “Configure repository access” section and click “Add a new provider”.
Add new provider
Select GitLab from the list of providers.
In the modal that opens, toggle “Enable OAuth”.
Enable GitLab OAuth
Follow the instructions in GitLab’s docs to create an OAuth app.
The app name can be any name you like
You can get the callback URL from the SCM configuration dialog
Select the required scopes
The api scope is required so that the context url can be parsed
The read_repository scope is required so that your environment can clone the repository
The read_user scope is required so that the git author name and git author email can be set in the environment
Configure GitLab OAuth
After creating the OAuth app, provide the Client ID and Client Secret in the runner configuration dialog. The client secret will be encrypted with the runner’s public key, ensuring only the runner can read it.