Add developer documentation on our diff and blob handling and limits
https://gitlab.com/gitlab-org/gitlab-ce/issues/30061#note_54184979 describes the limits we have around displaying and highlighting diffs and blobs.
In general, this is not well-documented. We get diffs from:
- Rugged (these are going away eventually).
- Gitaly.
- The
merge_request_diff_filestable in the database.
As https://gitlab.com/gitlab-org/gitlab-ce/issues/30061 says, there are a lot of areas where our current diff handling isn't very useful. Part of the problem is that we've accrued limits and caching layers over time, and it's hard to change these limits and feel confident in that change.
I'd like to:
- Document our current behaviour. That's not just limits, but also where diffs come from in different cases (for instance, MR diffs come from the database unless we are comparing between MR versions, or viewing a single commit reference in MR).
- Come up with an aspirational plan of how we want this to work. I mentioned some of this in https://gitlab.com/gitlab-org/gitlab-ce/issues/30061#note_54543716 and https://gitlab.com/gitlab-org/gitlab-ce/issues/36051, but I'd like us to be able to:
- Load diff stats separately from diff contents, from all sources.
- Do infinite scrolling for diffs.
- Allow single-file diffs in a better way than the current expand / collapse.