VSD fails to load on the 1st of the month
Steps to reproduce:
- Enable
vsd_graphql_dora_and_flow_metrics
feature - Attempt to view the VSD on the 1st day of any month (This can be mocked by changing the value of
now
in ComparisonChart) - Enjoy your error
diff --git a/ee/app/assets/javascripts/analytics/dashboards/utils.js b/ee/app/assets/javascripts/analytics/dashboards/utils.js
index fd0de4c7376c..4949b4f847f4 100644
--- a/ee/app/assets/javascripts/analytics/dashboards/utils.js
+++ b/ee/app/assets/javascripts/analytics/dashboards/utils.js
@@ -247,7 +247,7 @@ export const generateDateRanges = (now) => {
{
key: 'thisMonth',
label: s__('DORA4Metrics|Month to date'),
- start: getStartOfDay(dateAtFirstDayOfMonth(now)),
+ start: now,
end: now,
thClass: thWidthPercent(20),
},
Cause
On the first of the month, a request for the first time period will share the same start/end date. The timestamp is different, but the day is the same which is causing the error on the page.
The error doesn't appear in the console by default, but after a bit of digging we unearthed it:
Edited by Ezekiel Kigbo