422 error when fetching Value Stream Metrics in CI/CD Analytics charts
Summary
Following this discussion it was discovered that, depending on the user's timezone, toggling on "Last 180 days" on any of the CI/CD Analytics charts containing VS Metrics throws a 422 error when fetching from https://gitlab.com/groups/gitlab-org/-/analytics/value_stream_analytics/summary
with the following response: {"message":"Invalid parameters","errors":{"created_after":["The given date range is larger than 180 days"]}}
. As a result, the ValueStreamMetrics
component is not updated. Given the date range "2022-11-21 - 2023-05-19", the created_after
request parameter is "2022-11-20", thus off by a day.
Relevant logs and/or screenshots
Screen_Recording_2023-05-19_at_9.09.51_PM
Possible fixes
Proposed fix: Convert the created_after
to UTC time and then to YMD on the FE
Edited by Brandon Labuschagne