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
328d90d1
Commit
328d90d1
authored
Dec 09, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix kwargs deprecation warnings for Ruby 2.7
Fixes a new batch of deprecation warnings
parent
37bc6d03
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
34 additions
and
23 deletions
+34
-23
lib/api/validations/validators/absence.rb
lib/api/validations/validators/absence.rb
+1
-1
lib/api/validations/validators/array_none_any.rb
lib/api/validations/validators/array_none_any.rb
+4
-2
lib/api/validations/validators/check_assignees_count.rb
lib/api/validations/validators/check_assignees_count.rb
+4
-3
lib/api/validations/validators/email_or_email_list.rb
lib/api/validations/validators/email_or_email_list.rb
+2
-1
lib/api/validations/validators/file_path.rb
lib/api/validations/validators/file_path.rb
+4
-2
lib/api/validations/validators/git_ref.rb
lib/api/validations/validators/git_ref.rb
+4
-2
lib/api/validations/validators/git_sha.rb
lib/api/validations/validators/git_sha.rb
+4
-2
lib/api/validations/validators/integer_none_any.rb
lib/api/validations/validators/integer_none_any.rb
+1
-1
lib/api/validations/validators/integer_or_custom_value.rb
lib/api/validations/validators/integer_or_custom_value.rb
+4
-3
lib/api/validations/validators/limit.rb
lib/api/validations/validators/limit.rb
+2
-1
lib/api/validations/validators/untrusted_regexp.rb
lib/api/validations/validators/untrusted_regexp.rb
+1
-1
lib/gitlab/checks/timed_logger.rb
lib/gitlab/checks/timed_logger.rb
+1
-1
lib/gitlab/ci/ansi2json/converter.rb
lib/gitlab/ci/ansi2json/converter.rb
+1
-2
lib/gitlab/email/handler/reply_processing.rb
lib/gitlab/email/handler/reply_processing.rb
+1
-1
No files found.
lib/api/validations/validators/absence.rb
View file @
328d90d1
...
...
@@ -7,7 +7,7 @@ module API
def
validate_param!
(
attr_name
,
params
)
return
if
params
.
respond_to?
(
:key?
)
&&
!
params
.
key?
(
attr_name
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
message
(
:absence
)
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
message
(
:absence
)
)
end
end
end
...
...
lib/api/validations/validators/array_none_any.rb
View file @
328d90d1
...
...
@@ -10,8 +10,10 @@ module API
return
if
value
.
is_a?
(
Array
)
||
[
IssuableFinder
::
Params
::
FILTER_NONE
,
IssuableFinder
::
Params
::
FILTER_ANY
].
include?
(
value
.
to_s
.
downcase
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be an array, 'None' or 'Any'"
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be an array, 'None' or 'Any'"
)
end
end
end
...
...
lib/api/validations/validators/check_assignees_count.rb
View file @
328d90d1
...
...
@@ -18,9 +18,10 @@ module API
def
validate_param!
(
attr_name
,
params
)
return
if
param_allowed?
(
attr_name
,
params
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"allows one value, but found
#{
params
[
attr_name
].
size
}
:
#{
params
[
attr_name
].
join
(
", "
)
}
"
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"allows one value, but found
#{
params
[
attr_name
].
size
}
:
#{
params
[
attr_name
].
join
(
", "
)
}
"
)
end
private
...
...
lib/api/validations/validators/email_or_email_list.rb
View file @
328d90d1
...
...
@@ -11,9 +11,10 @@ module API
return
if
value
.
split
(
','
).
map
{
|
v
|
ValidateEmail
.
valid?
(
v
)
}.
all?
raise
Grape
::
Exceptions
::
Validation
,
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"contains an invalid email address"
)
end
end
end
...
...
lib/api/validations/validators/file_path.rb
View file @
328d90d1
...
...
@@ -11,8 +11,10 @@ module API
path
=
Gitlab
::
Utils
.
check_path_traversal!
(
path
)
Gitlab
::
Utils
.
check_allowed_absolute_path!
(
path
,
path_allowlist
)
rescue
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be a valid file path"
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be a valid file path"
)
end
end
end
...
...
lib/api/validations/validators/git_ref.rb
View file @
328d90d1
...
...
@@ -17,8 +17,10 @@ module API
return
unless
invalid_character?
(
revision
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
'should be a valid reference path'
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
'should be a valid reference path'
)
end
private
...
...
lib/api/validations/validators/git_sha.rb
View file @
328d90d1
...
...
@@ -9,8 +9,10 @@ module API
return
if
Commit
::
EXACT_COMMIT_SHA_PATTERN
.
match?
(
sha
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be a valid sha"
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be a valid sha"
)
end
end
end
...
...
lib/api/validations/validators/integer_none_any.rb
View file @
328d90d1
...
...
@@ -6,7 +6,7 @@ module API
class
IntegerNoneAny
<
IntegerOrCustomValue
private
def
extract_custom_values
(
options
)
def
extract_custom_values
(
_
options
)
[
IssuableFinder
::
Params
::
FILTER_NONE
,
IssuableFinder
::
Params
::
FILTER_ANY
]
end
end
...
...
lib/api/validations/validators/integer_or_custom_value.rb
View file @
328d90d1
...
...
@@ -16,9 +16,10 @@ module API
return
if
@custom_values
.
map
(
&
:downcase
).
include?
(
value
.
to_s
.
downcase
)
valid_options
=
Gitlab
::
Utils
.
to_exclusive_sentence
([
'an integer'
]
+
@custom_values
)
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be
#{
valid_options
}
, however got
#{
value
}
"
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"should be
#{
valid_options
}
, however got
#{
value
}
"
)
end
private
...
...
lib/api/validations/validators/limit.rb
View file @
328d90d1
...
...
@@ -9,9 +9,10 @@ module API
return
if
value
.
size
<=
@option
raise
Grape
::
Exceptions
::
Validation
,
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
"
#{
@scope
.
full_name
(
attr_name
)
}
must be less than
#{
@option
}
characters"
)
end
end
end
...
...
lib/api/validations/validators/untrusted_regexp.rb
View file @
328d90d1
...
...
@@ -11,7 +11,7 @@ module API
Gitlab
::
UntrustedRegexp
.
new
(
value
)
rescue
RegexpError
=>
e
message
=
"is an invalid regexp:
#{
e
.
message
}
"
raise
Grape
::
Exceptions
::
Validation
,
params:
[
@scope
.
full_name
(
attr_name
)],
message:
message
raise
Grape
::
Exceptions
::
Validation
.
new
(
params:
[
@scope
.
full_name
(
attr_name
)],
message:
message
)
end
end
end
...
...
lib/gitlab/checks/timed_logger.rb
View file @
328d90d1
...
...
@@ -31,7 +31,7 @@ module Gitlab
args
=
{
cancelled:
true
}
args
[
:start
]
=
start
if
timed
append_message
(
log_message
+
time_suffix_message
(
args
))
append_message
(
log_message
+
time_suffix_message
(
**
args
))
raise
TimeoutError
end
...
...
lib/gitlab/ci/ansi2json/converter.rb
View file @
328d90d1
...
...
@@ -22,8 +22,7 @@ module Gitlab
start_offset
=
@state
.
offset
@state
.
new_line!
(
style:
Style
.
new
(
@state
.
inherited_style
))
@state
.
new_line!
(
style:
Style
.
new
(
**
@state
.
inherited_style
))
stream
.
each_line
do
|
line
|
consume_line
(
line
)
...
...
lib/gitlab/email/handler/reply_processing.rb
View file @
328d90d1
...
...
@@ -45,7 +45,7 @@ module Gitlab
end
def
add_attachments
(
reply
)
attachments
=
Email
::
AttachmentUploader
.
new
(
mail
).
execute
(
upload_params
)
attachments
=
Email
::
AttachmentUploader
.
new
(
mail
).
execute
(
**
upload_params
)
reply
+
attachments
.
map
do
|
link
|
"
\n\n
#{
link
[
:markdown
]
}
"
...
...
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