Skip to content

Contribution analytics, expose user contributions via GraphQL

What does this MR do and why?

This MR exposes the aggregated user contributions via GraphQL. The plan is to revamp the Contribution Analytics page/feature and expose the private APIs so users could integrate with it.

Note: the current page sometimes times out on gitlab-org: https://gitlab.com/groups/gitlab-org/-/contribution_analytics

This MR does not solve the performance problem but gives a way to split the data (weekly) into smaller chunks which would help reduce the likelihood of statement timeout.

High-level plan:

Example query:

{
  group(fullPath: "flightjs") {
    contributions(first: 3, from: "2022-04-01", to: "2022-05-01") {
      nodes {
        user {
          name
          id
        }
        mergeRequestsCreated
        mergeRequestsClosed
        issuesClosed
        issuesCreated
      }
      pageInfo {
        endCursor
      }
    }
  }
}

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #375995 (closed)

Edited by Adam Hegyi

Merge request reports

Loading