To authorize our API calls, we need
a personal access token from
a Gitlab user account. This account must have access to all projects that you’d like Glean to crawl.
For this API token, if you’re willing to grant us the
api
scope, we can programmatically create webhooks during setup. If you want to restrict the token to
read-only access, you will need to manually create webhooks for every single project that you want
crawled.
Step 3. Create webhooks manually (if token has only read access)
Log into Gitlab with an account that has owner privileges in order to manually create webhooks in a
project. For each project perform the following steps:
Navigate to the project page within Gitlab.
On the left-side menu, navigate to Settings → Webhooks.
Create a webhook with the following properties:
URL: %3%
Secret token: sk_test_123456789%2%
Trigger:
Push events
Comments
Issue events
Merge request events
Wiki page events
Input that same Secret Token to corresponding “Webhook secret token” field in Glean.
After creating all project webhooks on GitLab, click Save.
Gitlab Cloud doesn’t return a user’s email via the API unless that user has explicitly allowed their
email to be publicly shown. In order for us to correctly crawl permissions in Gitlab, we need to be
able to map each user id to their company email.
Please create a CSV with two columns: Gitlab user ID, and email. The CSV doesn’t need to have
column headers, but the columns do need to be in the order (user ID, email).
Note that the user ID is NOT the username –– the user ID should be numbers only and corresponds to the id in the example response of the /members API.
Example of a correct row: 12345,user1@glean.com
Upload this CSV to Glean to correctly map the user IDs to the primary SSO email.
To list all gitlab user IDs, you can use the Gitlab API.
For your company emails, they can hopefully be queried from an identity system like Okta, GSuite, or any other source you may have internally.
Once you’ve successfully uploaded the CSV, click “Save”.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.