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

ScopeDescription
projectQuery contributions in a specific project.
groupQuery contributions across all projects in a group, including subgroups.

Query fields

FieldNameOperators
Created atcreated=, >, <, >=, <=
Useruser=, in

Created at

Description: Filter contributions by date when they were created.

Allowed value types:

  • AbsoluteDate (in the format YYYY-MM-DD)
  • RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted, digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (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 (use in operator for multiple user IDs)

Support for username filtering is being tracked in GLQL issue 143.

Dimensions

DimensionNameDescription
Created atcreatedGroup by contribution creation date, in monthly buckets.

Metrics

MetricNameDescription
Total counttotalCountTotal number of contributions.
Users countusersCountNumber 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"
    ```