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
0b5fa2d4
Commit
0b5fa2d4
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 several deprecation warnings
parent
37bc6d03
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
14 deletions
+15
-14
app/services/issuable/import_csv/base_service.rb
app/services/issuable/import_csv/base_service.rb
+3
-4
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+1
-1
app/services/upload_service.rb
app/services/upload_service.rb
+5
-3
app/views/projects/issues/_issue.html.haml
app/views/projects/issues/_issue.html.haml
+1
-1
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
app/workers/concerns/worker_context.rb
app/workers/concerns/worker_context.rb
+2
-2
lib/gitlab/batch_worker_context.rb
lib/gitlab/batch_worker_context.rb
+1
-1
No files found.
app/services/issuable/import_csv/base_service.rb
View file @
0b5fa2d4
...
@@ -40,13 +40,12 @@ module Issuable
...
@@ -40,13 +40,12 @@ module Issuable
csv_data
=
@csv_io
.
open
(
&
:read
).
force_encoding
(
Encoding
::
UTF_8
)
csv_data
=
@csv_io
.
open
(
&
:read
).
force_encoding
(
Encoding
::
UTF_8
)
validate_headers_presence!
(
csv_data
.
lines
.
first
)
validate_headers_presence!
(
csv_data
.
lines
.
first
)
csv_parsing_params
=
{
CSV
.
new
(
csv_data
,
col_sep:
detect_col_sep
(
csv_data
.
lines
.
first
),
col_sep:
detect_col_sep
(
csv_data
.
lines
.
first
),
headers:
true
,
headers:
true
,
header_converters: :symbol
header_converters: :symbol
}
).
each
.
with_index
(
2
)
CSV
.
new
(
csv_data
,
csv_parsing_params
).
each
.
with_index
(
2
)
end
end
def
validate_headers_presence!
(
headers
)
def
validate_headers_presence!
(
headers
)
...
...
app/services/notes/create_service.rb
View file @
0b5fa2d4
...
@@ -67,7 +67,7 @@ module Notes
...
@@ -67,7 +67,7 @@ module Notes
track_event
(
note
,
current_user
)
track_event
(
note
,
current_user
)
if
Feature
.
enabled?
(
:notes_create_service_tracking
,
project
)
if
Feature
.
enabled?
(
:notes_create_service_tracking
,
project
)
Gitlab
::
Tracking
.
event
(
'Notes::CreateService'
,
'execute'
,
tracking_data_for
(
note
))
Gitlab
::
Tracking
.
event
(
'Notes::CreateService'
,
'execute'
,
**
tracking_data_for
(
note
))
end
end
if
note
.
for_merge_request?
&&
note
.
diff_note?
&&
note
.
start_of_discussion?
if
note
.
for_merge_request?
&&
note
.
diff_note?
&&
note
.
start_of_discussion?
...
...
app/services/upload_service.rb
View file @
0b5fa2d4
...
@@ -6,16 +6,18 @@ class UploadService
...
@@ -6,16 +6,18 @@ class UploadService
end
end
def
execute
def
execute
return
unless
@file
&&
@
file
.
size
<=
max_attachment_size
return
unless
file
&&
file
.
size
<=
max_attachment_size
uploader
=
@uploader_class
.
new
(
@model
,
nil
,
@
uploader_context
)
uploader
=
uploader_class
.
new
(
model
,
nil
,
**
uploader_context
)
uploader
.
store!
(
@
file
)
uploader
.
store!
(
file
)
uploader
uploader
end
end
private
private
attr_reader
:model
,
:file
,
:uploader_class
,
:uploader_context
def
max_attachment_size
def
max_attachment_size
Gitlab
::
CurrentSettings
.
max_attachment_size
.
megabytes
.
to_i
Gitlab
::
CurrentSettings
.
max_attachment_size
.
megabytes
.
to_i
end
end
...
...
app/views/projects/issues/_issue.html.haml
View file @
0b5fa2d4
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
-
if
issue
.
service_desk_reply_to
-
if
issue
.
service_desk_reply_to
#{
issue
.
service_desk_reply_to
}
via
#{
issue
.
service_desk_reply_to
}
via
#{
link_to_member
(
@project
,
issue
.
author
,
avatar:
false
)
}
#{
link_to_member
(
@project
,
issue
.
author
,
avatar:
false
)
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
{
author:
issue
.
author
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
author:
issue
.
author
-
if
issue
.
milestone
-
if
issue
.
milestone
%span
.issuable-milestone.d-none.d-sm-inline-block
%span
.issuable-milestone.d-none.d-sm-inline-block
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
0b5fa2d4
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
·
·
opened
#{
time_ago_with_tooltip
(
merge_request
.
created_at
,
placement:
'bottom'
)
}
opened
#{
time_ago_with_tooltip
(
merge_request
.
created_at
,
placement:
'bottom'
)
}
by
#{
link_to_member
(
@project
,
merge_request
.
author
,
avatar:
false
)
}
by
#{
link_to_member
(
@project
,
merge_request
.
author
,
avatar:
false
)
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
{
author:
merge_request
.
author
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
author:
merge_request
.
author
-
if
merge_request
.
milestone
-
if
merge_request
.
milestone
%span
.issuable-milestone.d-none.d-sm-inline-block
%span
.issuable-milestone.d-none.d-sm-inline-block
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
0b5fa2d4
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
=
f
.
hidden_field
'milestone_id'
,
value:
milestone
[
:id
],
id:
nil
=
f
.
hidden_field
'milestone_id'
,
value:
milestone
[
:id
],
id:
nil
=
dropdown_tag
(
'Milestone'
,
options:
{
title:
_
(
'Assign milestone'
),
toggle_class:
'js-milestone-select js-extra-options'
,
filter:
true
,
dropdown_class:
'dropdown-menu-selectable'
,
placeholder:
_
(
'Search milestones'
),
data:
{
show_no:
true
,
field_name:
"
#{
issuable_type
}
[milestone_id]"
,
project_id:
issuable_sidebar
[
:project_id
],
issuable_id:
issuable_sidebar
[
:id
],
ability_name:
issuable_type
,
issue_update:
issuable_sidebar
[
:issuable_json_path
],
use_id:
true
,
default_no:
true
,
selected:
milestone
[
:title
],
null_default:
true
,
display:
'static'
}})
=
dropdown_tag
(
'Milestone'
,
options:
{
title:
_
(
'Assign milestone'
),
toggle_class:
'js-milestone-select js-extra-options'
,
filter:
true
,
dropdown_class:
'dropdown-menu-selectable'
,
placeholder:
_
(
'Search milestones'
),
data:
{
show_no:
true
,
field_name:
"
#{
issuable_type
}
[milestone_id]"
,
project_id:
issuable_sidebar
[
:project_id
],
issuable_id:
issuable_sidebar
[
:id
],
ability_name:
issuable_type
,
issue_update:
issuable_sidebar
[
:issuable_json_path
],
use_id:
true
,
default_no:
true
,
selected:
milestone
[
:title
],
null_default:
true
,
display:
'static'
}})
-
if
@project
.
group
.
present?
-
if
@project
.
group
.
present?
=
render_if_exists
'shared/issuable/iteration_select'
,
{
can_edit:
can_edit_issuable
,
group_path:
@project
.
group
.
full_path
,
project_path:
issuable_sidebar
[
:project_full_path
],
issue_iid:
issuable_sidebar
[
:iid
],
issuable_type:
issuable_type
}
=
render_if_exists
'shared/issuable/iteration_select'
,
can_edit:
can_edit_issuable
,
group_path:
@project
.
group
.
full_path
,
project_path:
issuable_sidebar
[
:project_full_path
],
issue_iid:
issuable_sidebar
[
:iid
],
issuable_type:
issuable_type
-
if
issuable_sidebar
[
:supports_time_tracking
]
-
if
issuable_sidebar
[
:supports_time_tracking
]
#issuable-time-tracker
.block
#issuable-time-tracker
.block
...
...
app/workers/concerns/worker_context.rb
View file @
0b5fa2d4
...
@@ -5,7 +5,7 @@ module WorkerContext
...
@@ -5,7 +5,7 @@ module WorkerContext
class_methods
do
class_methods
do
def
worker_context
(
attributes
)
def
worker_context
(
attributes
)
@worker_context
=
Gitlab
::
ApplicationContext
.
new
(
attributes
)
@worker_context
=
Gitlab
::
ApplicationContext
.
new
(
**
attributes
)
end
end
def
get_worker_context
def
get_worker_context
...
@@ -60,6 +60,6 @@ module WorkerContext
...
@@ -60,6 +60,6 @@ module WorkerContext
end
end
def
with_context
(
context
,
&
block
)
def
with_context
(
context
,
&
block
)
Gitlab
::
ApplicationContext
.
new
(
context
).
use
{
yield
(
**
context
)
}
Gitlab
::
ApplicationContext
.
new
(
**
context
).
use
{
yield
(
**
context
)
}
end
end
end
end
lib/gitlab/batch_worker_context.rb
View file @
0b5fa2d4
...
@@ -23,7 +23,7 @@ module Gitlab
...
@@ -23,7 +23,7 @@ module Gitlab
def
context_by_arguments
def
context_by_arguments
@context_by_arguments
||=
objects
.
each_with_object
({})
do
|
object
,
result
|
@context_by_arguments
||=
objects
.
each_with_object
({})
do
|
object
,
result
|
arguments
=
Array
.
wrap
(
arguments_proc
.
call
(
object
))
arguments
=
Array
.
wrap
(
arguments_proc
.
call
(
object
))
context
=
Gitlab
::
ApplicationContext
.
new
(
context_proc
.
call
(
object
))
context
=
Gitlab
::
ApplicationContext
.
new
(
**
context_proc
.
call
(
object
))
result
[
arguments
]
=
context
result
[
arguments
]
=
context
end
end
...
...
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