Display rapid diffs warning on the MR creation page
What does this MR do and why?
Related to: Diff limits overflow not sent on merge request ... (#535135 - closed)
This MR ensures that overflow warnings are displayed in the MR creation when files are collapsed due to GitLab's safe diff limits.
Previously, the warning did not appear in these views because the overflow flag was only set when Gitaly returned an overflow_marker (i.e., hard limit exceeded), and did not account for collapsed files due to soft limits.
Changes
-
Add new ivar
@collapsed_safe_limitsinGitlab::Git::DiffCollectionwhen a diff from Gitaly is marked as collapsed. -
Add
#collapsed_safe_limits?method toDiffCollection. -
Update
overflow_safe?logic inDiffsStatsEntityto checkcollapsed_safe_limits?in addition to existing flags.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
After |
How to set up and validate locally
- Enable
rapid_diffsandrapid_diffs_on_mr_creationfeature flags - Go to merge requests list (ex.:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests) - Click 'New merge request'
- Select branches (pick the ones that would show up many changes), proceed to the next page
- Select 'Changes' tab
- Observe no warning (assumes you have enough files/lines to trigger the warning)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
