This limit is hardcoded and only applied on GitLab. message and a button to view only that file in that commit.Ĭommit :: DIFF_SAFE_LINES = Gitlab :: Git :: DiffCollection :: DEFAULT_LIMITS = 5000įile diff is suppressed (technically different from collapsed, but behaves the same, and is expandable) if it has more than 5000 lines. Users see a Changes are too large to be shown. The patch not be rendered if it’s larger than ApplicationSettings#diff_max_patch_bytes. Gitaly only returns Diff.Collapsed (RPC) when surpassing collection limits. Surpass ApplicationSettings#diff_max_patch_bytes.Īlthough this nomenclature (Collapsing) is also used on Gitaly, this limit is only used on GitLab (hardcoded - not sent to Gitaly). The diff is persisted and expandable if the patch size doesn’t That is, it’s equivalent to 10kb if the maximum allowed value is 100kb. Expandable patches (collapsed)ĭiff patches are collapsed when surpassing 10% of the value set in ApplicationSettings#diff_max_patch_bytes. Files number, lines number and files size are considered. Limits that act onto each diff file of a collection. Gitaly only returns the safe amount of data to be persisted on merge_request_diff_files. No more files are rendered at all if 5 megabytes have already been rendered.Īll collection limit parameters are sent and applied on Gitaly. collection_limits = Gitlab :: Git :: DiffCollection. Limits that act onto all diff files collection. There are scenarios where we collapse the diff file,Īnd cases where the diff file is not presented at all, and the user is guided to the Blob view. In the last scenario, go the repository and fetch the diff Diff limitsĪs explained above, we limit single diff files and the size of the whole diff.Otherwise, if it’s a current MR revision, use the persisted.Check whether we have the NoteDiffFile#diff persisted and use it.Of hitting the repository every time we need the diff of the file, we: On NoteDiffFile (which is associated with the actual DiffNote). When commenting on a diff (any comparison), we persist a truncated diff version Using Gitlab::Diff::FileCollection::MergeRequestDiff Note diffs If the diff file is cacheable (text-based), it’s cached on Redis.Know which viewer it should use for each file (text, image, deleted, etc).Fetch the old and new file blobs in batch to:.Fetch all diff files from database merge_request_diff_files.In order to present diffs information on the merge request diffs page, we: (see the Diff limits section) are not persisted in the database. However, diff files larger than defined safety limits Then persisted on merge_request_diff_files table.Įven though diffs larger than 10% of the value of ApplicationSettings#diff_max_patch_bytes are collapsed, The diffs fetching process limits single file diff sizes and the overall size of the whole diff through a series of constant values. We fetch the comparison information using Gitlab::Git::Compare, which fetches base and head data using Gitaly and diff between them through When refreshing a merge request (pushing to a source branch, force-pushing to target branch, or if the target branch now contains any commits from the MR) Architecture overview Merge request diffs Have changed since then, it should still serve as a good introduction. ) on GitLab Diffs and Commenting on Diffsįunctionality to share domain-specific knowledge with anyone who may work in this part of theĮverything covered in this deep dive was accurate as of GitLab 11.7, and while specific details may In January 2019, Oswaldo Ferreira hosted a Deep Dive (GitLab team members only: Redis (cached highlighted diffs) Deep Dive.Database (through merge_request_diff_files).We rely on different sources to present diffs. Merge request diffs against the HEAD of the target branch Working with diffs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |