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
issues
table is our initial Single Source of Truth for work itemsstar_date
anddue_date
fields. This where we introduced a database trigger to ensure everystart_date
anddue_date
writes on thework_item_dates_sources
update the same fields in theissues
table. !157993 (merged) - (
👉 this work) Ensure thatStartAndDueDate
widget writes to thework_item_dates_sources
table. This way, both widgets are writting to the same place, which is synced with theissues
table. - Change the
RolledupDates
widget to be anEE
extension of theStartAndDueDate
widget. This will simplify the frontend and backend as we will need to manage a single widget for the dates fields. - Migrate the
start_date
anddue_date
fields fromissues
table to thework_item_dates_sources
table and ensure all writting of thestart_date
anddue_date
fields also writes to thework_item_dates_sources
table (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_sources
table, instead of issuestable
- Remove the
start_date
anddue_date
columns from theissues
table.
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
/due
quick 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.