Loading
Cap the Contribution Analytics JSON range at 93 days
What does this MR do and why?
- Return 422 from the Contribution Analytics JSON format when
start_dateis more than 93 days ago, matching the GraphQL contributions resolver. - Clamp the HTML page's start date to the same 93-day window. The page's own tabs (last week, last month, last 3 months) are already inside it.
- Share the 93-day limit between the controller and the resolver through one constant.
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636140 (MR 1)
Screenshots or screen recordings
How to set up and validate locally
- Open Analyze > Contribution analytics for a licensed group and switch between the three tabs. Each loads as before.
- Request
GET /groups/<group>/-/contribution_analytics.json?start_date=2022-01-01. It returns 422 withThe given date range is larger than 93 days. - Open
/groups/<group>/-/contribution_analytics?start_date=2022-01-01. The page shows contributions since 93 days ago.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.