Contributions
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Contributions is a data source that provides aggregated metrics about contribution activity (such as commits, issues, and merge requests) across your projects or groups.
Allowed modes
Allowed scopes
| Scope | Description |
|---|---|
project | Query contributions in a specific project. |
group | Query contributions across all projects in a group, including subgroups. |
Query fields
| Field | Name | Operators |
|---|---|---|
| Created at | created | =, >, <, >=, <= |
| User | user | =, in |
Created at
Description: Filter contributions by date when they were created.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, GLQL considers the time range from 00:00 to 23:59 in the user’s time zone.
User
Description: Filter by the user who made the contributions.
Allowed value types:
Number(user ID)List(useinoperator for multiple user IDs)
Support for username filtering is being tracked in GLQL issue 143.
Dimensions
| Dimension | Name | Description |
|---|---|---|
| Created at | created | Group by contribution creation date, in monthly buckets. |
Metrics
| Metric | Name | Description |
|---|---|---|
| Total count | totalCount | Total number of contributions. |
| Users count | usersCount | Number of unique contributors. |
Sort fields
Sort by any field included in your selected dimensions or metrics. For more information, see analytics mode sorting.
Examples
Monthly contribution trend for a project:
```glql title: "Monthly contributions" display: table mode: analytics query: type = Contribution and project = "gitlab-org/gitlab" dimensions: created as "Month" metrics: totalCount as "Total", usersCount as "Contributors" sort: created desc ```Contribution trend for a set of users:
```glql title: "Contributions from a set of users" display: table mode: analytics query: type = Contribution and project = "gitlab-org/gitlab" and user in (1234567, 2345678) and created >= -90d dimensions: created as "Month" metrics: totalCount as "Total" sort: created desc ```A specific user’s contributions over the last year, by month:
```glql title: "User contribution history" display: table mode: analytics query: type = Contribution and group = "gitlab-org" and user = 1234567 and created >= -365d dimensions: created as "Month" metrics: totalCount as "Total" sort: created asc ```Overall contribution metrics for a group, without grouping:
```glql title: "Overall contribution metrics" display: table mode: analytics query: type = Contribution and group = "gitlab-org" and created >= -90d metrics: totalCount as "Total", usersCount as "Contributors" ```