Configure GitLab.com and the SnapLogic Git Integration.
To use GitLab cloud (gitlab.com
), register the SnapLogic Platform with GitLab and configure the Git
Integration feature in your SnapLogic environment. Each registration applies to one control plane
(elastic.snaplogic.com
, uat.elastic.snaplogic.com
or
emea.snaplogic.com
) and covers all environments on that control plane.
Administrative privileges are required:
- In GitLab.com, to:
- Register SnapLogic as an application.
- Create one or more repositories.
- In the SnapLogic environment, to configure the Git Integration feature.
Repository visibility
We recommend that you configure the Git Integration to only access repositories dedicated to
SnapLogic assets. This improves the performance of authorization and Git operations in the SnapLogic
Platform. It also improves usability by reducing the list of repositories that pipeline developers
must choose from during checkout.
GitLab doesn't have a way to filter the repositories accessed by third parties. In SnapLogic Git
Integration settings, the optional Namespaces field controls which
repositories are visible in Designer and Classic Manager:
- An empty field makes all groups and repositories that a user has permission to access visible.
- A comma-separated list with no spaces of one or more paths:
- A wildcard includes all repositories in a group or subgroup. For example:
My-group/* includes all repos in My-group,
while My-group/subgroup1/* includes all repositories in
subgroup1.
- Individual repositories qualified with their parent group or subgroup name. For example: the
My-group/SL-repo1 is directly under the group, while
My-group/subgroup1/SL-repo1 is a repo under
subgroup1.
The list of paths can be in any order. If two entries
in the list overlap, the most restrictive applies. In the following list only the
repositories in subgroup1 are visible:
My-group/*,My-group/subgroup1/*
.
Important: GitLab groups and subgroups act as containers for Git repositories.
GitLab supports multiple levels of subgroups. The SnapLogic Git Integration can only expose
repositories one level below the root, which includes top-level subgroups and their direct
children. Repositories in a subgroup of a subgroup aren't visible.
The following examples show how the most restrictive path applies when entries
overlap:
- snaplogic1/*,snaplogic1/repositoryA,snaplogic1/subgroup1/* : Only
repositoryA and all repositories in subgroup1 are
visible.
- snaplogic1/subgroup1/*,snaplogic1/subgroup1/repositoryB,snaplogic1/subgroup1/repositoryC:
Only repositoryB and repositoryC are visible.
- snaplogic1/*,snaplogic1/repositoryE,snaplogic1/subgroup1/repositoryF:
Only repositoryE and repositoryF are visible.
- snaplogic1/*,snaplogic1/repositoryG,snaplogic1/subgroup1/*,snaplogic1/subgroup1/repositoryH,snaplogic1/subgroup2/*:
Only repositoryG, repositoryH, and all repositories
in subgroup2 are visible.
Create an application in GitLab
To create an application that configures connectivity with the SnapLogic environment:
- Log into
gitlab.com
.
- Navigate to your Group.
- Select Settings.
- Click Applications.
- Click Add a new application.
- Enter a name.
- For Redirect URI, enter:
https://control-plane-name.snaplogic.com/api/1/rest/asset/app/oauthcallback
Where
control-plane-name
is the control plane you are
using. For example,
Important: This Redirect URI is the same as the
Callback URL that you specify in SnapLogic Git Integration
settings.
- Leave the Confidential box checked.
- For Scopes select the following:
- api
- read_api
- read_user
- write_repository
- Click Save application.
- Click the application to view it and copy the secret to use when configuring your SnapLogic
environment.
Configure the SnapLogic environment
Configure the Git Integration with Classic Manager or Admin Manager.
- Classic Manager
- Admin Manager
To configure the Git Integration in Classic Manager:
- From the left panel select Settings.
- Scroll down to Git Integration and click Configure Git.
- From the Git Integration Type dropdown list, select GitLab cloud.
The configuration dialog opens:
- Enter the following values, some are pre-populated:
- App ID: The Application ID from the GitLab application.
- Namespaces: An optional, comma-separated list of repository paths that specifies which repositories are visible to developers in the SnapLogic interface. Refer to Repository visibility for the acceptable syntax.
- Client Secret: Paste the Secret copied from the GitLab application.
- Gitlab URL:
https://gitlab.com
- Authorized scopes:
api
read_api
read_user
write_repository
- Callback URL: The Redirect URI from
the GitLab application,
https://control-plane-name.snaplogic.com/api/1/rest/asset/app/oauthcallback
.Where
control-plane-name is the control plane you are using. For example,
Important: This Callback URL is the same as the
Redirect URI in the context of GitLab.
- Click Save.
To configure the Git Integration in Admin Manager:
- In the left pane, navigate to .
- From the Git integration type dropdown list, select
Gitlab cloud.
- Enter the following values, some are pre-populated:
- App ID: The Application ID from the GitLab
application.
- Namespaces: An optional, comma-separated list of repository paths that specifies which repositories are visible to developers in the SnapLogic interface. Refer to Repository visibility for the acceptable syntax.
- Client secret: Paste the Secret
copied from the GitLab application.
- Gitlab URL:
https://gitlab.com
- Authorized scopes:
api
read_api
read_user
write_repository
- Callback URL: The Redirect URI
from the GitLab application,
https://control-plane-namesnaplogic.com/api/1/rest/asset/app/oauthcallback
.Where
control-plane-name is the control plane you are using.
For example,
Important: This Callback URL is the same as
the Redirect URI in the context of GitLab.
- Click Save.
Next, each user in the environment must Authorize SnapLogic
to connect to GitLab.