Skip to content

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:

  1. #469379 (closed): First, during this transition period, ensure that issues table is our initial Single Source of Truth for work items star_date and due_date fields. This where we introduced a database trigger to ensure every start_date and due_date writes on the work_item_dates_sources update the same fields in the issues table. !157993 (merged)
  2. (👉 this work) Ensure that StartAndDueDate widget writes to the work_item_dates_sources table. This way, both widgets are writting to the same place, which is synced with the issues table.
  3. Change the RolledupDates widget to be an EE extension of the StartAndDueDate widget. This will simplify the frontend and backend as we will need to manage a single widget for the dates fields.
  4. Migrate the start_date and due_date fields from issues table to the work_item_dates_sources table and ensure all writting of the start_date and due_date fields also writes to the work_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.
  5. Change all the readings of dates to be done through the work_item_dates_sources table, instead of issues table
  6. Remove the start_date and due_date columns from the issues 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), which will be fixed next

start-and-due-date

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Kassio Borges

Merge request reports