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
384840bd
Commit
384840bd
authored
Mar 26, 2020
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 0 for max_pages_size as infinity
parent
20ea35d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
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
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+4
-4
No files found.
app/models/application_setting.rb
View file @
384840bd
...
...
@@ -137,7 +137,7 @@ class ApplicationSetting < ApplicationRecord
validates
:max_pages_size
,
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
}
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 @
384840bd
---
title
:
Allow 0 for pages size limit setting in admin settings
merge_request
:
28086
author
:
type
:
fixed
spec/models/application_setting_spec.rb
View file @
384840bd
...
...
@@ -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_presence_of
(
:max_artifacts_size
)
}
it
do
is_expected
.
to
validate_numericality_of
(
:max_pages_size
).
only_integer
.
is_greater_than
(
0
)
it
{
is_expected
.
to
validate_numericality_of
(
:max_artifacts_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
)
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
(
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