WorkItem: Change StartAndDueDate to write to work_item_dates_sources
What does this MR do and why?
WorkItem: Change StartAndDueDate to write to work_item_dates_sources
With the introduction of the RolledupDates we also introduced
WorkItems::DatesSource model to be the work item single source of
truth for dates. However, the StartAndDueDate widget still writing
dates directly on the issues table.
To make matters worse, there's also some confusion between the
RolledupDates and the StartAndDueDate widgets, not writting to the
same table, making it hard to query work items based on their date
fields. Now with more knowledge, we see that the RolledupDates widget
should be actually just an EE extension for the already existing
StartAndDueDate.
To simplify all that, we need to:
-
#469379 (closed): First, during
this transition period, ensure that
issuestable is our initial Single Source of Truth for work itemsstar_dateanddue_datefields. This where we introduced a database trigger to ensure everystart_dateanddue_datewrites on thework_item_dates_sourcesupdate the same fields in theissuestable. !157993 (merged) - (
👉 this work) Ensure thatStartAndDueDatewidget writes to thework_item_dates_sourcestable. This way, both widgets are writting to the same place, which is synced with theissuestable. - Change the
RolledupDateswidget to be anEEextension of theStartAndDueDatewidget. This will simplify the frontend and backend as we will need to manage a single widget for the dates fields. - Migrate the
start_dateanddue_datefields fromissuestable to thework_item_dates_sourcestable and ensure all writting of thestart_dateanddue_datefields also writes to thework_item_dates_sourcestable (invert the#1). This is a larger work, and would block the migration of the Epics -> WorkItems, that's why it'll be done later. - Change all the readings of dates to be done through the
work_item_dates_sourcestable, instead of issuestable - Remove the
start_dateanddue_datecolumns from theissuestable.
As a side effect this also fixes the Quick Actions `/due` & `/remove_due_date ` don'... (#469126 - closed).
Related to:
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
This change is transparent to the user in most cases, the main differences are:
- This fixes the
/duequick action (#469126 (closed)) - There's a known issue regarding activity notes not being generated (#469576 (closed)), which will be fixed next
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.