Skip to content

Use AR to sync epic to work items

Nicolas Dular requested to merge nd/use-ar-for-epic-work-item-sync into master

What does this MR do and why?

As part of the epic to work item migration, we previously used the correlating WorkItems::UpdateService or WorkItems::CreateService to sync updates and creations. However, this led to a few issues, namely:

  1. Some actions in the services trigger sidekiq jobs. While we skipped them, we didn't catch all.
  2. We kept the transaction open for an unnecessary long time
  3. Due to errors (mostly with sidekiq jobs being spawned) we ran into mismatches

To fix these two problems, we decided to move to use the WorkItem AR directly to sync updates/creations for base attributes.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enable sync_work_item_to_epic
  2. Enable sync_epic_to_work_item
  3. Enable sync_epic_to_work_item_dates
  4. Disable make_synced_work_item_read_only
  5. If you have namespace_level_work_items enabled - disable it as well to make sure you create a legacy epic.
  6. Create an epic
  7. In addition, open to the correlating work item (change /epics/ to /work_items/ in the URL)
  8. Modify the title, description, confidential setting, status and see if the same data appears on the work item after a reload.
Edited by Nicolas Dular

Merge request reports