Expose profile contribution calendar in public API
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Our contribution calendar visualization on the user profile currently relies on a semi-private API endpoint: https://gitlab.com/users/#{username}/calendar.json we should consider exposing that into the public API. This would allow people to build/implement visualizations without having to batch-load every single event in a specific timerange. Basically provide access to the aggregated count withing a specified range.
Proposal
The closest API endpoint we have is /users/:id/events (https://docs.gitlab.com/ee/api/events.html#get-user-contribution-events). This gives us the granular data. We need aggregated and we need contributions only. While internally we call that "calendar activities" I think it makes sense to call it what it really is "contributions":
- Endpoint:
/users/:id/contributionsFilters: -
aggregate_by:day,month,year(default:day) -
since(default:#{Date.current.year}-01-01, first day of january of current year) -
until(default:#Date.current}, today)
Existing code
Current implementation relies on the following: