Skip to content

Fix intermittent CI/CD analytics request error for 180 day windows

Alex Pennells requested to merge 412356-fix-timezone-bug into master

What does this MR do and why?

We were seeing occasional errors on the CI/CD analytics page when using the Last 180 days time period.

This was happening because the REST API was using the time period start_date.at_beginning_of_day -> Time.current.at_end_of_day, as opposed to the GraphQL API which was using start_date.at_beginning_of_day -> Time.current.at_beginning_of_day. That small difference was enough to increase the time window to be slightly larger than what is allowed, causing the request to fail.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-10-26_at_3.03.37_PM Screenshot_2023-10-26_at_3.02.40_PM

How to set up and validate locally

  1. Visit CI/CD analytics page for any group (ex. http://gdk.test/groups/flightjs/-/analytics/ci_cd?tab=deployment-frequency)
  2. Click the Last 180 days tab
  3. Check for a page alert indicating the error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #412356 (closed)

Merge request reports