Feature flag removal: Enforce the commit size limits on MCP add_commit

What does this MR do and why?

!264203 (merged) applied the REST commit size cap (300 MiB by default) and the user_large_commit_request rate limit (three commits over 20 MiB every 30 seconds per user) to MCP add_commit, behind the mcp_add_commit_size_limits flag. The flag has been on for everyone on GitLab.com since 2026-11-02. This MR removes the flag and its log-only branch, so the limits also apply on self-managed and Dedicated.

Why this is safe to remove
  • The code that's left is exactly what GitLab.com has run since the flag went on.
  • On staging, the fourth 21 MiB add_commit call in a row returned rate_limited. Calls under the quota went through the limiter and on to the commit.
  • The limits are the ones POST /projects/:id/repository/commits already enforces, and the two share one quota.

References

Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636332 (rollout) and https://gitlab.com/gitlab-org/gitlab/-/work_items/635014

Screenshots or screen recordings

No UI change.

Commit size Before (flag off) After
Over 20 MiB, fourth in 30 seconds Commits, logs rule: user_large_commit_request rate_limited error
Over 300 MiB Commits, logs rule: max_request_size bad_request error, "The commit exceeds the 300 MB request size limit"

How to set up and validate locally

The steps in !264203 (merged)'s "How to set up and validate locally" for the flag-on case now give the same output without enabling the flag. The flag-off steps no longer apply.

spec/services/mcp/tools/repositories/add_commit_service_spec.rb: 51 examples, 0 failures

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.

Merge request reports

Loading
Loading