GitLab Setup
Configure Codecora for GitLab using a Personal Access Token. Works with gitlab.com and self-hosted instances.
Prerequisites
- A GitLab account (gitlab.com or self-hosted)
- A repository where you have developer permissions or higher
- An OpenAI-compatible API key (OpenAI, Anthropic, Groq, etc.)
Step 1: Generate Personal Access Token
First, create a Personal Access Token (PAT) in GitLab with the required permissions:
- Go to GitLab Settings → Access Tokens
- gitlab.com: https://gitlab.com/-/user_settings/personal_access_tokens
- Self-hosted: https://your-gitlab-instance.com/-/user_settings/personal_access_tokens
- Click "Add new token"
- Name it something recognizable like "Codecora"
- Set an expiration date (or no expiration for development)
- Select the following scopes:
Required scopes:
- ✓ api
- ✓ read_repository
- ✓ write_repository
- Click "Create personal access token"
- Important: Copy the token immediately. You won't be able to see it again!
Step 2: Add GitLab to Codecora
- Go to the Codecora dashboard at codecora.dev/dashboard
- Click "Add Repository" or "Add Integration"
- Select "GitLab" as the platform
- Enter your GitLab instance URL:
- For gitlab.com:
https://gitlab.com - For self-hosted:
https://your-gitlab-instance.com
- For gitlab.com:
- Paste your Personal Access Token
- Click "Test Connection" to verify the token works
- Click "Save" to add the integration
Step 3: Configure Webhook
For Codecora to automatically review your merge requests, you need to configure a webhook in GitLab:
- Go to your GitLab project → Settings → Webhooks
- Click "Add new webhook"
- Enter the webhook URL:
https://codecora.dev/webhooks/gitlab - Select trigger events:
- ✓ Merge request events
- ✓ Push events (optional, for branch updates)
- Click "Add webhook"
- Test the webhook by clicking the "Test" button and selecting "Merge request events"
📝 Webhook Secret
The webhook will be secured with a secret that's automatically generated. Copy the webhook URL from the Codecora dashboard to ensure proper authentication.
Step 4: Configure AI Provider
If you haven't already configured your AI provider:
- Go to Settings → AI Provider in the dashboard
- Choose your provider (OpenAI, Anthropic, Groq, etc.)
- Enter your API key
- Test the connection
- Save your settings
Step 5: Enable Repositories
After connecting GitLab, Codecora will show your accessible repositories:
- In the dashboard, go to Repositories
- Find the GitLab repositories you want to enable
- Toggle the switch to enable Codecora for each repository
- Configure review preferences per repository (optional)
Self-Hosted GitLab
Codecora works with self-hosted GitLab instances too:
- Use your self-hosted URL when adding the integration
- Generate the PAT in your self-hosted instance
- Configure webhooks to point to
https://codecora.dev/webhooks/gitlab - Ensure your GitLab instance can reach Codecora's servers (no firewall blocking)
🔒 Private Network?
If your GitLab instance is on a private network without internet access, you'll need to use the self-hosted version of Codecora. Contact us for enterprise options.
Troubleshooting
Webhook not triggering?
- Check the webhook URL is correct:
https://codecora.dev/webhooks/gitlab - Verify the webhook secret matches
- Check recent webhook deliveries in GitLab webhook settings
- Ensure "Merge request events" is selected as a trigger
PAT authentication failed?
- Verify the token has the required scopes (api, read_repository, write_repository)
- Check the token hasn't expired
- Ensure you're using the correct GitLab instance URL
- Try regenerating the token and updating in Codecora
Can't see repositories?
- Ensure your PAT has the
apiscope - Verify you have access to the repositories in GitLab
- Check you're using the correct GitLab instance URL