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_date is 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

Screenshots or screen recordings

How to set up and validate locally

  1. Open Analyze > Contribution analytics for a licensed group and switch between the three tabs. Each loads as before.
  2. Request GET /groups/<group>/-/contribution_analytics.json?start_date=2022-01-01. It returns 422 with The given date range is larger than 93 days.
  3. 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.

Merge request reports

Loading
Loading