Merge branch 'limit-email-diff-size' into 'master'

Limit push email diff size

Restrict the size of diffs in push emails to 30 lines / 150 KB (whichever is smaller),
following https://gitlab.com/gitlab-org/gitlab_git/merge_requests/85.

Emails on push can get very large if they contain a lot of files that sneak under the single-file limit.

https://gitlab.com/gitlab-org/gitlab-ee/issues/490

See merge request !4566
This commit is contained in:
Robert Speicher 2016-06-20 13:26:16 +00:00
commit 160499b525
2 changed files with 2 additions and 1 deletions

View File

@ -55,6 +55,7 @@ v 8.9.0 (unreleased)
- Add `sha` parameter to MR merge API, to ensure only reviewed changes are merged
- Don't allow MRs to be merged when commits were added since the last review / page load
- Add DB index on users.state
- Limit email on push diff size to 30 files / 150 KB
- Add rake task 'gitlab:db:configure' for conditionally seeding or migrating the database
- Changed the Slack build message to use the singular duration if necessary (Aran Koning)
- Fix race condition on merge when build succeeds

View File

@ -37,7 +37,7 @@ module Gitlab
end
def diffs
@diffs ||= (safe_diff_files(compare.diffs, diff_refs) if compare)
@diffs ||= (safe_diff_files(compare.diffs(max_files: 30), diff_refs) if compare)
end
def diffs_count