Add a upper limit for merge request diff commits
What does this MR do and why?
Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/524619
Problem
The upper limit for merge request diff commits is missing.
Solution
- Stop creating new diffs versions after reaching the limit.
- Display an error message to the user
References
https://gitlab.com/gitlab-org/gitlab/-/issues/524619
Screenshots or screen recordings
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:merge_requests_diff_commits_limit)
- Modify code and set
DIFF_COMMITS_LIMIT
to 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
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.
Related to #524619
Edited by Vasilii Iakliushin