Correctly handle invalid dates on Merge Request Analytics page
What does this MR do and why?
This MR handle correctly invalid dates on Merge Request Analytics page. If we type an invalid start_date
or end_date
in the Merge Request Analytics URL, the system will show an alert and fallback to default range of 365 days: start_date
equals to today - 365
days and end_date
equals to today
.
Currently, if we type an invalid start_date
or end_date
in the Merge Request Analytics URL (e.g.: /analytics/merge_request_analytics?start_date
=2022-15-09&end_date
=2023-15-09) the page is not rendered properly and no errors messages are displayed.
See here the BUG: #413974 (comment 1462806914)
Screenshots or screen recordings
When access the menu "Merge request analytics"
Expected behaviour: the default range of 365 days is used without show any alert (existing behavior).
When "end_date" is not informed
Expected behaviour: the default range of 365 days is used and an alert is shown with the text: Invalid dates set, defaulting to 365 days.
.
When "start_date" is not informed
Expected behaviour: the default range of 365 days is used and an alert is shown with the text: Invalid dates set, defaulting to 365 days.
.
When "start_date" or "end_date" is invalid
Expected behaviour: the default range of 365 days is used and an alert is shown with the text: Invalid dates set, defaulting to 365 days.
.
When "end_date" is greater than "start_date"
Expected behaviour: the default range of 365 days is used and an alert is shown with the text: Invalid dates set, defaulting to 365 days.
.
When the range of dates is larger than 365 days
Expected behaviour: the default range of 365 days is used and an alert is shown with the text: Date range too large, defaulting to 365 days.
.
How to set up and validate locally
You will need a GitLab Ultimate license
- Create a group
- Seed cycle analytics data
- Seed dora metrics data
- Seed MRs in the
merged
state - see this note for some hints - Visit the Value streams dashboard
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #413974 (closed)