Update epic cache on epic/issue update
What does this MR do and why?
When issue's count or weight is changed for an epic, we update its cached values. These cached values are sum of both direct epic's issues and also sub-epic's issues.
Because we want to include subepics weights/counts too, when cached value is changed we propagate this change to all epic ancestors. This is achieved by scheduling cache update for epic's parent in epic's after_commit callback.
Updating cache counts on project/group deletion will be addressed separately because it's too complex for single MR - !90615 (comment 1041674376)
Related to #356683 (closed)
DB queries
- get suepics count/weight - !95048 (comment 1057093902)
- get issues count/weight - !95048 (comment 1057091212)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Enable the invite modal
Feature.enable(:cache_issue_sums)
- Create an epic
- Add an issue to the epic
- Check in rails console that epic's
total_*_issue_*
attributes were updated
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.