Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
22972dfd
Commit
22972dfd
authored
Nov 02, 2020
by
Kerri Miller
Committed by
Sean McGivern
Nov 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update diff_max_patch_bytes from 100kb -> 200kb
parent
ce9225c0
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
6 deletions
+46
-6
changelogs/unreleased/kerrizor-increase-default-diff_max_patch_bytes.yml
...leased/kerrizor-increase-default-diff_max_patch_bytes.yml
+5
-0
db/migrate/20201027211138_increase_default_diff_max_patch_bytes.rb
...e/20201027211138_increase_default_diff_max_patch_bytes.rb
+9
-0
db/migrate/20201028204306_migrate_default_diff_max_patch_bytes_to_minimum_200kb.rb
..._migrate_default_diff_max_patch_bytes_to_minimum_200kb.rb
+20
-0
db/schema_migrations/20201027211138
db/schema_migrations/20201027211138
+1
-0
db/schema_migrations/20201028204306
db/schema_migrations/20201028204306
+1
-0
db/structure.sql
db/structure.sql
+1
-1
lib/gitlab/git/diff.rb
lib/gitlab/git/diff.rb
+1
-1
spec/features/expand_collapse_diffs_spec.rb
spec/features/expand_collapse_diffs_spec.rb
+2
-0
spec/features/merge_request/user_expands_diff_spec.rb
spec/features/merge_request/user_expands_diff_spec.rb
+2
-0
spec/lib/gitlab/gitaly_client/commit_service_spec.rb
spec/lib/gitlab/gitaly_client/commit_service_spec.rb
+2
-2
spec/requests/api/settings_spec.rb
spec/requests/api/settings_spec.rb
+2
-2
No files found.
changelogs/unreleased/kerrizor-increase-default-diff_max_patch_bytes.yml
0 → 100644
View file @
22972dfd
---
title
:
Update diff_max_patch_bytes from 100kb -> 200kb
merge_request
:
46276
author
:
type
:
changed
db/migrate/20201027211138_increase_default_diff_max_patch_bytes.rb
0 → 100644
View file @
22972dfd
# frozen_string_literal: true
class
IncreaseDefaultDiffMaxPatchBytes
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
change
change_column_default
(
:application_settings
,
:diff_max_patch_bytes
,
from:
102400
,
to:
204800
)
end
end
db/migrate/20201028204306_migrate_default_diff_max_patch_bytes_to_minimum_200kb.rb
0 → 100644
View file @
22972dfd
# frozen_string_literal: true
class
MigrateDefaultDiffMaxPatchBytesToMinimum200kb
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
MAX_SIZE
=
200
.
kilobytes
class
ApplicationSetting
<
ActiveRecord
::
Base
self
.
table_name
=
'application_settings'
end
def
up
table
=
ApplicationSetting
.
arel_table
ApplicationSetting
.
where
(
table
[
:diff_max_patch_bytes
].
lt
(
MAX_SIZE
)).
update_all
(
diff_max_patch_bytes:
MAX_SIZE
)
end
def
down
table
=
ApplicationSetting
.
arel_table
ApplicationSetting
.
where
(
table
[
:diff_max_patch_bytes
].
eq
(
MAX_SIZE
)).
update_all
(
diff_max_patch_bytes:
100
.
kilobytes
)
end
end
db/schema_migrations/20201027211138
0 → 100644
View file @
22972dfd
402e9a6e92802888ba01ee216850ab5b0fe9997a84415c9ffe8d5d37a9823220
\ No newline at end of file
db/schema_migrations/20201028204306
0 → 100644
View file @
22972dfd
ec5bab20a1b591b77b48b85dc0b871e88a41891d256201b7d8eb86195ef1c4ad
\ No newline at end of file
db/structure.sql
View file @
22972dfd
...
...
@@ -9171,7 +9171,7 @@ CREATE TABLE application_settings (
custom_project_templates_group_id
integer
,
usage_stats_set_by_user_id
integer
,
receive_max_input_size
integer
,
diff_max_patch_bytes
integer
DEFAULT
1024
00
NOT
NULL
,
diff_max_patch_bytes
integer
DEFAULT
2048
00
NOT
NULL
,
archive_builds_in_seconds
integer
,
commit_email_hostname
character
varying
,
protected_ci_variables
boolean
DEFAULT
true
NOT
NULL
,
...
...
lib/gitlab/git/diff.rb
View file @
22972dfd
...
...
@@ -25,7 +25,7 @@ module Gitlab
#
# If this value ever changes, make sure to create a migration to update
# current records, and default of `ApplicationSettings#diff_max_patch_bytes`.
DEFAULT_MAX_PATCH_BYTES
=
1
00
.
kilobytes
DEFAULT_MAX_PATCH_BYTES
=
2
00
.
kilobytes
# This is a limitation applied on the source (Gitaly), therefore we don't allow
# persisting limits over that.
...
...
spec/features/expand_collapse_diffs_spec.rb
View file @
22972dfd
...
...
@@ -8,6 +8,8 @@ RSpec.describe 'Expand and collapse diffs', :js do
before
do
stub_feature_flags
(
increased_diff_limits:
false
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:diff_max_patch_bytes
).
and_return
(
100
.
kilobytes
)
sign_in
(
create
(
:admin
))
# Ensure that undiffable.md is in .gitattributes
...
...
spec/features/merge_request/user_expands_diff_spec.rb
View file @
22972dfd
...
...
@@ -8,6 +8,8 @@ RSpec.describe 'User expands diff', :js do
before
do
stub_feature_flags
(
increased_diff_limits:
false
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:diff_max_patch_bytes
).
and_return
(
100
.
kilobytes
)
visit
(
diffs_project_merge_request_path
(
project
,
merge_request
))
wait_for_requests
...
...
spec/lib/gitlab/gitaly_client/commit_service_spec.rb
View file @
22972dfd
...
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
safe_max_files:
100
,
safe_max_lines:
5000
,
safe_max_bytes:
512000
,
max_patch_bytes:
1024
00
max_patch_bytes:
2048
00
)
expect_any_instance_of
(
Gitaly
::
DiffService
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
,
kind_of
(
Hash
))
...
...
@@ -57,7 +57,7 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
safe_max_files:
100
,
safe_max_lines:
5000
,
safe_max_bytes:
512000
,
max_patch_bytes:
1024
00
max_patch_bytes:
2048
00
)
expect_any_instance_of
(
Gitaly
::
DiffService
::
Stub
).
to
receive
(
:commit_diff
).
with
(
request
,
kind_of
(
Hash
))
...
...
spec/requests/api/settings_spec.rb
View file @
22972dfd
...
...
@@ -105,7 +105,7 @@ RSpec.describe API::Settings, 'Settings' do
enforce_terms:
true
,
terms:
'Hello world!'
,
performance_bar_allowed_group_path:
group
.
full_path
,
diff_max_patch_bytes:
15
0_000
,
diff_max_patch_bytes:
30
0_000
,
default_branch_protection:
::
Gitlab
::
Access
::
PROTECTION_DEV_CAN_MERGE
,
local_markdown_version:
3
,
allow_local_requests_from_web_hooks_and_services:
true
,
...
...
@@ -148,7 +148,7 @@ RSpec.describe API::Settings, 'Settings' do
expect
(
json_response
[
'enforce_terms'
]).
to
be
(
true
)
expect
(
json_response
[
'terms'
]).
to
eq
(
'Hello world!'
)
expect
(
json_response
[
'performance_bar_allowed_group_id'
]).
to
eq
(
group
.
id
)
expect
(
json_response
[
'diff_max_patch_bytes'
]).
to
eq
(
15
0_000
)
expect
(
json_response
[
'diff_max_patch_bytes'
]).
to
eq
(
30
0_000
)
expect
(
json_response
[
'default_branch_protection'
]).
to
eq
(
Gitlab
::
Access
::
PROTECTION_DEV_CAN_MERGE
)
expect
(
json_response
[
'local_markdown_version'
]).
to
eq
(
3
)
expect
(
json_response
[
'allow_local_requests_from_web_hooks_and_services'
]).
to
eq
(
true
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment