Skip to content

Update merge request diff files_count cache when removing diffs

Nick Thomas requested to merge 240921-fix-merge-request-diff-files-count into master

What does this MR do?

The files_count cache column was created with the assumption that the number of files never changes throughout the life of a diff. However, we have discovered the DeleteDiffFilesWorker, which removes them (and sets the state of the diff to :without_files) in some limited cases.

This MR updates the cache columns (both commits_count and files_count) so they will be re-recorded on every update. Since updates are rare, the additional cost of this should be very low.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Closes #240921 (closed)

Edited by Nick Thomas

Merge request reports