Use AR to sync epic to work items
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:
- Some actions in the services trigger sidekiq jobs. While we skipped them, we didn't catch all.
- We kept the transaction open for an unnecessary long time
- 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
- Enable
sync_work_item_to_epic
- Enable
sync_epic_to_work_item
- Enable
sync_epic_to_work_item_dates
-
Disable
make_synced_work_item_read_only
- If you have
namespace_level_work_items
enabled - disable it as well to make sure you create a legacy epic. - Create an epic
- In addition, open to the correlating work item (change
/epics/
to/work_items/
in the URL) - 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