Skip to content

Use date for upcoming milestone comparison

Sean McGivern requested to merge use-date-for-upcoming-milestone-comparison into master

What does this MR do?

From the second commit message:

NOW() is a timestamp, with a maximum year (in Postgres) 294276 AD.

milestones.due_date is a date with a maximum year (again, in Postgres) of 5874897 AD.

If there is a due date past the limit for the timestamp, comparing the two will fail with:

ERROR:  date out of range for timestamp

We also need to add validations to keep the due dates sensible, but for now we can simply use CURRENT_DATE instead of NOW(), so the types match with no coercion needed.

https://gitlab.com/gitlab-org/gitlab-ce/issues/58576 is the issue to add validations.

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58325.

Does this MR meet the acceptance criteria?

Merge request reports