summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-09-05 11:11:20 +0000
committerDouwe Maan <douwe@gitlab.com>2018-09-05 11:11:20 +0000
commitf897537d2df1b682dcf88d845cd9d81991751fde (patch)
treeaf2e68885955437f80be56086b4db077e8297839 /doc
parent4fab6fc035102ef3c08704f2f499d02d20206db8 (diff)
parent0aee3755378e9558ff2b1290f4c39bfbfb14f282 (diff)
downloadgitlab-ce-f897537d2df1b682dcf88d845cd9d81991751fde.tar.gz
Merge branch 'osw-update-diff-docs-on-where-limits-are-used' into 'master'
Update diff docs regarding where limits are applied See merge request gitlab-org/gitlab-ce!21504
Diffstat (limited to 'doc')
-rw-r--r--doc/development/diffs.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/development/diffs.md b/doc/development/diffs.md
index d06339480b1..725507b7ef6 100644
--- a/doc/development/diffs.md
+++ b/doc/development/diffs.md
@@ -95,6 +95,8 @@ Gitlab::Git::DiffCollection.collection_limits[:max_bytes] = Gitlab::Git::DiffCol
No more files will be rendered at all if 5 megabytes have already been rendered.
+*Note:* All collection limit parameters are currently sent and applied on Gitaly. That is, once the limit is surpassed,
+Gitaly will only return the safe amount of data to be persisted on `merge_request_diff_files`.
### Individual diff file limits
@@ -106,12 +108,17 @@ Gitlab::Git::Diff::COLLAPSE_LIMIT = 10.kilobytes
File diff will be collapsed (but be expandable) if it is larger than 10 kilobytes.
+*Note:* Although this nomenclature (Collapsing) is also used on Gitaly, this limit is only used on GitLab (hardcoded - not sent to Gitaly).
+Gitaly will only return `Diff.Collapsed` (RPC) when surpassing collection limits.
+
```ruby
Gitlab::Git::Diff::SIZE_LIMIT = 100.kilobytes
```
File diff will not be rendered if it's larger than 100 kilobytes.
+*Note:* This limit is currently hardcoded and applied on Gitaly and the RPC returns `Diff.TooLarge` when this limit is surpassed.
+Although we're still also applying it on GitLab, we should remove the redundancy from GitLab once we're confident with the Gitaly integration.
```ruby
Commit::DIFF_SAFE_LINES = Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines] = 5000
@@ -119,6 +126,8 @@ Commit::DIFF_SAFE_LINES = Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines
File diff will be suppressed (technically different from collapsed, but behaves the same, and is expandable) if it has more than 5000 lines.
+*Note:* This limit is currently hardcoded and only applied on GitLab.
+
## Viewers
Diff Viewers, which can be found on `models/diff_viewer/*` are classes used to map metadata about each type of Diff File. It has information