Add a upper limit for merge request diffs versions
What does this MR do and why?
Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/517497
Problem
The upper limit for merge request diffs version is missing.
Solution
- Stop creating new diffs versions after reaching the limit.
- Display an error message to the user
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In rails console enable the experiment fully
Feature.enable(:merge_requests_diffs_limit) - Modify code and set
DIFF_VERSION_LIMITto a lower value (for example,2) - Create a merge request and verify that the new diff version was created
- Push new changes to the merge request branch
- When the limit is reached, you will see a warning message
- Changes from the push will not be visible on the merge request
Edited by Vasilii Iakliushin