Store extended diff stats in the merge_request_diffs table
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Right now when we fetch from the diffs_stats
endpoint we also calculate the overflow, which tells us if we hit the diff limits. This process requires fetching the whole diffs collection, which might take a while on very large diffs collections (500ms total for 236 files and 6000 changed lines). In order to solve that issue we can store extended diffs stats right in the merge_request_diffs
table, the same way we already store real_size
and files_count
.
Things that we need to store in order to skip fetching the whole collection:
- Number of added lines
- Number or removed lines
- Total number of lines, including context lines (skips collapsed files)
- Total bytesize, including context lines (skips collapsed files)
After that we would need to update DiffCollection class to support persisted counters.
Edited by 🤖 GitLab Bot 🤖