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
03a70b84
Commit
03a70b84
authored
Mar 26, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
165beade
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
19 deletions
+27
-19
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
changelogs/unreleased/199422-maximum-size-for-gitlab-pages-says-to-set-it-to-0-for-unlimited-bu.yml
...for-gitlab-pages-says-to-set-it-to-0-for-unlimited-bu.yml
+5
-0
changelogs/unreleased/share-redis-cache-connection-pool.yml
changelogs/unreleased/share-redis-cache-connection-pool.yml
+5
-0
config/application.rb
config/application.rb
+2
-9
lib/gitlab/import_export/json/streaming_serializer.rb
lib/gitlab/import_export/json/streaming_serializer.rb
+6
-4
lib/gitlab/redis/wrapper.rb
lib/gitlab/redis/wrapper.rb
+4
-1
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+4
-4
No files found.
app/models/application_setting.rb
View file @
03a70b84
...
@@ -137,7 +137,7 @@ class ApplicationSetting < ApplicationRecord
...
@@ -137,7 +137,7 @@ class ApplicationSetting < ApplicationRecord
validates
:max_pages_size
,
validates
:max_pages_size
,
presence:
true
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
,
numericality:
{
only_integer:
true
,
greater_than
_or_equal_to
:
0
,
less_than:
::
Gitlab
::
Pages
::
MAX_SIZE
/
1
.
megabyte
}
less_than:
::
Gitlab
::
Pages
::
MAX_SIZE
/
1
.
megabyte
}
validates
:default_artifacts_expire_in
,
presence:
true
,
duration:
true
validates
:default_artifacts_expire_in
,
presence:
true
,
duration:
true
...
...
changelogs/unreleased/199422-maximum-size-for-gitlab-pages-says-to-set-it-to-0-for-unlimited-bu.yml
0 → 100644
View file @
03a70b84
---
title
:
Allow 0 for pages size limit setting in admin settings
merge_request
:
28086
author
:
type
:
fixed
changelogs/unreleased/share-redis-cache-connection-pool.yml
0 → 100644
View file @
03a70b84
---
title
:
Make Rails.cache and Gitlab::Redis::Cache share the same Redis connection pool
merge_request
:
28074
author
:
type
:
performance
config/application.rb
View file @
03a70b84
...
@@ -258,18 +258,11 @@ module Gitlab
...
@@ -258,18 +258,11 @@ module Gitlab
# Use caching across all environments
# Use caching across all environments
# Full list of options:
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
caching_config_hash
=
Gitlab
::
Redis
::
Cache
.
params
caching_config_hash
=
{}
caching_config_hash
[
:redis
]
=
Gitlab
::
Redis
::
Cache
.
pool
caching_config_hash
[
:compress
]
=
Gitlab
::
Utils
.
to_boolean
(
ENV
.
fetch
(
'ENABLE_REDIS_CACHE_COMPRESSION'
,
'1'
))
caching_config_hash
[
:compress
]
=
Gitlab
::
Utils
.
to_boolean
(
ENV
.
fetch
(
'ENABLE_REDIS_CACHE_COMPRESSION'
,
'1'
))
caching_config_hash
[
:namespace
]
=
Gitlab
::
Redis
::
Cache
::
CACHE_NAMESPACE
caching_config_hash
[
:namespace
]
=
Gitlab
::
Redis
::
Cache
::
CACHE_NAMESPACE
caching_config_hash
[
:expires_in
]
=
2
.
weeks
# Cache should not grow forever
caching_config_hash
[
:expires_in
]
=
2
.
weeks
# Cache should not grow forever
if
Gitlab
::
Runtime
.
multi_threaded?
caching_config_hash
[
:pool_size
]
=
Gitlab
::
Redis
::
Cache
.
pool_size
caching_config_hash
[
:pool_timeout
]
=
1
end
# Overrides RedisCacheStore's default value of 0
# This makes the default value the same with Gitlab::Redis::Cache
caching_config_hash
[
:reconnect_attempts
]
||=
::
Redis
::
Client
::
DEFAULTS
[
:reconnect_attempts
]
config
.
cache_store
=
:redis_cache_store
,
caching_config_hash
config
.
cache_store
=
:redis_cache_store
,
caching_config_hash
...
...
lib/gitlab/import_export/json/streaming_serializer.rb
View file @
03a70b84
...
@@ -69,13 +69,15 @@ module Gitlab
...
@@ -69,13 +69,15 @@ module Gitlab
end
end
def
serialize_many_each
(
key
,
records
,
options
)
def
serialize_many_each
(
key
,
records
,
options
)
enumerator
=
Enumerator
.
new
do
|
items
|
records
.
each
do
|
record
|
records
.
each
do
|
record
|
json
=
Raw
.
new
(
record
.
to_json
(
options
))
items
<<
Raw
.
new
(
record
.
to_json
(
options
))
json_writer
.
append
(
key
,
json
)
end
end
end
end
json_writer
.
write_relation_array
(
@exportable_path
,
key
,
enumerator
)
end
def
serialize_single_relation
(
key
,
record
,
options
)
def
serialize_single_relation
(
key
,
record
,
options
)
json
=
Raw
.
new
(
record
.
to_json
(
options
))
json
=
Raw
.
new
(
record
.
to_json
(
options
))
...
...
lib/gitlab/redis/wrapper.rb
View file @
03a70b84
...
@@ -15,8 +15,11 @@ module Gitlab
...
@@ -15,8 +15,11 @@ module Gitlab
delegate
:params
,
:url
,
to: :new
delegate
:params
,
:url
,
to: :new
def
with
def
with
pool
.
with
{
|
redis
|
yield
redis
}
end
def
pool
@pool
||=
ConnectionPool
.
new
(
size:
pool_size
)
{
::
Redis
.
new
(
params
)
}
@pool
||=
ConnectionPool
.
new
(
size:
pool_size
)
{
::
Redis
.
new
(
params
)
}
@pool
.
with
{
|
redis
|
yield
redis
}
end
end
def
pool_size
def
pool_size
...
...
spec/models/application_setting_spec.rb
View file @
03a70b84
...
@@ -69,12 +69,12 @@ describe ApplicationSetting do
...
@@ -69,12 +69,12 @@ describe ApplicationSetting do
it
{
is_expected
.
to
validate_numericality_of
(
:snippet_size_limit
).
only_integer
.
is_greater_than
(
0
)
}
it
{
is_expected
.
to
validate_numericality_of
(
:snippet_size_limit
).
only_integer
.
is_greater_than
(
0
)
}
it
{
is_expected
.
to
validate_presence_of
(
:max_artifacts_size
)
}
it
{
is_expected
.
to
validate_presence_of
(
:max_artifacts_size
)
}
it
do
it
{
is_expected
.
to
validate_numericality_of
(
:max_artifacts_size
).
only_integer
.
is_greater_than
(
0
)
}
is_expected
.
to
validate_numericality_of
(
:max_pages_size
).
only_integer
.
is_greater_than
(
0
)
it
{
is_expected
.
to
validate_presence_of
(
:max_pages_size
)
}
it
'ensures max_pages_size is an integer greater than 0 (or equal to 0 to indicate unlimited/maximum)'
do
is_expected
.
to
validate_numericality_of
(
:max_pages_size
).
only_integer
.
is_greater_than_or_equal_to
(
0
)
.
is_less_than
(
::
Gitlab
::
Pages
::
MAX_SIZE
/
1
.
megabyte
)
.
is_less_than
(
::
Gitlab
::
Pages
::
MAX_SIZE
/
1
.
megabyte
)
end
end
it
{
is_expected
.
to
validate_numericality_of
(
:max_artifacts_size
).
only_integer
.
is_greater_than
(
0
)
}
it
{
is_expected
.
to
validate_numericality_of
(
:max_pages_size
).
only_integer
.
is_greater_than
(
0
)
}
it
{
is_expected
.
not_to
allow_value
(
7
).
for
(
:minimum_password_length
)
}
it
{
is_expected
.
not_to
allow_value
(
7
).
for
(
:minimum_password_length
)
}
it
{
is_expected
.
not_to
allow_value
(
129
).
for
(
:minimum_password_length
)
}
it
{
is_expected
.
not_to
allow_value
(
129
).
for
(
:minimum_password_length
)
}
...
...
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