Skip to content

Update epic cache on epic/issue update

Jan Provaznik requested to merge jp-cached-issue-weight-worker-part1 into master

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

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

  1. Enable the invite modal
    Feature.enable(:cache_issue_sums)
  2. Create an epic
  3. Add an issue to the epic
  4. 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.

Edited by Jan Provaznik

Merge request reports