Fix work item parent links desync
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
- Enable
epic_creation_with_synced_work_item
feature flag - Create
epic 1
- Create an
issue 1
and setepic 1
as parent - Create another
epic 2
- Go to rails console and delete its associated work item
Epic.last.work_item.destroy
- Set
issue 1
parent toepic 2
- Set
issue 1
parent toepic 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 Cardozo