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
b62ce98c
Commit
b62ce98c
authored
Apr 19, 2021
by
Shubham Kumar
Committed by
Kerri Miller
Apr 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolves rubocop offense Style/ParallelAssignment
parent
6853eeb8
Changes
130
Show whitespace changes
Inline
Side-by-side
Showing
130 changed files
with
353 additions
and
154 deletions
+353
-154
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/controllers/clusters/clusters_controller.rb
app/controllers/clusters/clusters_controller.rb
+2
-1
app/controllers/projects/commits_controller.rb
app/controllers/projects/commits_controller.rb
+2
-1
app/finders/ci/variables_finder.rb
app/finders/ci/variables_finder.rb
+2
-1
app/finders/environments_by_deployments_finder.rb
app/finders/environments_by_deployments_finder.rb
+3
-1
app/finders/environments_finder.rb
app/finders/environments_finder.rb
+3
-1
app/finders/metrics/dashboards/annotations_finder.rb
app/finders/metrics/dashboards/annotations_finder.rb
+2
-1
app/finders/metrics/users_starred_dashboards_finder.rb
app/finders/metrics/users_starred_dashboards_finder.rb
+3
-1
app/finders/packages/debian/distributions_finder.rb
app/finders/packages/debian/distributions_finder.rb
+2
-1
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+2
-1
app/models/ability.rb
app/models/ability.rb
+2
-1
app/models/application_setting_implementation.rb
app/models/application_setting_implementation.rb
+6
-3
app/models/commit.rb
app/models/commit.rb
+2
-1
app/models/concerns/taskable.rb
app/models/concerns/taskable.rb
+2
-1
app/models/design_management/design_action.rb
app/models/design_management/design_action.rb
+3
-1
app/models/design_management/design_at_version.rb
app/models/design_management/design_at_version.rb
+2
-1
app/models/design_management/version.rb
app/models/design_management/version.rb
+3
-1
app/models/external_issue.rb
app/models/external_issue.rb
+2
-1
app/models/member.rb
app/models/member.rb
+3
-1
app/models/preloaders/labels_preloader.rb
app/models/preloaders/labels_preloader.rb
+3
-1
app/services/application_settings/base_service.rb
app/services/application_settings/base_service.rb
+3
-1
app/services/base_container_service.rb
app/services/base_container_service.rb
+3
-1
app/services/base_service.rb
app/services/base_service.rb
+3
-1
app/services/boards/base_service.rb
app/services/boards/base_service.rb
+3
-1
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+2
-1
app/services/clusters/create_service.rb
app/services/clusters/create_service.rb
+2
-1
app/services/clusters/destroy_service.rb
app/services/clusters/destroy_service.rb
+2
-1
app/services/clusters/update_service.rb
app/services/clusters/update_service.rb
+2
-1
app/services/draft_notes/base_service.rb
app/services/draft_notes/base_service.rb
+3
-1
app/services/git/wiki_push_service.rb
app/services/git/wiki_push_service.rb
+3
-1
app/services/git/wiki_push_service/change.rb
app/services/git/wiki_push_service/change.rb
+3
-1
app/services/groups/base_service.rb
app/services/groups/base_service.rb
+3
-1
app/services/groups/create_service.rb
app/services/groups/create_service.rb
+2
-1
app/services/groups/nested_create_service.rb
app/services/groups/nested_create_service.rb
+2
-1
app/services/issuable/bulk_update_service.rb
app/services/issuable/bulk_update_service.rb
+3
-1
app/services/issuable_links/create_service.rb
app/services/issuable_links/create_service.rb
+3
-1
app/services/issuable_links/list_service.rb
app/services/issuable_links/list_service.rb
+2
-1
app/services/jira_connect_subscriptions/base_service.rb
app/services/jira_connect_subscriptions/base_service.rb
+3
-1
app/services/keys/base_service.rb
app/services/keys/base_service.rb
+2
-1
app/services/keys/create_service.rb
app/services/keys/create_service.rb
+2
-1
app/services/mattermost/create_team_service.rb
app/services/mattermost/create_team_service.rb
+2
-1
app/services/metrics/dashboard/annotations/create_service.rb
app/services/metrics/dashboard/annotations/create_service.rb
+2
-1
app/services/metrics/dashboard/annotations/delete_service.rb
app/services/metrics/dashboard/annotations/delete_service.rb
+2
-1
app/services/metrics/dashboard/grafana_metric_embed_service.rb
...ervices/metrics/dashboard/grafana_metric_embed_service.rb
+4
-2
app/services/metrics/dashboard/panel_preview_service.rb
app/services/metrics/dashboard/panel_preview_service.rb
+3
-1
app/services/metrics/users_starred_dashboards/create_service.rb
...rvices/metrics/users_starred_dashboards/create_service.rb
+3
-1
app/services/metrics/users_starred_dashboards/delete_service.rb
...rvices/metrics/users_starred_dashboards/delete_service.rb
+3
-1
app/services/milestones/base_service.rb
app/services/milestones/base_service.rb
+3
-1
app/services/milestones/find_or_create_service.rb
app/services/milestones/find_or_create_service.rb
+3
-1
app/services/notification_recipients/builder/request_review.rb
...ervices/notification_recipients/builder/request_review.rb
+3
-1
app/services/packages/composer/composer_json_service.rb
app/services/packages/composer/composer_json_service.rb
+2
-1
app/services/packages/composer/version_parser_service.rb
app/services/packages/composer/version_parser_service.rb
+2
-1
app/services/packages/debian/create_distribution_service.rb
app/services/packages/debian/create_distribution_service.rb
+2
-1
app/services/packages/debian/update_distribution_service.rb
app/services/packages/debian/update_distribution_service.rb
+2
-1
app/services/packages/maven/find_or_create_package_service.rb
...services/packages/maven/find_or_create_package_service.rb
+2
-1
app/services/projects/branches_by_mode_service.rb
app/services/projects/branches_by_mode_service.rb
+2
-1
app/services/projects/create_from_template_service.rb
app/services/projects/create_from_template_service.rb
+2
-1
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+5
-4
app/services/projects/download_service.rb
app/services/projects/download_service.rb
+2
-1
app/services/projects/gitlab_projects_import_service.rb
app/services/projects/gitlab_projects_import_service.rb
+3
-1
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+2
-1
app/services/prometheus/proxy_variable_substitution_service.rb
...ervices/prometheus/proxy_variable_substitution_service.rb
+2
-1
app/services/releases/base_service.rb
app/services/releases/base_service.rb
+3
-1
app/services/resource_events/change_labels_service.rb
app/services/resource_events/change_labels_service.rb
+2
-1
app/services/resource_events/change_state_service.rb
app/services/resource_events/change_state_service.rb
+2
-1
app/services/search/global_service.rb
app/services/search/global_service.rb
+2
-1
app/services/search/project_service.rb
app/services/search/project_service.rb
+3
-1
app/services/task_list_toggle_service.rb
app/services/task_list_toggle_service.rb
+5
-3
app/services/two_factor/base_service.rb
app/services/two_factor/base_service.rb
+2
-1
app/services/upload_service.rb
app/services/upload_service.rb
+4
-1
app/services/user_agent_detail_service.rb
app/services/user_agent_detail_service.rb
+2
-1
app/services/users/respond_to_terms_service.rb
app/services/users/respond_to_terms_service.rb
+2
-1
app/services/users/set_status_service.rb
app/services/users/set_status_service.rb
+2
-1
app/views/shared/_issuable_meta_data.html.haml
app/views/shared/_issuable_meta_data.html.haml
+2
-1
app/workers/object_storage/migrate_uploads_worker.rb
app/workers/object_storage/migrate_uploads_worker.rb
+2
-1
changelogs/unreleased/pl-rubocop-todo-parallel-assignment.yml
...gelogs/unreleased/pl-rubocop-todo-parallel-assignment.yml
+5
-0
ee/app/services/admin/email_service.rb
ee/app/services/admin/email_service.rb
+3
-1
ee/app/services/epics/base_service.rb
ee/app/services/epics/base_service.rb
+3
-1
ee/app/services/iterations/cadences/create_service.rb
ee/app/services/iterations/cadences/create_service.rb
+3
-1
ee/app/services/iterations/cadences/update_service.rb
ee/app/services/iterations/cadences/update_service.rb
+3
-1
ee/app/services/iterations/create_service.rb
ee/app/services/iterations/create_service.rb
+3
-1
ee/app/services/iterations/update_service.rb
ee/app/services/iterations/update_service.rb
+3
-1
ee/app/services/licenses/base_service.rb
ee/app/services/licenses/base_service.rb
+2
-1
ee/app/services/security/merge_reports_service.rb
ee/app/services/security/merge_reports_service.rb
+4
-2
ee/app/services/vulnerability_feedback/destroy_service.rb
ee/app/services/vulnerability_feedback/destroy_service.rb
+4
-1
ee/app/workers/repository_push_audit_event_worker.rb
ee/app/workers/repository_push_audit_event_worker.rb
+3
-1
ee/lib/elastic/latest/document_should_be_deleted_from_index_error.rb
...tic/latest/document_should_be_deleted_from_index_error.rb
+2
-1
ee/lib/gitlab/code_owners/loader.rb
ee/lib/gitlab/code_owners/loader.rb
+3
-1
ee/spec/features/projects/licenses/maintainer_views_policies_spec.rb
...tures/projects/licenses/maintainer_views_policies_spec.rb
+2
-1
lib/banzai/filter/references/label_reference_filter.rb
lib/banzai/filter/references/label_reference_filter.rb
+2
-1
lib/container_registry/config.rb
lib/container_registry/config.rb
+2
-1
lib/container_registry/tag.rb
lib/container_registry/tag.rb
+2
-1
lib/declarative_policy/preferred_scope.rb
lib/declarative_policy/preferred_scope.rb
+2
-1
lib/file_size_validator.rb
lib/file_size_validator.rb
+2
-1
lib/gitlab/batch_pop_queueing.rb
lib/gitlab/batch_pop_queueing.rb
+2
-1
lib/gitlab/cache/ci/project_pipeline_status.rb
lib/gitlab/cache/ci/project_pipeline_status.rb
+3
-1
lib/gitlab/ci/build/artifacts/metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+3
-1
lib/gitlab/contributor.rb
lib/gitlab/contributor.rb
+3
-1
lib/gitlab/diff/line.rb
lib/gitlab/diff/line.rb
+5
-2
lib/gitlab/diff/suggestions_parser.rb
lib/gitlab/diff/suggestions_parser.rb
+2
-3
lib/gitlab/external_authorization/access.rb
lib/gitlab/external_authorization/access.rb
+2
-1
lib/gitlab/external_authorization/cache.rb
lib/gitlab/external_authorization/cache.rb
+2
-1
lib/gitlab/external_authorization/client.rb
lib/gitlab/external_authorization/client.rb
+2
-1
lib/gitlab/git/blame.rb
lib/gitlab/git/blame.rb
+4
-2
lib/gitlab/git/merge_base.rb
lib/gitlab/git/merge_base.rb
+2
-1
lib/gitlab/git/patches/commit_patches.rb
lib/gitlab/git/patches/commit_patches.rb
+4
-1
lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb
lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb
+2
-1
lib/gitlab/graphql/loaders/batch_model_loader.rb
lib/gitlab/graphql/loaders/batch_model_loader.rb
+2
-1
lib/gitlab/graphql/loaders/full_path_model_loader.rb
lib/gitlab/graphql/loaders/full_path_model_loader.rb
+2
-1
lib/gitlab/graphql/pagination/keyset/conditions/base_condition.rb
...ab/graphql/pagination/keyset/conditions/base_condition.rb
+5
-1
lib/gitlab/graphql/pagination/keyset/query_builder.rb
lib/gitlab/graphql/pagination/keyset/query_builder.rb
+4
-1
lib/gitlab/phabricator_import/issues/importer.rb
lib/gitlab/phabricator_import/issues/importer.rb
+2
-1
lib/gitlab/phabricator_import/issues/task_importer.rb
lib/gitlab/phabricator_import/issues/task_importer.rb
+2
-1
lib/gitlab/phabricator_import/user_finder.rb
lib/gitlab/phabricator_import/user_finder.rb
+2
-1
lib/gitlab/project_template.rb
lib/gitlab/project_template.rb
+5
-1
lib/gitlab/relative_positioning/closed_range.rb
lib/gitlab/relative_positioning/closed_range.rb
+2
-1
lib/gitlab/relative_positioning/gap.rb
lib/gitlab/relative_positioning/gap.rb
+2
-1
lib/gitlab/slash_commands/base_command.rb
lib/gitlab/slash_commands/base_command.rb
+3
-1
lib/tasks/gitlab/db.rake
lib/tasks/gitlab/db.rake
+2
-1
spec/finders/concerns/finder_with_group_hierarchy_spec.rb
spec/finders/concerns/finder_with_group_hierarchy_spec.rb
+2
-1
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
...se/rename_reserved_paths_migration/v1/rename_base_spec.rb
+2
-1
spec/lib/gitlab/diff/lines_unfolder_spec.rb
spec/lib/gitlab/diff/lines_unfolder_spec.rb
+12
-6
spec/lib/gitlab/diff/suggestions_parser_spec.rb
spec/lib/gitlab/diff/suggestions_parser_spec.rb
+2
-1
spec/lib/gitlab/markdown_cache/redis/extension_spec.rb
spec/lib/gitlab/markdown_cache/redis/extension_spec.rb
+2
-1
spec/lib/gitlab/utils/lazy_attributes_spec.rb
spec/lib/gitlab/utils/lazy_attributes_spec.rb
+4
-2
spec/models/concerns/cache_markdown_field_spec.rb
spec/models/concerns/cache_markdown_field_spec.rb
+7
-3
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+2
-1
spec/support/helpers/graphql_helpers.rb
spec/support/helpers/graphql_helpers.rb
+4
-1
spec/support/helpers/key_generator_helper.rb
spec/support/helpers/key_generator_helper.rb
+2
-1
spec/validators/x509_certificate_credentials_validator_spec.rb
...validators/x509_certificate_credentials_validator_spec.rb
+3
-1
No files found.
.rubocop_todo.yml
View file @
b62ce98c
...
@@ -845,11 +845,6 @@ Style/Next:
...
@@ -845,11 +845,6 @@ Style/Next:
Style/NumericLiteralPrefix
:
Style/NumericLiteralPrefix
:
Enabled
:
false
Enabled
:
false
# Offense count: 140
# Cop supports --auto-correct.
Style/ParallelAssignment
:
Enabled
:
false
# Offense count: 2698
# Offense count: 2698
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
# Configuration parameters: PreferredDelimiters.
...
...
app/controllers/clusters/clusters_controller.rb
View file @
b62ce98c
...
@@ -308,7 +308,8 @@ class Clusters::ClustersController < Clusters::BaseController
...
@@ -308,7 +308,8 @@ class Clusters::ClustersController < Clusters::BaseController
def
proxy_variable_substitution_service
def
proxy_variable_substitution_service
@empty_service
||=
Class
.
new
(
BaseService
)
do
@empty_service
||=
Class
.
new
(
BaseService
)
do
def
initialize
(
proxyable
,
params
)
def
initialize
(
proxyable
,
params
)
@proxyable
,
@params
=
proxyable
,
params
@proxyable
=
proxyable
@params
=
params
end
end
def
execute
def
execute
...
...
app/controllers/projects/commits_controller.rb
View file @
b62ce98c
...
@@ -63,7 +63,8 @@ class Projects::CommitsController < Projects::ApplicationController
...
@@ -63,7 +63,8 @@ class Projects::CommitsController < Projects::ApplicationController
def
set_commits
def
set_commits
render_404
unless
@path
.
empty?
||
request
.
format
==
:atom
||
@repository
.
blob_at
(
@commit
.
id
,
@path
)
||
@repository
.
tree
(
@commit
.
id
,
@path
).
entries
.
present?
render_404
unless
@path
.
empty?
||
request
.
format
==
:atom
||
@repository
.
blob_at
(
@commit
.
id
,
@path
)
||
@repository
.
tree
(
@commit
.
id
,
@path
).
entries
.
present?
@limit
,
@offset
=
(
params
[
:limit
]
||
40
).
to_i
,
(
params
[
:offset
]
||
0
).
to_i
@limit
=
(
params
[
:limit
]
||
40
).
to_i
@offset
=
(
params
[
:offset
]
||
0
).
to_i
search
=
params
[
:search
]
search
=
params
[
:search
]
author
=
params
[
:author
]
author
=
params
[
:author
]
...
...
app/finders/ci/variables_finder.rb
View file @
b62ce98c
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
module
Ci
module
Ci
class
VariablesFinder
class
VariablesFinder
def
initialize
(
resource
,
params
)
def
initialize
(
resource
,
params
)
@resource
,
@params
=
resource
,
params
@resource
=
resource
@params
=
params
raise
ArgumentError
,
'Please provide params[:key]'
if
params
[
:key
].
blank?
raise
ArgumentError
,
'Please provide params[:key]'
if
params
[
:key
].
blank?
end
end
...
...
app/finders/environments_by_deployments_finder.rb
View file @
b62ce98c
...
@@ -4,7 +4,9 @@ class EnvironmentsByDeploymentsFinder
...
@@ -4,7 +4,9 @@ class EnvironmentsByDeploymentsFinder
attr_reader
:project
,
:current_user
,
:params
attr_reader
:project
,
:current_user
,
:params
def
initialize
(
project
,
current_user
,
params
=
{})
def
initialize
(
project
,
current_user
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
current_user
,
params
@project
=
project
@current_user
=
current_user
@params
=
params
end
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
...
...
app/finders/environments_finder.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ class EnvironmentsFinder
...
@@ -6,7 +6,9 @@ class EnvironmentsFinder
InvalidStatesError
=
Class
.
new
(
StandardError
)
InvalidStatesError
=
Class
.
new
(
StandardError
)
def
initialize
(
project
,
current_user
,
params
=
{})
def
initialize
(
project
,
current_user
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
current_user
,
params
@project
=
project
@current_user
=
current_user
@params
=
params
end
end
def
execute
def
execute
...
...
app/finders/metrics/dashboards/annotations_finder.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Metrics
...
@@ -4,7 +4,8 @@ module Metrics
module
Dashboards
module
Dashboards
class
AnnotationsFinder
class
AnnotationsFinder
def
initialize
(
dashboard
:,
params
:)
def
initialize
(
dashboard
:,
params
:)
@dashboard
,
@params
=
dashboard
,
params
@dashboard
=
dashboard
@params
=
params
end
end
def
execute
def
execute
...
...
app/finders/metrics/users_starred_dashboards_finder.rb
View file @
b62ce98c
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
module
Metrics
module
Metrics
class
UsersStarredDashboardsFinder
class
UsersStarredDashboardsFinder
def
initialize
(
user
:,
project
:,
params:
{})
def
initialize
(
user
:,
project
:,
params:
{})
@user
,
@project
,
@params
=
user
,
project
,
params
@user
=
user
@project
=
project
@params
=
params
end
end
def
execute
def
execute
...
...
app/finders/packages/debian/distributions_finder.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Packages
...
@@ -4,7 +4,8 @@ module Packages
module
Debian
module
Debian
class
DistributionsFinder
class
DistributionsFinder
def
initialize
(
container
,
params
=
{})
def
initialize
(
container
,
params
=
{})
@container
,
@params
=
container
,
params
@container
=
container
@params
=
params
end
end
def
execute
def
execute
...
...
app/helpers/submodule_helper.rb
View file @
b62ce98c
...
@@ -18,7 +18,8 @@ module SubmoduleHelper
...
@@ -18,7 +18,8 @@ module SubmoduleHelper
end
end
if
url
=~
%r{([^/:]+)/([^/]+(?:
\.
git)?)
\Z
}
if
url
=~
%r{([^/:]+)/([^/]+(?:
\.
git)?)
\Z
}
namespace
,
project
=
Regexp
.
last_match
(
1
),
Regexp
.
last_match
(
2
)
namespace
=
Regexp
.
last_match
(
1
)
project
=
Regexp
.
last_match
(
2
)
gitlab_hosts
=
[
Gitlab
.
config
.
gitlab
.
url
,
gitlab_hosts
=
[
Gitlab
.
config
.
gitlab
.
url
,
Gitlab
.
config
.
gitlab_shell
.
ssh_path_prefix
]
Gitlab
.
config
.
gitlab_shell
.
ssh_path_prefix
]
...
...
app/models/ability.rb
View file @
b62ce98c
...
@@ -58,7 +58,8 @@ class Ability
...
@@ -58,7 +58,8 @@ class Ability
def
allowed?
(
user
,
action
,
subject
=
:global
,
opts
=
{})
def
allowed?
(
user
,
action
,
subject
=
:global
,
opts
=
{})
if
subject
.
is_a?
(
Hash
)
if
subject
.
is_a?
(
Hash
)
opts
,
subject
=
subject
,
:global
opts
=
subject
subject
=
:global
end
end
policy
=
policy_for
(
user
,
subject
)
policy
=
policy_for
(
user
,
subject
)
...
...
app/models/application_setting_implementation.rb
View file @
b62ce98c
...
@@ -438,11 +438,14 @@ module ApplicationSettingImplementation
...
@@ -438,11 +438,14 @@ module ApplicationSettingImplementation
def
parse_addr_and_port
(
str
)
def
parse_addr_and_port
(
str
)
case
str
case
str
when
/\A\[(?<address> .* )\]:(?<port> \d+ )\z/x
# string like "[::1]:80"
when
/\A\[(?<address> .* )\]:(?<port> \d+ )\z/x
# string like "[::1]:80"
address
,
port
=
$~
[
:address
],
$~
[
:port
]
address
=
$~
[
:address
]
port
=
$~
[
:port
]
when
/\A(?<address> [^:]+ ):(?<port> \d+ )\z/x
# string like "127.0.0.1:80"
when
/\A(?<address> [^:]+ ):(?<port> \d+ )\z/x
# string like "127.0.0.1:80"
address
,
port
=
$~
[
:address
],
$~
[
:port
]
address
=
$~
[
:address
]
port
=
$~
[
:port
]
else
# string with no port number
else
# string with no port number
address
,
port
=
str
,
nil
address
=
str
port
=
nil
end
end
[
address
,
port
&
.
to_i
]
[
address
,
port
&
.
to_i
]
...
...
app/models/commit.rb
View file @
b62ce98c
...
@@ -62,7 +62,8 @@ class Commit
...
@@ -62,7 +62,8 @@ class Commit
collection
.
sort
do
|
a
,
b
|
collection
.
sort
do
|
a
,
b
|
operands
=
[
a
,
b
].
tap
{
|
o
|
o
.
reverse!
if
sort
==
'desc'
}
operands
=
[
a
,
b
].
tap
{
|
o
|
o
.
reverse!
if
sort
==
'desc'
}
attr1
,
attr2
=
operands
.
first
.
public_send
(
order_by
),
operands
.
second
.
public_send
(
order_by
)
# rubocop:disable GitlabSecurity/PublicSend
attr1
=
operands
.
first
.
public_send
(
order_by
)
# rubocop:disable GitlabSecurity/PublicSend
attr2
=
operands
.
second
.
public_send
(
order_by
)
# rubocop:disable GitlabSecurity/PublicSend
# use case insensitive comparison for string values
# use case insensitive comparison for string values
order_by
.
in?
(
%w[email name]
)
?
attr1
.
casecmp
(
attr2
)
:
attr1
<=>
attr2
order_by
.
in?
(
%w[email name]
)
?
attr1
.
casecmp
(
attr2
)
:
attr1
<=>
attr2
...
...
app/models/concerns/taskable.rb
View file @
b62ce98c
...
@@ -30,7 +30,8 @@ module Taskable
...
@@ -30,7 +30,8 @@ module Taskable
end
end
def
self
.
get_updated_tasks
(
old_content
:,
new_content
:)
def
self
.
get_updated_tasks
(
old_content
:,
new_content
:)
old_tasks
,
new_tasks
=
get_tasks
(
old_content
),
get_tasks
(
new_content
)
old_tasks
=
get_tasks
(
old_content
)
new_tasks
=
get_tasks
(
new_content
)
new_tasks
.
select
.
with_index
do
|
new_task
,
i
|
new_tasks
.
select
.
with_index
do
|
new_task
,
i
|
old_task
=
old_tasks
[
i
]
old_task
=
old_tasks
[
i
]
...
...
app/models/design_management/design_action.rb
View file @
b62ce98c
...
@@ -29,7 +29,9 @@ module DesignManagement
...
@@ -29,7 +29,9 @@ module DesignManagement
# - design [DesignManagement::Design]: the design that was changed
# - design [DesignManagement::Design]: the design that was changed
# - action [Symbol]: the action that gitaly performed
# - action [Symbol]: the action that gitaly performed
def
initialize
(
design
,
action
,
content
=
nil
)
def
initialize
(
design
,
action
,
content
=
nil
)
@design
,
@action
,
@content
=
design
,
action
,
content
@design
=
design
@action
=
action
@content
=
content
validate!
validate!
end
end
...
...
app/models/design_management/design_at_version.rb
View file @
b62ce98c
...
@@ -18,7 +18,8 @@ module DesignManagement
...
@@ -18,7 +18,8 @@ module DesignManagement
validate
:design_and_version_have_issue_id
validate
:design_and_version_have_issue_id
def
initialize
(
design:
nil
,
version:
nil
)
def
initialize
(
design:
nil
,
version:
nil
)
@design
,
@version
=
design
,
version
@design
=
design
@version
=
version
end
end
# The ID, needed by GraphQL types and as part of the Lazy-fetch
# The ID, needed by GraphQL types and as part of the Lazy-fetch
...
...
app/models/design_management/version.rb
View file @
b62ce98c
...
@@ -14,7 +14,9 @@ module DesignManagement
...
@@ -14,7 +14,9 @@ module DesignManagement
attr_reader
:sha
,
:issue_id
,
:actions
attr_reader
:sha
,
:issue_id
,
:actions
def
initialize
(
sha
,
issue_id
,
actions
)
def
initialize
(
sha
,
issue_id
,
actions
)
@sha
,
@issue_id
,
@actions
=
sha
,
issue_id
,
actions
@sha
=
sha
@issue_id
=
issue_id
@actions
=
actions
end
end
def
message
def
message
...
...
app/models/external_issue.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ class ExternalIssue
...
@@ -6,7 +6,8 @@ class ExternalIssue
attr_reader
:project
attr_reader
:project
def
initialize
(
issue_identifier
,
project
)
def
initialize
(
issue_identifier
,
project
)
@issue_identifier
,
@project
=
issue_identifier
,
project
@issue_identifier
=
issue_identifier
@project
=
project
end
end
def
to_s
def
to_s
...
...
app/models/member.rb
View file @
b62ce98c
...
@@ -291,7 +291,9 @@ class Member < ApplicationRecord
...
@@ -291,7 +291,9 @@ class Member < ApplicationRecord
private
private
def
parse_users_list
(
source
,
list
)
def
parse_users_list
(
source
,
list
)
emails
,
user_ids
,
users
=
[],
[],
[]
emails
=
[]
user_ids
=
[]
users
=
[]
existing_members
=
{}
existing_members
=
{}
list
.
each
do
|
item
|
list
.
each
do
|
item
|
...
...
app/models/preloaders/labels_preloader.rb
View file @
b62ce98c
...
@@ -13,7 +13,9 @@ module Preloaders
...
@@ -13,7 +13,9 @@ module Preloaders
attr_reader
:labels
,
:user
,
:project
attr_reader
:labels
,
:user
,
:project
def
initialize
(
labels
,
user
,
project
=
nil
)
def
initialize
(
labels
,
user
,
project
=
nil
)
@labels
,
@user
,
@project
=
labels
,
user
,
project
@labels
=
labels
@user
=
user
@project
=
project
end
end
def
preload_all
def
preload_all
...
...
app/services/application_settings/base_service.rb
View file @
b62ce98c
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
module
ApplicationSettings
module
ApplicationSettings
class
BaseService
<
::
BaseService
class
BaseService
<
::
BaseService
def
initialize
(
application_setting
,
user
,
params
=
{})
def
initialize
(
application_setting
,
user
,
params
=
{})
@application_setting
,
@current_user
,
@params
=
application_setting
,
user
,
params
.
dup
@application_setting
=
application_setting
@current_user
=
user
@params
=
params
.
dup
end
end
end
end
end
end
app/services/base_container_service.rb
View file @
b62ce98c
...
@@ -7,6 +7,8 @@ class BaseContainerService
...
@@ -7,6 +7,8 @@ class BaseContainerService
attr_reader
:container
,
:current_user
,
:params
attr_reader
:container
,
:current_user
,
:params
def
initialize
(
container
:,
current_user:
nil
,
params:
{})
def
initialize
(
container
:,
current_user:
nil
,
params:
{})
@container
,
@current_user
,
@params
=
container
,
current_user
,
params
.
dup
@container
=
container
@current_user
=
current_user
@params
=
params
.
dup
end
end
end
end
app/services/base_service.rb
View file @
b62ce98c
...
@@ -15,7 +15,9 @@ class BaseService
...
@@ -15,7 +15,9 @@ class BaseService
attr_accessor
:project
,
:current_user
,
:params
attr_accessor
:project
,
:current_user
,
:params
def
initialize
(
project
,
user
=
nil
,
params
=
{})
def
initialize
(
project
,
user
=
nil
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
user
,
params
.
dup
@project
=
project
@current_user
=
user
@params
=
params
.
dup
end
end
delegate
:repository
,
to: :project
delegate
:repository
,
to: :project
...
...
app/services/boards/base_service.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ module Boards
...
@@ -6,7 +6,9 @@ module Boards
attr_accessor
:parent
,
:current_user
,
:params
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
,
params
=
{})
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
@parent
=
parent
@current_user
=
user
@params
=
params
.
dup
end
end
end
end
end
end
...
...
app/services/ci/create_pipeline_service.rb
View file @
b62ce98c
...
@@ -96,7 +96,8 @@ module Ci
...
@@ -96,7 +96,8 @@ module Ci
# rubocop: enable Metrics/ParameterLists
# rubocop: enable Metrics/ParameterLists
def
execute!
(
*
args
,
&
block
)
def
execute!
(
*
args
,
&
block
)
source
,
params
=
args
[
0
],
Hash
(
args
[
1
])
source
=
args
[
0
]
params
=
Hash
(
args
[
1
])
execute
(
source
,
**
params
,
&
block
).
tap
do
|
pipeline
|
execute
(
source
,
**
params
,
&
block
).
tap
do
|
pipeline
|
unless
pipeline
.
persisted?
unless
pipeline
.
persisted?
...
...
app/services/clusters/create_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Clusters
...
@@ -5,7 +5,8 @@ module Clusters
attr_reader
:current_user
,
:params
attr_reader
:current_user
,
:params
def
initialize
(
user
=
nil
,
params
=
{})
def
initialize
(
user
=
nil
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
(
access_token:
nil
)
def
execute
(
access_token:
nil
)
...
...
app/services/clusters/destroy_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Clusters
...
@@ -5,7 +5,8 @@ module Clusters
attr_reader
:current_user
,
:params
attr_reader
:current_user
,
:params
def
initialize
(
user
=
nil
,
params
=
{})
def
initialize
(
user
=
nil
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
@response
=
{}
@response
=
{}
end
end
...
...
app/services/clusters/update_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Clusters
...
@@ -5,7 +5,8 @@ module Clusters
attr_reader
:current_user
,
:params
attr_reader
:current_user
,
:params
def
initialize
(
user
=
nil
,
params
=
{})
def
initialize
(
user
=
nil
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
(
cluster
)
def
execute
(
cluster
)
...
...
app/services/draft_notes/base_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module DraftNotes
...
@@ -5,7 +5,9 @@ module DraftNotes
attr_accessor
:merge_request
,
:current_user
,
:params
attr_accessor
:merge_request
,
:current_user
,
:params
def
initialize
(
merge_request
,
current_user
,
params
=
nil
)
def
initialize
(
merge_request
,
current_user
,
params
=
nil
)
@merge_request
,
@current_user
,
@params
=
merge_request
,
current_user
,
params
.
dup
@merge_request
=
merge_request
@current_user
=
current_user
@params
=
params
.
dup
end
end
def
merge_request_activity_counter
def
merge_request_activity_counter
...
...
app/services/git/wiki_push_service.rb
View file @
b62ce98c
...
@@ -8,7 +8,9 @@ module Git
...
@@ -8,7 +8,9 @@ module Git
attr_reader
:wiki
attr_reader
:wiki
def
initialize
(
wiki
,
current_user
,
params
)
def
initialize
(
wiki
,
current_user
,
params
)
@wiki
,
@current_user
,
@params
=
wiki
,
current_user
,
params
.
dup
@wiki
=
wiki
@current_user
=
current_user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
app/services/git/wiki_push_service/change.rb
View file @
b62ce98c
...
@@ -9,7 +9,9 @@ module Git
...
@@ -9,7 +9,9 @@ module Git
# @param [Hash] change - must have keys `:oldrev` and `:newrev`
# @param [Hash] change - must have keys `:oldrev` and `:newrev`
# @param [Gitlab::Git::RawDiffChange] raw_change
# @param [Gitlab::Git::RawDiffChange] raw_change
def
initialize
(
wiki
,
change
,
raw_change
)
def
initialize
(
wiki
,
change
,
raw_change
)
@wiki
,
@raw_change
,
@change
=
wiki
,
raw_change
,
change
@wiki
=
wiki
@raw_change
=
raw_change
@change
=
change
end
end
def
page
def
page
...
...
app/services/groups/base_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module Groups
...
@@ -5,7 +5,9 @@ module Groups
attr_accessor
:group
,
:current_user
,
:params
attr_accessor
:group
,
:current_user
,
:params
def
initialize
(
group
,
user
,
params
=
{})
def
initialize
(
group
,
user
,
params
=
{})
@group
,
@current_user
,
@params
=
group
,
user
,
params
.
dup
@group
=
group
@current_user
=
user
@params
=
params
.
dup
end
end
private
private
...
...
app/services/groups/create_service.rb
View file @
b62ce98c
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
module
Groups
module
Groups
class
CreateService
<
Groups
::
BaseService
class
CreateService
<
Groups
::
BaseService
def
initialize
(
user
,
params
=
{})
def
initialize
(
user
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
@chat_team
=
@params
.
delete
(
:create_chat_team
)
@chat_team
=
@params
.
delete
(
:create_chat_team
)
end
end
...
...
app/services/groups/nested_create_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Groups
...
@@ -5,7 +5,8 @@ module Groups
attr_reader
:group_path
,
:visibility_level
attr_reader
:group_path
,
:visibility_level
def
initialize
(
user
,
params
)
def
initialize
(
user
,
params
)
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
@group_path
=
@params
.
delete
(
:group_path
)
@group_path
=
@params
.
delete
(
:group_path
)
@visibility_level
=
@params
.
delete
(
:visibility_level
)
||
@visibility_level
=
@params
.
delete
(
:visibility_level
)
||
Gitlab
::
CurrentSettings
.
current_application_settings
.
default_group_visibility
Gitlab
::
CurrentSettings
.
current_application_settings
.
default_group_visibility
...
...
app/services/issuable/bulk_update_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,9 @@ module Issuable
...
@@ -7,7 +7,9 @@ module Issuable
attr_accessor
:parent
,
:current_user
,
:params
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
=
nil
,
params
=
{})
def
initialize
(
parent
,
user
=
nil
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
@parent
=
parent
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
(
type
)
def
execute
(
type
)
...
...
app/services/issuable_links/create_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,9 @@ module IssuableLinks
...
@@ -7,7 +7,9 @@ module IssuableLinks
attr_reader
:issuable
,
:current_user
,
:params
attr_reader
:issuable
,
:current_user
,
:params
def
initialize
(
issuable
,
user
,
params
)
def
initialize
(
issuable
,
user
,
params
)
@issuable
,
@current_user
,
@params
=
issuable
,
user
,
params
.
dup
@issuable
=
issuable
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
app/services/issuable_links/list_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module IssuableLinks
...
@@ -7,7 +7,8 @@ module IssuableLinks
attr_reader
:issuable
,
:current_user
attr_reader
:issuable
,
:current_user
def
initialize
(
issuable
,
user
)
def
initialize
(
issuable
,
user
)
@issuable
,
@current_user
=
issuable
,
user
@issuable
=
issuable
@current_user
=
user
end
end
def
execute
def
execute
...
...
app/services/jira_connect_subscriptions/base_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module JiraConnectSubscriptions
...
@@ -5,7 +5,9 @@ module JiraConnectSubscriptions
attr_accessor
:jira_connect_installation
,
:current_user
,
:params
attr_accessor
:jira_connect_installation
,
:current_user
,
:params
def
initialize
(
jira_connect_installation
,
user
=
nil
,
params
=
{})
def
initialize
(
jira_connect_installation
,
user
=
nil
,
params
=
{})
@jira_connect_installation
,
@current_user
,
@params
=
jira_connect_installation
,
user
,
params
.
dup
@jira_connect_installation
=
jira_connect_installation
@current_user
=
user
@params
=
params
.
dup
end
end
end
end
end
end
app/services/keys/base_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Keys
...
@@ -5,7 +5,8 @@ module Keys
attr_accessor
:user
,
:params
attr_accessor
:user
,
:params
def
initialize
(
user
,
params
=
{})
def
initialize
(
user
,
params
=
{})
@user
,
@params
=
user
,
params
@user
=
user
@params
=
params
@ip_address
=
@params
.
delete
(
:ip_address
)
@ip_address
=
@params
.
delete
(
:ip_address
)
end
end
...
...
app/services/keys/create_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Keys
...
@@ -5,7 +5,8 @@ module Keys
attr_accessor
:current_user
attr_accessor
:current_user
def
initialize
(
current_user
,
params
=
{})
def
initialize
(
current_user
,
params
=
{})
@current_user
,
@params
=
current_user
,
params
@current_user
=
current_user
@params
=
params
@ip_address
=
@params
.
delete
(
:ip_address
)
@ip_address
=
@params
.
delete
(
:ip_address
)
@user
=
params
.
delete
(
:user
)
||
current_user
@user
=
params
.
delete
(
:user
)
||
current_user
end
end
...
...
app/services/mattermost/create_team_service.rb
View file @
b62ce98c
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
module
Mattermost
module
Mattermost
class
CreateTeamService
<
::
BaseService
class
CreateTeamService
<
::
BaseService
def
initialize
(
group
,
current_user
)
def
initialize
(
group
,
current_user
)
@group
,
@current_user
=
group
,
current_user
@group
=
group
@current_user
=
current_user
end
end
def
execute
def
execute
...
...
app/services/metrics/dashboard/annotations/create_service.rb
View file @
b62ce98c
...
@@ -13,7 +13,8 @@ module Metrics
...
@@ -13,7 +13,8 @@ module Metrics
:create
:create
def
initialize
(
user
,
params
)
def
initialize
(
user
,
params
)
@user
,
@params
=
user
,
params
@user
=
user
@params
=
params
end
end
def
execute
def
execute
...
...
app/services/metrics/dashboard/annotations/delete_service.rb
View file @
b62ce98c
...
@@ -11,7 +11,8 @@ module Metrics
...
@@ -11,7 +11,8 @@ module Metrics
:delete
:delete
def
initialize
(
user
,
annotation
)
def
initialize
(
user
,
annotation
)
@user
,
@annotation
=
user
,
annotation
@user
=
user
@annotation
=
annotation
end
end
def
execute
def
execute
...
...
app/services/metrics/dashboard/grafana_metric_embed_service.rb
View file @
b62ce98c
...
@@ -122,7 +122,8 @@ module Metrics
...
@@ -122,7 +122,8 @@ module Metrics
# Identifies the uid of the dashboard based on url format
# Identifies the uid of the dashboard based on url format
class
GrafanaUidParser
class
GrafanaUidParser
def
initialize
(
grafana_url
,
project
)
def
initialize
(
grafana_url
,
project
)
@grafana_url
,
@project
=
grafana_url
,
project
@grafana_url
=
grafana_url
@project
=
project
end
end
def
parse
def
parse
...
@@ -145,7 +146,8 @@ module Metrics
...
@@ -145,7 +146,8 @@ module Metrics
# If no panel is specified, defaults to the first valid panel.
# If no panel is specified, defaults to the first valid panel.
class
DatasourceNameParser
class
DatasourceNameParser
def
initialize
(
grafana_url
,
grafana_dashboard
)
def
initialize
(
grafana_url
,
grafana_dashboard
)
@grafana_url
,
@grafana_dashboard
=
grafana_url
,
grafana_dashboard
@grafana_url
=
grafana_url
@grafana_dashboard
=
grafana_dashboard
end
end
def
parse
def
parse
...
...
app/services/metrics/dashboard/panel_preview_service.rb
View file @
b62ce98c
...
@@ -22,7 +22,9 @@ module Metrics
...
@@ -22,7 +22,9 @@ module Metrics
].
freeze
].
freeze
def
initialize
(
project
,
panel_yaml
,
environment
)
def
initialize
(
project
,
panel_yaml
,
environment
)
@project
,
@panel_yaml
,
@environment
=
project
,
panel_yaml
,
environment
@project
=
project
@panel_yaml
=
panel_yaml
@environment
=
environment
end
end
def
execute
def
execute
...
...
app/services/metrics/users_starred_dashboards/create_service.rb
View file @
b62ce98c
...
@@ -11,7 +11,9 @@ module Metrics
...
@@ -11,7 +11,9 @@ module Metrics
:create
:create
def
initialize
(
user
,
project
,
dashboard_path
)
def
initialize
(
user
,
project
,
dashboard_path
)
@user
,
@project
,
@dashboard_path
=
user
,
project
,
dashboard_path
@user
=
user
@project
=
project
@dashboard_path
=
dashboard_path
end
end
def
execute
def
execute
...
...
app/services/metrics/users_starred_dashboards/delete_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module Metrics
...
@@ -5,7 +5,9 @@ module Metrics
module
UsersStarredDashboards
module
UsersStarredDashboards
class
DeleteService
<
::
BaseService
class
DeleteService
<
::
BaseService
def
initialize
(
user
,
project
,
dashboard_path
=
nil
)
def
initialize
(
user
,
project
,
dashboard_path
=
nil
)
@user
,
@project
,
@dashboard_path
=
user
,
project
,
dashboard_path
@user
=
user
@project
=
project
@dashboard_path
=
dashboard_path
end
end
def
execute
def
execute
...
...
app/services/milestones/base_service.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ module Milestones
...
@@ -6,7 +6,9 @@ module Milestones
attr_accessor
:parent
,
:current_user
,
:params
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
,
params
=
{})
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
@parent
=
parent
@current_user
=
user
@params
=
params
.
dup
super
super
end
end
end
end
...
...
app/services/milestones/find_or_create_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module Milestones
...
@@ -5,7 +5,9 @@ module Milestones
attr_accessor
:project
,
:current_user
,
:params
attr_accessor
:project
,
:current_user
,
:params
def
initialize
(
project
,
user
,
params
=
{})
def
initialize
(
project
,
user
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
user
,
params
.
dup
@project
=
project
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
app/services/notification_recipients/builder/request_review.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ module NotificationRecipients
...
@@ -6,7 +6,9 @@ module NotificationRecipients
attr_reader
:merge_request
,
:current_user
,
:reviewer
attr_reader
:merge_request
,
:current_user
,
:reviewer
def
initialize
(
merge_request
,
current_user
,
reviewer
)
def
initialize
(
merge_request
,
current_user
,
reviewer
)
@merge_request
,
@current_user
,
@reviewer
=
merge_request
,
current_user
,
reviewer
@merge_request
=
merge_request
@current_user
=
current_user
@reviewer
=
reviewer
end
end
def
target
def
target
...
...
app/services/packages/composer/composer_json_service.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ module Packages
...
@@ -6,7 +6,8 @@ module Packages
InvalidJson
=
Class
.
new
(
StandardError
)
InvalidJson
=
Class
.
new
(
StandardError
)
def
initialize
(
project
,
target
)
def
initialize
(
project
,
target
)
@project
,
@target
=
project
,
target
@project
=
project
@target
=
target
end
end
def
execute
def
execute
...
...
app/services/packages/composer/version_parser_service.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Packages
...
@@ -4,7 +4,8 @@ module Packages
module
Composer
module
Composer
class
VersionParserService
class
VersionParserService
def
initialize
(
tag_name:
nil
,
branch_name:
nil
)
def
initialize
(
tag_name:
nil
,
branch_name:
nil
)
@tag_name
,
@branch_name
=
tag_name
,
branch_name
@tag_name
=
tag_name
@branch_name
=
branch_name
end
end
def
execute
def
execute
...
...
app/services/packages/debian/create_distribution_service.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Packages
...
@@ -4,7 +4,8 @@ module Packages
module
Debian
module
Debian
class
CreateDistributionService
class
CreateDistributionService
def
initialize
(
container
,
user
,
params
)
def
initialize
(
container
,
user
,
params
)
@container
,
@params
=
container
,
params
@container
=
container
@params
=
params
@params
[
:creator
]
=
user
@params
[
:creator
]
=
user
@components
=
params
.
delete
(
:components
)
||
[
'main'
]
@components
=
params
.
delete
(
:components
)
||
[
'main'
]
...
...
app/services/packages/debian/update_distribution_service.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Packages
...
@@ -4,7 +4,8 @@ module Packages
module
Debian
module
Debian
class
UpdateDistributionService
class
UpdateDistributionService
def
initialize
(
distribution
,
params
)
def
initialize
(
distribution
,
params
)
@distribution
,
@params
=
distribution
,
params
@distribution
=
distribution
@params
=
params
@components
=
params
.
delete
(
:components
)
@components
=
params
.
delete
(
:components
)
...
...
app/services/packages/maven/find_or_create_package_service.rb
View file @
b62ce98c
...
@@ -33,7 +33,8 @@ module Packages
...
@@ -33,7 +33,8 @@ module Packages
#
#
# The first upload has to create the proper package (the one with the version set).
# The first upload has to create the proper package (the one with the version set).
if
params
[
:file_name
]
==
Packages
::
Maven
::
Metadata
.
filename
&&
!
params
[
:path
]
&
.
ends_with?
(
SNAPSHOT_TERM
)
if
params
[
:file_name
]
==
Packages
::
Maven
::
Metadata
.
filename
&&
!
params
[
:path
]
&
.
ends_with?
(
SNAPSHOT_TERM
)
package_name
,
version
=
params
[
:path
],
nil
package_name
=
params
[
:path
]
version
=
nil
else
else
package_name
,
_
,
version
=
params
[
:path
].
rpartition
(
'/'
)
package_name
,
_
,
version
=
params
[
:path
].
rpartition
(
'/'
)
end
end
...
...
app/services/projects/branches_by_mode_service.rb
View file @
b62ce98c
...
@@ -71,7 +71,8 @@ class Projects::BranchesByModeService
...
@@ -71,7 +71,8 @@ class Projects::BranchesByModeService
# And increase it whenever we go to the next page
# And increase it whenever we go to the next page
previous_offset
=
params
[
:offset
].
to_i
previous_offset
=
params
[
:offset
].
to_i
previous_path
,
next_path
=
nil
,
nil
previous_path
=
nil
next_path
=
nil
return
[
branches
,
previous_path
,
next_path
]
if
branches
.
blank?
return
[
branches
,
previous_path
,
next_path
]
if
branches
.
blank?
...
...
app/services/projects/create_from_template_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module Projects
...
@@ -7,7 +7,8 @@ module Projects
attr_reader
:template_name
attr_reader
:template_name
def
initialize
(
user
,
params
)
def
initialize
(
user
,
params
)
@current_user
,
@params
=
user
,
params
.
to_h
.
dup
@current_user
=
user
@params
=
params
.
to_h
.
dup
@template_name
=
@params
.
delete
(
:template_name
).
presence
@template_name
=
@params
.
delete
(
:template_name
).
presence
end
end
...
...
app/services/projects/create_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Projects
...
@@ -5,7 +5,8 @@ module Projects
include
ValidatesClassificationLabel
include
ValidatesClassificationLabel
def
initialize
(
user
,
params
)
def
initialize
(
user
,
params
)
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
@skip_wiki
=
@params
.
delete
(
:skip_wiki
)
@skip_wiki
=
@params
.
delete
(
:skip_wiki
)
@initialize_with_readme
=
Gitlab
::
Utils
.
to_boolean
(
@params
.
delete
(
:initialize_with_readme
))
@initialize_with_readme
=
Gitlab
::
Utils
.
to_boolean
(
@params
.
delete
(
:initialize_with_readme
))
@import_data
=
@params
.
delete
(
:import_data
)
@import_data
=
@params
.
delete
(
:import_data
)
...
...
app/services/projects/download_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module Projects
...
@@ -7,7 +7,8 @@ module Projects
].
freeze
].
freeze
def
initialize
(
project
,
url
)
def
initialize
(
project
,
url
)
@project
,
@url
=
project
,
url
@project
=
project
@url
=
url
end
end
def
execute
def
execute
...
...
app/services/projects/gitlab_projects_import_service.rb
View file @
b62ce98c
...
@@ -11,7 +11,9 @@ module Projects
...
@@ -11,7 +11,9 @@ module Projects
attr_reader
:current_user
,
:params
attr_reader
:current_user
,
:params
def
initialize
(
user
,
import_params
,
override_params
=
nil
)
def
initialize
(
user
,
import_params
,
override_params
=
nil
)
@current_user
,
@params
,
@override_params
=
user
,
import_params
.
dup
,
override_params
@current_user
=
user
@params
=
import_params
.
dup
@override_params
=
override_params
end
end
def
execute
def
execute
...
...
app/services/projects/update_pages_service.rb
View file @
b62ce98c
...
@@ -23,7 +23,8 @@ module Projects
...
@@ -23,7 +23,8 @@ module Projects
attr_reader
:build
attr_reader
:build
def
initialize
(
project
,
build
)
def
initialize
(
project
,
build
)
@project
,
@build
=
project
,
build
@project
=
project
@build
=
build
end
end
def
execute
def
execute
...
...
app/services/prometheus/proxy_variable_substitution_service.rb
View file @
b62ce98c
...
@@ -41,7 +41,8 @@ module Prometheus
...
@@ -41,7 +41,8 @@ module Prometheus
# }
# }
# })
# })
def
initialize
(
environment
,
params
=
{})
def
initialize
(
environment
,
params
=
{})
@environment
,
@params
=
environment
,
params
.
deep_dup
@environment
=
environment
@params
=
params
.
deep_dup
end
end
# @return - params [Hash<Symbol,Any>] Returns a Hash containing a params key which is
# @return - params [Hash<Symbol,Any>] Returns a Hash containing a params key which is
...
...
app/services/releases/base_service.rb
View file @
b62ce98c
...
@@ -8,7 +8,9 @@ module Releases
...
@@ -8,7 +8,9 @@ module Releases
attr_accessor
:project
,
:current_user
,
:params
attr_accessor
:project
,
:current_user
,
:params
def
initialize
(
project
,
user
=
nil
,
params
=
{})
def
initialize
(
project
,
user
=
nil
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
user
,
params
.
dup
@project
=
project
@current_user
=
user
@params
=
params
.
dup
end
end
def
tag_name
def
tag_name
...
...
app/services/resource_events/change_labels_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module ResourceEvents
...
@@ -5,7 +5,8 @@ module ResourceEvents
attr_reader
:resource
,
:user
attr_reader
:resource
,
:user
def
initialize
(
resource
,
user
)
def
initialize
(
resource
,
user
)
@resource
,
@user
=
resource
,
user
@resource
=
resource
@user
=
user
end
end
def
execute
(
added_labels:
[],
removed_labels:
[])
def
execute
(
added_labels:
[],
removed_labels:
[])
...
...
app/services/resource_events/change_state_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module ResourceEvents
...
@@ -5,7 +5,8 @@ module ResourceEvents
attr_reader
:resource
,
:user
attr_reader
:resource
,
:user
def
initialize
(
user
:,
resource
:)
def
initialize
(
user
:,
resource
:)
@user
,
@resource
=
user
,
resource
@user
=
user
@resource
=
resource
end
end
def
execute
(
params
)
def
execute
(
params
)
...
...
app/services/search/global_service.rb
View file @
b62ce98c
...
@@ -9,7 +9,8 @@ module Search
...
@@ -9,7 +9,8 @@ module Search
attr_accessor
:current_user
,
:params
attr_accessor
:current_user
,
:params
def
initialize
(
user
,
params
)
def
initialize
(
user
,
params
)
@current_user
,
@params
=
user
,
params
.
dup
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
app/services/search/project_service.rb
View file @
b62ce98c
...
@@ -9,7 +9,9 @@ module Search
...
@@ -9,7 +9,9 @@ module Search
attr_accessor
:project
,
:current_user
,
:params
attr_accessor
:project
,
:current_user
,
:params
def
initialize
(
project
,
user
,
params
)
def
initialize
(
project
,
user
,
params
)
@project
,
@current_user
,
@params
=
project
,
user
,
params
.
dup
@project
=
project
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
app/services/task_list_toggle_service.rb
View file @
b62ce98c
...
@@ -9,8 +9,10 @@ class TaskListToggleService
...
@@ -9,8 +9,10 @@ class TaskListToggleService
attr_reader
:updated_markdown
,
:updated_markdown_html
attr_reader
:updated_markdown
,
:updated_markdown_html
def
initialize
(
markdown
,
markdown_html
,
line_source
:,
line_number
:,
toggle_as_checked
:)
def
initialize
(
markdown
,
markdown_html
,
line_source
:,
line_number
:,
toggle_as_checked
:)
@markdown
,
@markdown_html
=
markdown
,
markdown_html
@markdown
=
markdown
@line_source
,
@line_number
=
line_source
,
line_number
@markdown_html
=
markdown_html
@line_source
=
line_source
@line_number
=
line_number
@toggle_as_checked
=
toggle_as_checked
@toggle_as_checked
=
toggle_as_checked
@updated_markdown
,
@updated_markdown_html
=
nil
@updated_markdown
,
@updated_markdown_html
=
nil
...
...
app/services/two_factor/base_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module TwoFactor
...
@@ -7,7 +7,8 @@ module TwoFactor
attr_reader
:current_user
,
:params
,
:user
attr_reader
:current_user
,
:params
,
:user
def
initialize
(
current_user
,
params
=
{})
def
initialize
(
current_user
,
params
=
{})
@current_user
,
@params
=
current_user
,
params
@current_user
=
current_user
@params
=
params
@user
=
params
.
delete
(
:user
)
@user
=
params
.
delete
(
:user
)
end
end
end
end
...
...
app/services/upload_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,10 @@ class UploadService
...
@@ -5,7 +5,10 @@ class UploadService
attr_accessor
:override_max_attachment_size
attr_accessor
:override_max_attachment_size
def
initialize
(
model
,
file
,
uploader_class
=
FileUploader
,
**
uploader_context
)
def
initialize
(
model
,
file
,
uploader_class
=
FileUploader
,
**
uploader_context
)
@model
,
@file
,
@uploader_class
,
@uploader_context
=
model
,
file
,
uploader_class
,
uploader_context
@model
=
model
@file
=
file
@uploader_class
=
uploader_class
@uploader_context
=
uploader_context
end
end
def
execute
def
execute
...
...
app/services/user_agent_detail_service.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ class UserAgentDetailService
...
@@ -4,7 +4,8 @@ class UserAgentDetailService
attr_accessor
:spammable
,
:request
attr_accessor
:spammable
,
:request
def
initialize
(
spammable
,
request
)
def
initialize
(
spammable
,
request
)
@spammable
,
@request
=
spammable
,
request
@spammable
=
spammable
@request
=
request
end
end
def
create
def
create
...
...
app/services/users/respond_to_terms_service.rb
View file @
b62ce98c
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
module
Users
module
Users
class
RespondToTermsService
class
RespondToTermsService
def
initialize
(
user
,
term
)
def
initialize
(
user
,
term
)
@user
,
@term
=
user
,
term
@user
=
user
@term
=
term
end
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
...
...
app/services/users/set_status_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module Users
...
@@ -7,7 +7,8 @@ module Users
attr_reader
:current_user
,
:target_user
,
:params
attr_reader
:current_user
,
:target_user
,
:params
def
initialize
(
current_user
,
params
)
def
initialize
(
current_user
,
params
)
@current_user
,
@params
=
current_user
,
params
.
dup
@current_user
=
current_user
@params
=
params
.
dup
@target_user
=
params
.
delete
(
:user
)
||
current_user
@target_user
=
params
.
delete
(
:user
)
||
current_user
end
end
...
...
app/views/shared/_issuable_meta_data.html.haml
View file @
b62ce98c
-
note_count
=
@issuable_meta_data
[
issuable
.
id
].
user_notes_count
-
note_count
=
@issuable_meta_data
[
issuable
.
id
].
user_notes_count
-
issue_votes
=
@issuable_meta_data
[
issuable
.
id
]
-
issue_votes
=
@issuable_meta_data
[
issuable
.
id
]
-
upvotes
,
downvotes
=
issue_votes
.
upvotes
,
issue_votes
.
downvotes
-
upvotes
=
issue_votes
.
upvotes
-
downvotes
=
issue_votes
.
downvotes
-
issuable_path
=
issuable_path
(
issuable
,
anchor:
'notes'
)
-
issuable_path
=
issuable_path
(
issuable
,
anchor:
'notes'
)
-
issuable_mr
=
@issuable_meta_data
[
issuable
.
id
].
merge_requests_count
-
issuable_mr
=
@issuable_meta_data
[
issuable
.
id
].
merge_requests_count
...
...
app/workers/object_storage/migrate_uploads_worker.rb
View file @
b62ce98c
...
@@ -16,7 +16,8 @@ module ObjectStorage
...
@@ -16,7 +16,8 @@ module ObjectStorage
attr_accessor
:error
attr_accessor
:error
def
initialize
(
upload
,
error
=
nil
)
def
initialize
(
upload
,
error
=
nil
)
@upload
,
@error
=
upload
,
error
@upload
=
upload
@error
=
error
end
end
def
success?
def
success?
...
...
changelogs/unreleased/pl-rubocop-todo-parallel-assignment.yml
0 → 100644
View file @
b62ce98c
---
title
:
Resolves offenses Style/ParallelAssignment
merge_request
:
57999
author
:
Shubham Kumar (@imskr)
type
:
fixed
ee/app/services/admin/email_service.rb
View file @
b62ce98c
...
@@ -8,7 +8,9 @@ module Admin
...
@@ -8,7 +8,9 @@ module Admin
LEASE_KEY
=
'admin/email_service'
LEASE_KEY
=
'admin/email_service'
def
initialize
(
recipients
,
subject
,
body
)
def
initialize
(
recipients
,
subject
,
body
)
@recipients
,
@subject
,
@body
=
recipients
,
subject
,
body
@recipients
=
recipients
@subject
=
subject
@body
=
body
end
end
def
execute
def
execute
...
...
ee/app/services/epics/base_service.rb
View file @
b62ce98c
...
@@ -7,7 +7,9 @@ module Epics
...
@@ -7,7 +7,9 @@ module Epics
attr_reader
:group
,
:parent_epic
,
:child_epic
attr_reader
:group
,
:parent_epic
,
:child_epic
def
initialize
(
group
,
current_user
,
params
=
{})
def
initialize
(
group
,
current_user
,
params
=
{})
@group
,
@current_user
,
@params
=
group
,
current_user
,
params
@group
=
group
@current_user
=
current_user
@params
=
params
end
end
private
private
...
...
ee/app/services/iterations/cadences/create_service.rb
View file @
b62ce98c
...
@@ -8,7 +8,9 @@ module Iterations
...
@@ -8,7 +8,9 @@ module Iterations
attr_accessor
:group
,
:current_user
,
:params
attr_accessor
:group
,
:current_user
,
:params
def
initialize
(
group
,
user
,
params
=
{})
def
initialize
(
group
,
user
,
params
=
{})
@group
,
@current_user
,
@params
=
group
,
user
,
params
.
dup
@group
=
group
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
ee/app/services/iterations/cadences/update_service.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ module Iterations
...
@@ -6,7 +6,9 @@ module Iterations
include
Gitlab
::
Allowable
include
Gitlab
::
Allowable
def
initialize
(
iteration_cadence
,
user
,
params
=
{})
def
initialize
(
iteration_cadence
,
user
,
params
=
{})
@iteration_cadence
,
@current_user
,
@params
=
iteration_cadence
,
user
,
params
.
dup
@iteration_cadence
=
iteration_cadence
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
ee/app/services/iterations/create_service.rb
View file @
b62ce98c
...
@@ -8,7 +8,9 @@ module Iterations
...
@@ -8,7 +8,9 @@ module Iterations
attr_accessor
:parent
,
:current_user
,
:params
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
,
params
=
{})
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
@parent
=
parent
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
def
execute
...
...
ee/app/services/iterations/update_service.rb
View file @
b62ce98c
...
@@ -9,7 +9,9 @@ module Iterations
...
@@ -9,7 +9,9 @@ module Iterations
attr_accessor
:parent
,
:current_user
,
:params
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
,
params
=
{})
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
@parent
=
parent
@current_user
=
user
@params
=
params
.
dup
end
end
def
execute
(
iteration
)
def
execute
(
iteration
)
...
...
ee/app/services/licenses/base_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Licenses
...
@@ -5,7 +5,8 @@ module Licenses
include
Gitlab
::
Allowable
include
Gitlab
::
Allowable
def
initialize
(
license
,
user
)
def
initialize
(
license
,
user
)
@license
,
@user
=
license
,
user
@license
=
license
@user
=
user
end
end
def
execute
def
execute
...
...
ee/app/services/security/merge_reports_service.rb
View file @
b62ce98c
...
@@ -70,7 +70,8 @@ module Security
...
@@ -70,7 +70,8 @@ module Security
def
sort_findings!
def
sort_findings!
@findings
.
sort!
do
|
a
,
b
|
@findings
.
sort!
do
|
a
,
b
|
a_severity
,
b_severity
=
a
.
severity
,
b
.
severity
a_severity
=
a
.
severity
b_severity
=
b
.
severity
if
a_severity
==
b_severity
if
a_severity
==
b_severity
a
.
compare_key
<=>
b
.
compare_key
a
.
compare_key
<=>
b
.
compare_key
...
@@ -99,7 +100,8 @@ module Security
...
@@ -99,7 +100,8 @@ module Security
return
unless
reports_sortable?
return
unless
reports_sortable?
@source_reports
.
sort!
do
|
a
,
b
|
@source_reports
.
sort!
do
|
a
,
b
|
a_scanner_id
,
b_scanner_id
=
a
.
scanners
.
values
[
0
].
external_id
,
b
.
scanners
.
values
[
0
].
external_id
a_scanner_id
=
a
.
scanners
.
values
[
0
].
external_id
b_scanner_id
=
b
.
scanners
.
values
[
0
].
external_id
a_scanner_id
=
"unknown"
if
ANALYZER_ORDER
[
a_scanner_id
].
nil?
a_scanner_id
=
"unknown"
if
ANALYZER_ORDER
[
a_scanner_id
].
nil?
b_scanner_id
=
"unknown"
if
ANALYZER_ORDER
[
b_scanner_id
].
nil?
b_scanner_id
=
"unknown"
if
ANALYZER_ORDER
[
b_scanner_id
].
nil?
...
...
ee/app/services/vulnerability_feedback/destroy_service.rb
View file @
b62ce98c
...
@@ -5,7 +5,10 @@ module VulnerabilityFeedback
...
@@ -5,7 +5,10 @@ module VulnerabilityFeedback
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
def
initialize
(
project
,
user
,
vulnerability_feedback
,
revert_vulnerability_state:
true
)
def
initialize
(
project
,
user
,
vulnerability_feedback
,
revert_vulnerability_state:
true
)
@project
,
@current_user
,
@vulnerability_feedback
,
@revert_vulnerability_state
=
project
,
user
,
vulnerability_feedback
,
revert_vulnerability_state
@project
=
project
@current_user
=
user
@vulnerability_feedback
=
vulnerability_feedback
@revert_vulnerability_state
=
revert_vulnerability_state
end
end
def
execute
def
execute
...
...
ee/app/workers/repository_push_audit_event_worker.rb
View file @
b62ce98c
...
@@ -10,7 +10,9 @@ class RepositoryPushAuditEventWorker # rubocop:disable Scalability/IdempotentWor
...
@@ -10,7 +10,9 @@ class RepositoryPushAuditEventWorker # rubocop:disable Scalability/IdempotentWor
user
=
User
.
find
(
user_id
)
user
=
User
.
find
(
user_id
)
changes
.
map!
do
|
change
|
changes
.
map!
do
|
change
|
before
,
after
,
ref
=
change
[
'before'
],
change
[
'after'
],
change
[
'ref'
]
before
=
change
[
'before'
]
after
=
change
[
'after'
]
ref
=
change
[
'ref'
]
service
=
EE
::
AuditEvents
::
RepositoryPushAuditEventService
service
=
EE
::
AuditEvents
::
RepositoryPushAuditEventService
.
new
(
user
,
project
,
ref
,
before
,
after
)
.
new
(
user
,
project
,
ref
,
before
,
after
)
...
...
ee/lib/elastic/latest/document_should_be_deleted_from_index_error.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ module Elastic
...
@@ -6,7 +6,8 @@ module Elastic
attr_reader
:class_name
,
:record_id
attr_reader
:class_name
,
:record_id
def
initialize
(
class_name
,
record_id
)
def
initialize
(
class_name
,
record_id
)
@class_name
,
@record_id
=
class_name
,
record_id
@class_name
=
class_name
@record_id
=
record_id
end
end
def
message
def
message
...
...
ee/lib/gitlab/code_owners/loader.rb
View file @
b62ce98c
...
@@ -6,7 +6,9 @@ module Gitlab
...
@@ -6,7 +6,9 @@ module Gitlab
include
::
Gitlab
::
Utils
::
StrongMemoize
include
::
Gitlab
::
Utils
::
StrongMemoize
def
initialize
(
project
,
ref
,
paths
)
def
initialize
(
project
,
ref
,
paths
)
@project
,
@ref
,
@paths
=
project
,
ref
,
Array
(
paths
)
@project
=
project
@ref
=
ref
@paths
=
Array
(
paths
)
end
end
def
entries
def
entries
...
...
ee/spec/features/projects/licenses/maintainer_views_policies_spec.rb
View file @
b62ce98c
...
@@ -62,7 +62,8 @@ RSpec.describe 'EE > Projects > Licenses > Maintainer views policies', :js do
...
@@ -62,7 +62,8 @@ RSpec.describe 'EE > Projects > Licenses > Maintainer views policies', :js do
end
end
def
label_for
(
dependency
)
def
label_for
(
dependency
)
name
,
version
=
dependency
[
'name'
],
dependency
[
'version'
]
name
=
dependency
[
'name'
]
version
=
dependency
[
'version'
]
version
?
"
#{
name
}
(
#{
version
}
)"
:
name
version
?
"
#{
name
}
(
#{
version
}
)"
:
name
end
end
...
...
lib/banzai/filter/references/label_reference_filter.rb
View file @
b62ce98c
...
@@ -18,7 +18,8 @@ module Banzai
...
@@ -18,7 +18,8 @@ module Banzai
def
references_in
(
text
,
pattern
=
Label
.
reference_pattern
)
def
references_in
(
text
,
pattern
=
Label
.
reference_pattern
)
labels
=
{}
labels
=
{}
unescaped_html
=
unescape_html_entities
(
text
).
gsub
(
pattern
)
do
|
match
|
unescaped_html
=
unescape_html_entities
(
text
).
gsub
(
pattern
)
do
|
match
|
namespace
,
project
=
$~
[
:namespace
],
$~
[
:project
]
namespace
=
$~
[
:namespace
]
project
=
$~
[
:project
]
project_path
=
full_project_path
(
namespace
,
project
)
project_path
=
full_project_path
(
namespace
,
project
)
label
=
find_label_cached
(
project_path
,
$~
[
:label_id
],
$~
[
:label_name
])
label
=
find_label_cached
(
project_path
,
$~
[
:label_id
],
$~
[
:label_name
])
...
...
lib/container_registry/config.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module ContainerRegistry
...
@@ -5,7 +5,8 @@ module ContainerRegistry
attr_reader
:tag
,
:blob
,
:data
attr_reader
:tag
,
:blob
,
:data
def
initialize
(
tag
,
blob
)
def
initialize
(
tag
,
blob
)
@tag
,
@blob
=
tag
,
blob
@tag
=
tag
@blob
=
blob
@data
=
Gitlab
::
Json
.
parse
(
blob
.
data
)
@data
=
Gitlab
::
Json
.
parse
(
blob
.
data
)
end
end
...
...
lib/container_registry/tag.rb
View file @
b62ce98c
...
@@ -10,7 +10,8 @@ module ContainerRegistry
...
@@ -10,7 +10,8 @@ module ContainerRegistry
delegate
:revision
,
:short_revision
,
to: :config_blob
,
allow_nil:
true
delegate
:revision
,
:short_revision
,
to: :config_blob
,
allow_nil:
true
def
initialize
(
repository
,
name
)
def
initialize
(
repository
,
name
)
@repository
,
@name
=
repository
,
name
@repository
=
repository
@name
=
name
end
end
def
valid?
def
valid?
...
...
lib/declarative_policy/preferred_scope.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module DeclarativePolicy
...
@@ -5,7 +5,8 @@ module DeclarativePolicy
PREFERRED_SCOPE_KEY
=
:"DeclarativePolicy.preferred_scope"
PREFERRED_SCOPE_KEY
=
:"DeclarativePolicy.preferred_scope"
def
with_preferred_scope
(
scope
)
def
with_preferred_scope
(
scope
)
Thread
.
current
[
PREFERRED_SCOPE_KEY
],
old_scope
=
scope
,
Thread
.
current
[
PREFERRED_SCOPE_KEY
]
old_scope
=
Thread
.
current
[
PREFERRED_SCOPE_KEY
]
Thread
.
current
[
PREFERRED_SCOPE_KEY
]
=
scope
yield
yield
ensure
ensure
Thread
.
current
[
PREFERRED_SCOPE_KEY
]
=
old_scope
Thread
.
current
[
PREFERRED_SCOPE_KEY
]
=
old_scope
...
...
lib/file_size_validator.rb
View file @
b62ce98c
...
@@ -11,7 +11,8 @@ class FileSizeValidator < ActiveModel::EachValidator
...
@@ -11,7 +11,8 @@ class FileSizeValidator < ActiveModel::EachValidator
if
range
=
(
options
.
delete
(
:in
)
||
options
.
delete
(
:within
))
if
range
=
(
options
.
delete
(
:in
)
||
options
.
delete
(
:within
))
raise
ArgumentError
,
":in and :within must be a Range"
unless
range
.
is_a?
(
Range
)
raise
ArgumentError
,
":in and :within must be a Range"
unless
range
.
is_a?
(
Range
)
options
[
:minimum
],
options
[
:maximum
]
=
range
.
begin
,
range
.
end
options
[
:minimum
]
=
range
.
begin
options
[
:maximum
]
=
range
.
end
options
[
:maximum
]
-=
1
if
range
.
exclude_end?
options
[
:maximum
]
-=
1
if
range
.
exclude_end?
end
end
...
...
lib/gitlab/batch_pop_queueing.rb
View file @
b62ce98c
...
@@ -46,7 +46,8 @@ module Gitlab
...
@@ -46,7 +46,8 @@ module Gitlab
def
initialize
(
namespace
,
queue_id
)
def
initialize
(
namespace
,
queue_id
)
raise
ArgumentError
if
namespace
.
empty?
||
queue_id
.
empty?
raise
ArgumentError
if
namespace
.
empty?
||
queue_id
.
empty?
@namespace
,
@queue_id
=
namespace
,
queue_id
@namespace
=
namespace
@queue_id
=
queue_id
end
end
##
##
...
...
lib/gitlab/cache/ci/project_pipeline_status.rb
View file @
b62ce98c
...
@@ -69,7 +69,9 @@ module Gitlab
...
@@ -69,7 +69,9 @@ module Gitlab
def
load_from_project
def
load_from_project
return
unless
commit
return
unless
commit
self
.
sha
,
self
.
status
,
self
.
ref
=
commit
.
sha
,
commit
.
status
,
project
.
default_branch
self
.
sha
=
commit
.
sha
self
.
status
=
commit
.
status
self
.
ref
=
project
.
default_branch
end
end
# We only cache the status for the HEAD commit of a project
# We only cache the status for the HEAD commit of a project
...
...
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
b62ce98c
...
@@ -17,7 +17,9 @@ module Gitlab
...
@@ -17,7 +17,9 @@ module Gitlab
attr_reader
:stream
,
:path
,
:full_version
attr_reader
:stream
,
:path
,
:full_version
def
initialize
(
stream
,
path
,
**
opts
)
def
initialize
(
stream
,
path
,
**
opts
)
@stream
,
@path
,
@opts
=
stream
,
path
,
opts
@stream
=
stream
@path
=
path
@opts
=
opts
@full_version
=
read_version
@full_version
=
read_version
end
end
...
...
lib/gitlab/contributor.rb
View file @
b62ce98c
...
@@ -5,7 +5,9 @@ module Gitlab
...
@@ -5,7 +5,9 @@ module Gitlab
attr_accessor
:email
,
:name
,
:commits
,
:additions
,
:deletions
attr_accessor
:email
,
:name
,
:commits
,
:additions
,
:deletions
def
initialize
def
initialize
@commits
,
@additions
,
@deletions
=
0
,
0
,
0
@commits
=
0
@additions
=
0
@deletions
=
0
end
end
end
end
end
end
lib/gitlab/diff/line.rb
View file @
b62ce98c
...
@@ -13,8 +13,11 @@ module Gitlab
...
@@ -13,8 +13,11 @@ module Gitlab
attr_accessor
:index
,
:type
,
:old_pos
,
:new_pos
attr_accessor
:index
,
:type
,
:old_pos
,
:new_pos
def
initialize
(
text
,
type
,
index
,
old_pos
,
new_pos
,
parent_file:
nil
,
line_code:
nil
,
rich_text:
nil
)
def
initialize
(
text
,
type
,
index
,
old_pos
,
new_pos
,
parent_file:
nil
,
line_code:
nil
,
rich_text:
nil
)
@text
,
@type
,
@index
=
text
,
type
,
index
@text
=
text
@old_pos
,
@new_pos
=
old_pos
,
new_pos
@type
=
type
@index
=
index
@old_pos
=
old_pos
@new_pos
=
new_pos
@parent_file
=
parent_file
@parent_file
=
parent_file
@rich_text
=
rich_text
@rich_text
=
rich_text
...
...
lib/gitlab/diff/suggestions_parser.rb
View file @
b62ce98c
...
@@ -29,9 +29,8 @@ module Gitlab
...
@@ -29,9 +29,8 @@ module Gitlab
lines_above
,
lines_below
=
nil
lines_above
,
lines_below
=
nil
if
lang_param
&&
suggestion_params
=
fetch_suggestion_params
(
lang_param
)
if
lang_param
&&
suggestion_params
=
fetch_suggestion_params
(
lang_param
)
lines_above
,
lines_below
=
lines_above
=
suggestion_params
[
:above
]
suggestion_params
[
:above
],
lines_below
=
suggestion_params
[
:below
]
suggestion_params
[
:below
]
end
end
Gitlab
::
Diff
::
Suggestion
.
new
(
node
.
text
,
Gitlab
::
Diff
::
Suggestion
.
new
(
node
.
text
,
...
...
lib/gitlab/external_authorization/access.rb
View file @
b62ce98c
...
@@ -10,7 +10,8 @@ module Gitlab
...
@@ -10,7 +10,8 @@ module Gitlab
:load_type
:load_type
def
initialize
(
user
,
label
)
def
initialize
(
user
,
label
)
@user
,
@label
=
user
,
label
@user
=
user
@label
=
label
end
end
def
loaded?
def
loaded?
...
...
lib/gitlab/external_authorization/cache.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ module Gitlab
...
@@ -6,7 +6,8 @@ module Gitlab
VALIDITY_TIME
=
6
.
hours
VALIDITY_TIME
=
6
.
hours
def
initialize
(
user
,
label
)
def
initialize
(
user
,
label
)
@user
,
@label
=
user
,
label
@user
=
user
@label
=
label
end
end
def
load
def
load
...
...
lib/gitlab/external_authorization/client.rb
View file @
b62ce98c
...
@@ -13,7 +13,8 @@ module Gitlab
...
@@ -13,7 +13,8 @@ module Gitlab
}.
freeze
}.
freeze
def
initialize
(
user
,
label
)
def
initialize
(
user
,
label
)
@user
,
@label
=
user
,
label
@user
=
user
@label
=
label
end
end
def
request_access
def
request_access
...
...
lib/gitlab/git/blame.rb
View file @
b62ce98c
...
@@ -30,8 +30,10 @@ module Gitlab
...
@@ -30,8 +30,10 @@ module Gitlab
end
end
def
process_raw_blame
(
output
)
def
process_raw_blame
(
output
)
lines
,
final
=
[],
[]
lines
=
[]
info
,
commits
=
{},
{}
final
=
[]
info
=
{}
commits
=
{}
# process the output
# process the output
output
.
split
(
"
\n
"
).
each
do
|
line
|
output
.
split
(
"
\n
"
).
each
do
|
line
|
...
...
lib/gitlab/git/merge_base.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ module Gitlab
...
@@ -6,7 +6,8 @@ module Gitlab
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
def
initialize
(
repository
,
refs
)
def
initialize
(
repository
,
refs
)
@repository
,
@refs
=
repository
,
refs
@repository
=
repository
@refs
=
refs
end
end
# Returns the SHA of the first common ancestor
# Returns the SHA of the first common ancestor
...
...
lib/gitlab/git/patches/commit_patches.rb
View file @
b62ce98c
...
@@ -7,7 +7,10 @@ module Gitlab
...
@@ -7,7 +7,10 @@ module Gitlab
include
Gitlab
::
Git
::
WrapsGitalyErrors
include
Gitlab
::
Git
::
WrapsGitalyErrors
def
initialize
(
user
,
repository
,
branch
,
patch_collection
)
def
initialize
(
user
,
repository
,
branch
,
patch_collection
)
@user
,
@repository
,
@branch
,
@patches
=
user
,
repository
,
branch
,
patch_collection
@user
=
user
@repository
=
repository
@branch
=
branch
@patches
=
patch_collection
end
end
def
commit
def
commit
...
...
lib/gitlab/graphql/loaders/batch_lfs_oid_loader.rb
View file @
b62ce98c
...
@@ -5,7 +5,8 @@ module Gitlab
...
@@ -5,7 +5,8 @@ module Gitlab
module
Loaders
module
Loaders
class
BatchLfsOidLoader
class
BatchLfsOidLoader
def
initialize
(
repository
,
blob_id
)
def
initialize
(
repository
,
blob_id
)
@repository
,
@blob_id
=
repository
,
blob_id
@repository
=
repository
@blob_id
=
blob_id
end
end
def
find
def
find
...
...
lib/gitlab/graphql/loaders/batch_model_loader.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ module Gitlab
...
@@ -7,7 +7,8 @@ module Gitlab
attr_reader
:model_class
,
:model_id
attr_reader
:model_class
,
:model_id
def
initialize
(
model_class
,
model_id
)
def
initialize
(
model_class
,
model_id
)
@model_class
,
@model_id
=
model_class
,
model_id
@model_class
=
model_class
@model_id
=
model_id
end
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
...
...
lib/gitlab/graphql/loaders/full_path_model_loader.rb
View file @
b62ce98c
...
@@ -9,7 +9,8 @@ module Gitlab
...
@@ -9,7 +9,8 @@ module Gitlab
attr_reader
:model_class
,
:full_path
attr_reader
:model_class
,
:full_path
def
initialize
(
model_class
,
full_path
)
def
initialize
(
model_class
,
full_path
)
@model_class
,
@full_path
=
model_class
,
full_path
@model_class
=
model_class
@full_path
=
full_path
end
end
def
find
def
find
...
...
lib/gitlab/graphql/pagination/keyset/conditions/base_condition.rb
View file @
b62ce98c
...
@@ -13,7 +13,11 @@ module Gitlab
...
@@ -13,7 +13,11 @@ module Gitlab
# @param [Symbol] before_or_after indicates whether we want
# @param [Symbol] before_or_after indicates whether we want
# items :before the cursor or :after the cursor
# items :before the cursor or :after the cursor
def
initialize
(
arel_table
,
order_list
,
values
,
operators
,
before_or_after
)
def
initialize
(
arel_table
,
order_list
,
values
,
operators
,
before_or_after
)
@arel_table
,
@order_list
,
@values
,
@operators
,
@before_or_after
=
arel_table
,
order_list
,
values
,
operators
,
before_or_after
@arel_table
=
arel_table
@order_list
=
order_list
@values
=
values
@operators
=
operators
@before_or_after
=
before_or_after
@before_or_after
=
:after
unless
[
:after
,
:before
].
include?
(
@before_or_after
)
@before_or_after
=
:after
unless
[
:after
,
:before
].
include?
(
@before_or_after
)
end
end
...
...
lib/gitlab/graphql/pagination/keyset/query_builder.rb
View file @
b62ce98c
...
@@ -6,7 +6,10 @@ module Gitlab
...
@@ -6,7 +6,10 @@ module Gitlab
module
Keyset
module
Keyset
class
QueryBuilder
class
QueryBuilder
def
initialize
(
arel_table
,
order_list
,
decoded_cursor
,
before_or_after
)
def
initialize
(
arel_table
,
order_list
,
decoded_cursor
,
before_or_after
)
@arel_table
,
@order_list
,
@decoded_cursor
,
@before_or_after
=
arel_table
,
order_list
,
decoded_cursor
,
before_or_after
@arel_table
=
arel_table
@order_list
=
order_list
@decoded_cursor
=
decoded_cursor
@before_or_after
=
before_or_after
if
order_list
.
empty?
if
order_list
.
empty?
raise
ArgumentError
.
new
(
'No ordering scopes have been supplied'
)
raise
ArgumentError
.
new
(
'No ordering scopes have been supplied'
)
...
...
lib/gitlab/phabricator_import/issues/importer.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Gitlab
...
@@ -4,7 +4,8 @@ module Gitlab
module
Issues
module
Issues
class
Importer
class
Importer
def
initialize
(
project
,
after
=
nil
)
def
initialize
(
project
,
after
=
nil
)
@project
,
@after
=
project
,
after
@project
=
project
@after
=
after
end
end
def
execute
def
execute
...
...
lib/gitlab/phabricator_import/issues/task_importer.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Gitlab
...
@@ -4,7 +4,8 @@ module Gitlab
module
Issues
module
Issues
class
TaskImporter
class
TaskImporter
def
initialize
(
project
,
task
)
def
initialize
(
project
,
task
)
@project
,
@task
=
project
,
task
@project
=
project
@task
=
task
end
end
def
execute
def
execute
...
...
lib/gitlab/phabricator_import/user_finder.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Gitlab
...
@@ -4,7 +4,8 @@ module Gitlab
module
PhabricatorImport
module
PhabricatorImport
class
UserFinder
class
UserFinder
def
initialize
(
project
,
phids
)
def
initialize
(
project
,
phids
)
@project
,
@phids
=
project
,
phids
@project
=
project
@phids
=
phids
@loaded_phids
=
Set
.
new
@loaded_phids
=
Set
.
new
end
end
...
...
lib/gitlab/project_template.rb
View file @
b62ce98c
...
@@ -5,7 +5,11 @@ module Gitlab
...
@@ -5,7 +5,11 @@ module Gitlab
attr_reader
:title
,
:name
,
:description
,
:preview
,
:logo
attr_reader
:title
,
:name
,
:description
,
:preview
,
:logo
def
initialize
(
name
,
title
,
description
,
preview
,
logo
=
'illustrations/gitlab_logo.svg'
)
def
initialize
(
name
,
title
,
description
,
preview
,
logo
=
'illustrations/gitlab_logo.svg'
)
@name
,
@title
,
@description
,
@preview
,
@logo
=
name
,
title
,
description
,
preview
,
logo
@name
=
name
@title
=
title
@description
=
description
@preview
=
preview
@logo
=
logo
end
end
def
file
def
file
...
...
lib/gitlab/relative_positioning/closed_range.rb
View file @
b62ce98c
...
@@ -4,7 +4,8 @@ module Gitlab
...
@@ -4,7 +4,8 @@ module Gitlab
module
RelativePositioning
module
RelativePositioning
class
ClosedRange
<
RelativePositioning
::
Range
class
ClosedRange
<
RelativePositioning
::
Range
def
initialize
(
lhs
,
rhs
)
def
initialize
(
lhs
,
rhs
)
@lhs
,
@rhs
=
lhs
,
rhs
@lhs
=
lhs
@rhs
=
rhs
raise
IllegalRange
,
'Either lhs or rhs is missing'
unless
lhs
&&
rhs
raise
IllegalRange
,
'Either lhs or rhs is missing'
unless
lhs
&&
rhs
raise
IllegalRange
,
'lhs and rhs cannot be the same object'
if
lhs
==
rhs
raise
IllegalRange
,
'lhs and rhs cannot be the same object'
if
lhs
==
rhs
end
end
...
...
lib/gitlab/relative_positioning/gap.rb
View file @
b62ce98c
...
@@ -6,7 +6,8 @@ module Gitlab
...
@@ -6,7 +6,8 @@ module Gitlab
attr_reader
:start_pos
,
:end_pos
attr_reader
:start_pos
,
:end_pos
def
initialize
(
start_pos
,
end_pos
)
def
initialize
(
start_pos
,
end_pos
)
@start_pos
,
@end_pos
=
start_pos
,
end_pos
@start_pos
=
start_pos
@end_pos
=
end_pos
end
end
def
==
(
other
)
def
==
(
other
)
...
...
lib/gitlab/slash_commands/base_command.rb
View file @
b62ce98c
...
@@ -36,7 +36,9 @@ module Gitlab
...
@@ -36,7 +36,9 @@ module Gitlab
attr_accessor
:project
,
:current_user
,
:params
,
:chat_name
attr_accessor
:project
,
:current_user
,
:params
,
:chat_name
def
initialize
(
project
,
chat_name
,
params
=
{})
def
initialize
(
project
,
chat_name
,
params
=
{})
@project
,
@current_user
,
@params
=
project
,
chat_name
.
user
,
params
.
dup
@project
=
project
@current_user
=
chat_name
.
user
@params
=
params
.
dup
@chat_name
=
chat_name
@chat_name
=
chat_name
end
end
...
...
lib/tasks/gitlab/db.rake
View file @
b62ce98c
...
@@ -221,7 +221,8 @@ namespace :gitlab do
...
@@ -221,7 +221,8 @@ namespace :gitlab do
result_file
=
args
[
:result_file
]
||
raise
(
"Please specify result_file argument"
)
result_file
=
args
[
:result_file
]
||
raise
(
"Please specify result_file argument"
)
raise
"File exists already, won't overwrite:
#{
result_file
}
"
if
File
.
exist?
(
result_file
)
raise
"File exists already, won't overwrite:
#{
result_file
}
"
if
File
.
exist?
(
result_file
)
verbose_was
,
ActiveRecord
::
Migration
.
verbose
=
ActiveRecord
::
Migration
.
verbose
,
true
verbose_was
=
ActiveRecord
::
Migration
.
verbose
ActiveRecord
::
Migration
.
verbose
=
true
ctx
=
ActiveRecord
::
Base
.
connection
.
migration_context
ctx
=
ActiveRecord
::
Base
.
connection
.
migration_context
existing_versions
=
ctx
.
get_all_versions
.
to_set
existing_versions
=
ctx
.
get_all_versions
.
to_set
...
...
spec/finders/concerns/finder_with_group_hierarchy_spec.rb
View file @
b62ce98c
...
@@ -9,7 +9,8 @@ RSpec.describe FinderWithGroupHierarchy do
...
@@ -9,7 +9,8 @@ RSpec.describe FinderWithGroupHierarchy do
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
def
initialize
(
current_user
,
params
=
{})
def
initialize
(
current_user
,
params
=
{})
@current_user
,
@params
=
current_user
,
params
@current_user
=
current_user
@params
=
params
end
end
def
execute
(
skip_authorization:
false
)
def
execute
(
skip_authorization:
false
)
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
View file @
b62ce98c
...
@@ -246,7 +246,8 @@ RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :
...
@@ -246,7 +246,8 @@ RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :
subject
.
track_rename
(
'namespace'
,
'path/to/namespace'
,
'path/to/renamed'
)
subject
.
track_rename
(
'namespace'
,
'path/to/namespace'
,
'path/to/renamed'
)
old_path
,
new_path
=
[
nil
,
nil
]
old_path
=
nil
new_path
=
nil
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
rename_info
=
redis
.
lpop
(
key
)
rename_info
=
redis
.
lpop
(
key
)
old_path
,
new_path
=
Gitlab
::
Json
.
parse
(
rename_info
)
old_path
,
new_path
=
Gitlab
::
Json
.
parse
(
rename_info
)
...
...
spec/lib/gitlab/diff/lines_unfolder_spec.rb
View file @
b62ce98c
...
@@ -302,7 +302,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -302,7 +302,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
@@ -396,7 +397,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -396,7 +397,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
@@ -490,7 +492,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -490,7 +492,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
@@ -581,7 +584,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -581,7 +584,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
@@ -691,7 +695,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -691,7 +695,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
@@ -783,7 +788,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
...
@@ -783,7 +788,8 @@ RSpec.describe Gitlab::Diff::LinesUnfolder do
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
=
subject
.
unfolded_diff_lines
new_diff_lines
.
each_with_index
do
|
line
,
i
|
new_diff_lines
.
each_with_index
do
|
line
,
i
|
old_pos
,
new_pos
=
expected_diff_lines
[
i
][
0
],
expected_diff_lines
[
i
][
1
]
old_pos
=
expected_diff_lines
[
i
][
0
]
new_pos
=
expected_diff_lines
[
i
][
1
]
unless
line
.
type
==
'match'
unless
line
.
type
==
'match'
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
expect
(
line
.
line_code
).
to
eq
(
Gitlab
::
Git
.
diff_line_code
(
diff_file
.
file_path
,
new_pos
,
old_pos
))
...
...
spec/lib/gitlab/diff/suggestions_parser_spec.rb
View file @
b62ce98c
...
@@ -56,7 +56,8 @@ RSpec.describe Gitlab::Diff::SuggestionsParser do
...
@@ -56,7 +56,8 @@ RSpec.describe Gitlab::Diff::SuggestionsParser do
end
end
it
'parsed suggestion has correct data'
do
it
'parsed suggestion has correct data'
do
from_line
,
to_line
=
position
.
new_line
,
position
.
new_line
from_line
=
position
.
new_line
to_line
=
position
.
new_line
expect
(
subject
.
first
.
to_hash
).
to
include
(
from_content:
blob_lines_data
(
from_line
,
to_line
),
expect
(
subject
.
first
.
to_hash
).
to
include
(
from_content:
blob_lines_data
(
from_line
,
to_line
),
to_content:
" foo
\n
bar
\n
"
,
to_content:
" foo
\n
bar
\n
"
,
...
...
spec/lib/gitlab/markdown_cache/redis/extension_spec.rb
View file @
b62ce98c
...
@@ -7,7 +7,8 @@ RSpec.describe Gitlab::MarkdownCache::Redis::Extension, :clean_gitlab_redis_cach
...
@@ -7,7 +7,8 @@ RSpec.describe Gitlab::MarkdownCache::Redis::Extension, :clean_gitlab_redis_cach
include
CacheMarkdownField
include
CacheMarkdownField
def
initialize
(
title:
nil
,
description:
nil
)
def
initialize
(
title:
nil
,
description:
nil
)
@title
,
@description
=
title
,
description
@title
=
title
@description
=
description
end
end
attr_reader
:title
,
:description
attr_reader
:title
,
:description
...
...
spec/lib/gitlab/utils/lazy_attributes_spec.rb
View file @
b62ce98c
...
@@ -13,8 +13,10 @@ RSpec.describe Gitlab::Utils::LazyAttributes do
...
@@ -13,8 +13,10 @@ RSpec.describe Gitlab::Utils::LazyAttributes do
def
initialize
def
initialize
@number
=
->
{
1
}
@number
=
->
{
1
}
@reader_1
,
@reader_2
=
'reader_1'
,
->
{
'reader_2'
}
@reader_1
=
'reader_1'
@incorrect_type
,
@accessor_2
=
->
{
:incorrect_type
},
->
{
'accessor_2'
}
@reader_2
=
->
{
'reader_2'
}
@incorrect_type
=
->
{
:incorrect_type
}
@accessor_2
=
->
{
'accessor_2'
}
end
end
end
end
end
end
...
...
spec/models/concerns/cache_markdown_field_spec.rb
View file @
b62ce98c
...
@@ -17,9 +17,13 @@ RSpec.describe CacheMarkdownField, :clean_gitlab_redis_cache do
...
@@ -17,9 +17,13 @@ RSpec.describe CacheMarkdownField, :clean_gitlab_redis_cache do
include
CacheMarkdownField
include
CacheMarkdownField
def
initialize
(
args
=
{})
def
initialize
(
args
=
{})
@title
,
@description
,
@cached_markdown_version
=
args
[
:title
],
args
[
:description
],
args
[
:cached_markdown_version
]
@title
=
args
[
:title
]
@title_html
,
@description_html
=
args
[
:title_html
],
args
[
:description_html
]
@description
=
args
[
:description
]
@author
,
@project
=
args
[
:author
],
args
[
:project
]
@cached_markdown_version
=
args
[
:cached_markdown_version
]
@title_html
=
args
[
:title_html
]
@description_html
=
args
[
:description_html
]
@author
=
args
[
:author
]
@project
=
args
[
:project
]
@parent_user
=
args
[
:parent_user
]
@parent_user
=
args
[
:parent_user
]
end
end
...
...
spec/models/repository_spec.rb
View file @
b62ce98c
...
@@ -1103,7 +1103,8 @@ RSpec.describe Repository do
...
@@ -1103,7 +1103,8 @@ RSpec.describe Repository do
describe
'#create_ref'
do
describe
'#create_ref'
do
it
'redirects the call to write_ref'
do
it
'redirects the call to write_ref'
do
ref
,
ref_path
=
'1'
,
'2'
ref
=
'1'
ref_path
=
'2'
expect
(
repository
.
raw_repository
).
to
receive
(
:write_ref
).
with
(
ref_path
,
ref
)
expect
(
repository
.
raw_repository
).
to
receive
(
:write_ref
).
with
(
ref_path
,
ref
)
...
...
spec/support/helpers/graphql_helpers.rb
View file @
b62ce98c
...
@@ -307,7 +307,10 @@ module GraphqlHelpers
...
@@ -307,7 +307,10 @@ module GraphqlHelpers
def
query_graphql_field
(
name
,
attributes
=
{},
fields
=
nil
,
type
=
nil
)
def
query_graphql_field
(
name
,
attributes
=
{},
fields
=
nil
,
type
=
nil
)
type
||=
name
.
to_s
.
classify
type
||=
name
.
to_s
.
classify
attributes
,
fields
=
[
nil
,
attributes
]
if
fields
.
nil?
&&
!
attributes
.
is_a?
(
Hash
)
if
fields
.
nil?
&&
!
attributes
.
is_a?
(
Hash
)
fields
=
attributes
attributes
=
nil
end
field
=
field_with_params
(
name
,
attributes
)
field
=
field_with_params
(
name
,
attributes
)
...
...
spec/support/helpers/key_generator_helper.rb
View file @
b62ce98c
...
@@ -27,7 +27,8 @@ module Spec
...
@@ -27,7 +27,8 @@ module Spec
# Encodes an openssh-mpi-encoded integer.
# Encodes an openssh-mpi-encoded integer.
def
encode_mpi
(
n
)
# rubocop:disable Naming/UncommunicativeMethodParamName
def
encode_mpi
(
n
)
# rubocop:disable Naming/UncommunicativeMethodParamName
chars
,
n
=
[],
n
.
to_i
chars
=
[]
n
=
n
.
to_i
chars
<<
(
n
&
0xff
)
&&
n
>>=
8
while
n
!=
0
chars
<<
(
n
&
0xff
)
&&
n
>>=
8
while
n
!=
0
chars
<<
0
if
chars
.
empty?
||
chars
.
last
>=
0x80
chars
<<
0
if
chars
.
empty?
||
chars
.
last
>=
0x80
chars
.
reverse
.
pack
(
'C*'
)
chars
.
reverse
.
pack
(
'C*'
)
...
...
spec/validators/x509_certificate_credentials_validator_spec.rb
View file @
b62ce98c
...
@@ -13,7 +13,9 @@ RSpec.describe X509CertificateCredentialsValidator do
...
@@ -13,7 +13,9 @@ RSpec.describe X509CertificateCredentialsValidator do
attr_accessor
:certificate
,
:private_key
,
:passphrase
attr_accessor
:certificate
,
:private_key
,
:passphrase
def
initialize
(
certificate
,
private_key
,
passphrase
=
nil
)
def
initialize
(
certificate
,
private_key
,
passphrase
=
nil
)
@certificate
,
@private_key
,
@passphrase
=
certificate
,
private_key
,
passphrase
@certificate
=
certificate
@private_key
=
private_key
@passphrase
=
passphrase
end
end
end
end
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