Fill out the Contribution Analytics GraphQL App
What does this MR do and why?
Related issue: #376001 (closed)
Restores the content from !108273 (merged) which was reverted. GraphQL pagination still needs to be completed before this reaches feature parity with the legacy app.
This change is behind the contribution_analytics_graphql
feature flag.
The description for the Pushes chart had to be updated, since we no longer have the total commit count metric. This wasn't added to GraphQL due to efficiency concerns, so it was removed from the description line
- 1234 pushes, more than 23456 commits by 78 contributors.
+ 1234 pushes by 78 contributors.
Screenshots or screen recordings
Loading | ![]() |
Error | ![]() |
Pushes | ![]() |
MRs | ![]() |
Issues | ![]() |
Table | ![]() |
Table (Mobile) | ![]() |
How to set up and validate locally
- Enable the
contribution_analytics_graphql
feature flag. - Visit any group contribution analytics page such as
http://gdk.test:3000/groups/flightjs/-/contribution_analytics
- Validate the charts/table work as expected
Setting up analytics data
Your page may look empty, so to test easily you can mock the GraphQL response by replacing the Apollo update() callback:
- return data.group?.contributions.nodes || [];
+ const getRandomInt = () => Math.floor(Math.random() * 1000);
+ const mockUser = () => ({
+ user: {
+ name: Math.random().toString(36).substr(2, 20),
+ webUrl: `http://gdk.test:3000/${Math.random().toString(36).substr(2, 5)}`
+ },
+ repoPushed: getRandomInt(),
+ mergeRequestsApproved: getRandomInt(),
+ mergeRequestsClosed: getRandomInt(),
+ mergeRequestsCreated: getRandomInt(),
+ mergeRequestsMerged: getRandomInt(),
+ issuesClosed: getRandomInt(),
+ issuesCreated: getRandomInt(),
+ totalEvents: getRandomInt(),
+ });
+ const result = [...Array(100)].map(() => mockUser());
+ return result;
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.