Skip to content

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

Screenshot_2025-03-26_at_11.22.01

How to set up and validate locally

  1. In rails console enable the experiment fully
    Feature.enable(:merge_requests_diff_commits_limit)
  2. Modify code and set DIFF_COMMITS_LIMIT to a lower value (for example, 2)
  3. Create a merge request and verify that the new diff version was created
  4. Push new changes to the merge request branch
  5. When the limit is reached, you will see a warning message
  6. 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

Merge request reports

Loading