Skip to content

Fixed Productivity Analytics date range calculations

What does this MR do and why?

Fixes bug in Productivity Analytics where refreshing the page immediately or after selecting date(s) in the date range picker resulted in the values of either the created_before or created_after query parameters – depending on the user's timezone – being decremented/incremented by 1 day.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screen Recording 2024-07-08 at 3.09.13 PM.mov Screen Recording 2024-07-08 at 3.07.59 PM.mov

How to set up and validate locally

  1. Please make sure that you're on the GitLab Ultimate plan.
  2. Select any project and run the following script: FILTER=productivity_analytics SEED_PRODUCTIVITY_ANALYTICS=1 PROJECT_ID=${YOUR_PROJECT_ID} bundle exec rake db:seed_fu
  3. Navigate to the above project's group Productivity Analytics: http://${YOUR_LOCAL_INSTANCE}/groups/${YOUR_GROUP}/-/analytics/productivity_analytics
  4. Take note of the values of the created_before and created_after query params as well as the # of days selected in the date range picker, refresh the page and verify that everything remains the same.

Related to #370456

Edited by Rudy Crespo

Merge request reports