Skip to content

Fix work item parent links desync

Felipe Artur requested to merge issue_452513 into master

What does this MR do and why?

Fix work item parent links desync. Deletes WorkItems::ParentLink record when EpicIssue record parent epic is updated.

Next step is a follow-up MR with a migration to delete desynced WorkItems::ParentLink records.

related to #452513 (closed)

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.

How to set up and validate locally

  1. Enable epic_creation_with_synced_work_item feature flag
  2. Create epic 1
  3. Create an issue 1 and set epic 1 as parent
  4. Create another epic 2
  5. Go to rails console and delete its associated work item Epic.last.work_item.destroy
  6. Set issue 1 parent to epic 2
  7. Set issue 1 parent to epic 1 again

No errors should happen. Check the console and the following should truthy:

WorkItems::parentLink.find_by_work_item_id(issue_1.id).work_item_parent == Epic.find(epic_1.id).work_item

Edited by Felipe Artur

Merge request reports