Gitlab Pond

Metrics

Metric NameDescription
Pull Request CountNumber of Pull/Merge Requests
Pull Request Pass RateRatio of Pull/Merge Review requests to merged
Pull Request Reviewer CountNumber of Pull/Merge Reviewers
Pull Request Review TimeTime from Pull/Merge created time until merged
Commit Author CountNumber of Contributors
Commit CountNumber of Commits
Added LinesAccumulated Number of New Lines
Deleted LinesAccumulated Number of Removed Lines
Pull Request Review RoundsNumber of cycles of commits followed by comments/final merge

Configuration

In your .env file, you will need to set up

```
# Gitlab
GITLAB_ENDPOINT=https://gitlab.com/api/v4/
GITLAB_AUTH=<your access token>
```

You can get your access token from https://gitlab.com/-/profile/personal_access_tokens

For more information on the GITLAB_ENDPOINT see Gitlab docs

Gathering Data with Gitlab

To collect data, you can make a POST request to /task

```
curl --location --request POST 'localhost:8080/task' \
--header 'Content-Type: application/json' \
--data-raw '[[{
    "plugin": "gitlab",
    "options": {
        "projectId": <Your gitlab project id>
    }
}]]'
```

Finding Project Id

To get the project id for a specific Gitlab repository:

  • Visit the repository page on gitlab

  • Find the project id just below the title

    Screen Shot 2021-08-06 at 4 32 53 PM

Use this project id in your requests, to collect data from this project

⚠️ (WIP) Create a Gitlab API Token

  1. When logged into Gitlab visit https://gitlab.com/-/profile/personal_access_tokens

  2. Give the token any name, no expiration date and all scopes (excluding write access)

    Screen Shot 2021-08-06 at 4 44 01 PM

  3. Click the Create Personal Access Token button

  • [ ] Copy and save the API token string into lake via new go setup