GitLab Integration
PanDev Metrics integration with GitLab allows you to analyze development activity, merge requests, and automatically add quality metrics to code reviews.
Integration Features
- Automatic MR Comments — adding code quality metrics to merge requests
- Repository Analytics — analysis of commits, branches, and contributors
- Code Review Metrics — review time, number of comments, MR cycle time
- Privacy — data is collected only from your projects
Supported Versions
- GitLab.com (SaaS)
- GitLab Self-Managed (On-Premise)
Integration Setup
Step 1: Create a Service Account
Create a separate GitLab account that will be used to collect analytics and generate reports.
A separate account allows you to distinguish automatic comments from personal ones and simplifies access management.
Step 2: Grant Access
Add the service account to GitLab groups/projects with the Maintainer or Owner role.
Step 3: Create a Token
- Log in to the service account
- Go to User Settings → Access Tokens
- Click Add new token
- Configure the token:
| Parameter | Value |
|---|---|
| Token name | pandev-metrics |
| Expiration date | 90 days (or no expiration for Self-Managed) |
- Select access rights (scopes):
| Scope | Description |
|---|---|
| api | Full API access |
| read_repository | Read repositories |
| write_repository | Write to repositories (for comments) |
- Click Create personal access token and save the token
Step 4: Connect in PanDev Metrics
- Go to Settings → Integrations → GitLab
- Specify GitLab URL:
- For GitLab.com:
https://gitlab.com - For Self-Managed: Your server URL (e.g.,
https://gitlab.company.local)
- For GitLab.com:
- Paste the copied token
- Click Check Connection
- After successful verification, click Activate
Step 5: Select Projects
- Select groups or projects to monitor
- Configure branch filters (optional)
- Save settings
Tracked Metrics
- Commits — number and frequency of commits by developers
- Merge Requests — MR cycle time, time to merge, number of revisions
- Code Review — review time, number of comments
- Activity — activity trends by projects and contributors
FAQ
Does integration work with GitLab Self-Managed? Yes, both GitLab.com and Self-Managed versions are supported.
What permissions are sufficient for basic analytics?
For analytics without comments, api and read_repository scopes are sufficient.
How often is data updated? Data is updated in real-time via GitLab webhooks.