Skip DiffStats calls in Rapid Diffs
What does this MR do and why?
Related: #588880
This MR skips DiffStats RPC call to Gitaly in Rapid Diffs when 'Show whitespace changes' setting is enabled.
We can do so because DiffStats call is used to:
- Determine if we have any more diffs to stream through the streaming endpoint
- Provide stat counters for diff files because diffs without whitespace changes have different counters
When we show diffs with whitespace changes this is no longer necessary because:
- We can determine if we need to stream the rest of the diffs based on
overflow_markerfrom CommitDiff RPC, that tells us if there are more diffs to show after the first five - We don't need to detect whitespace-only collapsed diffs or provide diff stats since we include whitespace changes and the stats will be correct, as well as all files will be present
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Enable
rapid_diffs_on_commit_showfeature flag - Go to any large commit
- Enable 'Show whitespace changes' setting in view settings
- Reload the page
- Observe no DiffStats call in performance bar

