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
40c8a21c
Commit
40c8a21c
authored
Apr 19, 2021
by
Shubham Kumar
Committed by
Rémy Coutable
Apr 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolves rubocop offense Style/RedundantAssignment
parent
6853eeb8
Changes
74
Show whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
92 additions
and
217 deletions
+92
-217
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/finders/award_emojis_finder.rb
app/finders/award_emojis_finder.rb
+1
-2
app/finders/branches_finder.rb
app/finders/branches_finder.rb
+1
-2
app/finders/ci/daily_build_group_report_results_finder.rb
app/finders/ci/daily_build_group_report_results_finder.rb
+2
-4
app/finders/ci/variables_finder.rb
app/finders/ci/variables_finder.rb
+1
-2
app/finders/context_commits_finder.rb
app/finders/context_commits_finder.rb
+6
-12
app/finders/deployments_finder.rb
app/finders/deployments_finder.rb
+1
-3
app/finders/environments_finder.rb
app/finders/environments_finder.rb
+1
-3
app/finders/group_projects_finder.rb
app/finders/group_projects_finder.rb
+1
-2
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-3
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+1
-2
app/finders/merge_request/metrics_finder.rb
app/finders/merge_request/metrics_finder.rb
+1
-3
app/finders/namespaces/projects_finder.rb
app/finders/namespaces/projects_finder.rb
+1
-2
app/finders/packages/conan/package_file_finder.rb
app/finders/packages/conan/package_file_finder.rb
+1
-2
app/finders/packages/debian/distributions_finder.rb
app/finders/packages/debian/distributions_finder.rb
+1
-2
app/finders/packages/group_packages_finder.rb
app/finders/packages/group_packages_finder.rb
+1
-2
app/finders/packages/package_file_finder.rb
app/finders/packages/package_file_finder.rb
+1
-3
app/finders/packages/packages_finder.rb
app/finders/packages/packages_finder.rb
+1
-2
app/finders/pending_todos_finder.rb
app/finders/pending_todos_finder.rb
+1
-3
app/finders/projects/export_job_finder.rb
app/finders/projects/export_job_finder.rb
+1
-3
app/finders/projects/prometheus/alerts_finder.rb
app/finders/projects/prometheus/alerts_finder.rb
+1
-3
app/finders/projects_finder.rb
app/finders/projects_finder.rb
+1
-2
app/finders/prometheus_metrics_finder.rb
app/finders/prometheus_metrics_finder.rb
+1
-3
app/finders/protected_branches_finder.rb
app/finders/protected_branches_finder.rb
+1
-3
app/finders/releases_finder.rb
app/finders/releases_finder.rb
+1
-2
app/finders/tags_finder.rb
app/finders/tags_finder.rb
+1
-2
app/finders/users_star_projects_finder.rb
app/finders/users_star_projects_finder.rb
+1
-3
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-3
app/helpers/git_helper.rb
app/helpers/git_helper.rb
+1
-2
app/models/ci/build_dependencies.rb
app/models/ci/build_dependencies.rb
+1
-2
app/services/merge_requests/add_context_service.rb
app/services/merge_requests/add_context_service.rb
+1
-3
app/services/resource_events/base_synthetic_notes_builder_service.rb
...s/resource_events/base_synthetic_notes_builder_service.rb
+1
-3
app/workers/irker_worker.rb
app/workers/irker_worker.rb
+1
-2
changelogs/unreleased/pl-rubocop-todo-redundant-assignment.yml
...elogs/unreleased/pl-rubocop-todo-redundant-assignment.yml
+5
-0
config/initializers/hangouts_chat_http_override.rb
config/initializers/hangouts_chat_http_override.rb
+1
-2
ee/app/controllers/ee/projects/merge_requests/application_controller.rb
...lers/ee/projects/merge_requests/application_controller.rb
+1
-3
ee/app/controllers/registrations/projects_controller.rb
ee/app/controllers/registrations/projects_controller.rb
+1
-3
ee/app/finders/dast_scanner_profiles_finder.rb
ee/app/finders/dast_scanner_profiles_finder.rb
+1
-2
ee/app/finders/dast_site_profiles_finder.rb
ee/app/finders/dast_site_profiles_finder.rb
+1
-2
ee/app/finders/ee/ci/daily_build_group_report_results_finder.rb
.../finders/ee/ci/daily_build_group_report_results_finder.rb
+2
-4
ee/app/finders/ee/group_projects_finder.rb
ee/app/finders/ee/group_projects_finder.rb
+1
-2
ee/app/finders/ee/merge_requests_finder.rb
ee/app/finders/ee/merge_requests_finder.rb
+1
-3
ee/app/finders/ee/namespaces/projects_finder.rb
ee/app/finders/ee/namespaces/projects_finder.rb
+1
-2
ee/app/finders/ee/projects_finder.rb
ee/app/finders/ee/projects_finder.rb
+1
-2
ee/app/finders/incident_management/oncall_rotations_finder.rb
...pp/finders/incident_management/oncall_rotations_finder.rb
+1
-3
ee/app/finders/incident_management/oncall_schedules_finder.rb
...pp/finders/incident_management/oncall_schedules_finder.rb
+1
-3
ee/app/finders/status_page/incident_comments_finder.rb
ee/app/finders/status_page/incident_comments_finder.rb
+1
-2
ee/app/helpers/ee/application_helper.rb
ee/app/helpers/ee/application_helper.rb
+1
-3
ee/app/helpers/ee/labels_helper.rb
ee/app/helpers/ee/labels_helper.rb
+1
-3
ee/app/services/dashboard/projects/list_service.rb
ee/app/services/dashboard/projects/list_service.rb
+1
-3
ee/app/services/security/dependency_list_service.rb
ee/app/services/security/dependency_list_service.rb
+1
-2
ee/lib/gitlab/database/load_balancing/connection_proxy.rb
ee/lib/gitlab/database/load_balancing/connection_proxy.rb
+1
-3
ee/spec/migrations/backfill_operations_feature_flags_iid_spec.rb
.../migrations/backfill_operations_feature_flags_iid_spec.rb
+1
-3
ee/spec/services/feature_flag_issues/destroy_service_spec.rb
ee/spec/services/feature_flag_issues/destroy_service_spec.rb
+1
-3
lib/api/groups.rb
lib/api/groups.rb
+1
-3
lib/api/helpers/packages/conan/api_helpers.rb
lib/api/helpers/packages/conan/api_helpers.rb
+1
-3
lib/error_tracking/sentry_client/issue.rb
lib/error_tracking/sentry_client/issue.rb
+1
-3
lib/gitlab/ci/config.rb
lib/gitlab/ci/config.rb
+1
-3
lib/gitlab/crypto_helper.rb
lib/gitlab/crypto_helper.rb
+1
-2
lib/gitlab/data_builder/build.rb
lib/gitlab/data_builder/build.rb
+1
-3
lib/gitlab/fogbugz_import/importer.rb
lib/gitlab/fogbugz_import/importer.rb
+2
-4
lib/gitlab/git/diff_collection.rb
lib/gitlab/git/diff_collection.rb
+1
-2
lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition.rb
...raphql/pagination/keyset/conditions/not_null_condition.rb
+1
-3
lib/gitlab/graphql/pagination/keyset/conditions/null_condition.rb
...ab/graphql/pagination/keyset/conditions/null_condition.rb
+1
-3
lib/gitlab/graphql/queries.rb
lib/gitlab/graphql/queries.rb
+1
-3
lib/gitlab/metrics/dashboard/stages/grafana_formatter.rb
lib/gitlab/metrics/dashboard/stages/grafana_formatter.rb
+2
-6
lib/gitlab/slug/environment.rb
lib/gitlab/slug/environment.rb
+7
-10
qa/qa/flow/saml.rb
qa/qa/flow/saml.rb
+1
-3
scripts/gitaly_test.rb
scripts/gitaly_test.rb
+1
-3
spec/lib/gitlab/database/migration_helpers_spec.rb
spec/lib/gitlab/database/migration_helpers_spec.rb
+1
-3
spec/migrations/backfill_operations_feature_flags_active_spec.rb
...grations/backfill_operations_feature_flags_active_spec.rb
+1
-3
spec/migrations/backfill_operations_feature_flags_iid_spec.rb
.../migrations/backfill_operations_feature_flags_iid_spec.rb
+1
-3
spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb
...ons/delete_internal_ids_where_feature_flags_usage_spec.rb
+1
-3
spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb
.../migrate_ops_feature_flags_scopes_target_user_ids_spec.rb
+1
-3
No files found.
.rubocop_todo.yml
View file @
40c8a21c
...
...
@@ -864,11 +864,6 @@ Style/RaiseArgs:
Enabled
:
false
EnforcedStyle
:
exploded
# Offense count: 73
# Cop supports --auto-correct.
Style/RedundantAssignment
:
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantBegin
:
...
...
app/finders/award_emojis_finder.rb
View file @
40c8a21c
...
...
@@ -13,8 +13,7 @@ class AwardEmojisFinder
def
execute
awards
=
awardable
.
award_emoji
awards
=
by_name
(
awards
)
awards
=
by_awarded_by
(
awards
)
awards
by_awarded_by
(
awards
)
end
private
...
...
app/finders/branches_finder.rb
View file @
40c8a21c
...
...
@@ -11,8 +11,7 @@ class BranchesFinder < GitRefsFinder
else
branches
=
repository
.
branches_sorted_by
(
sort
)
branches
=
by_search
(
branches
)
branches
=
by_names
(
branches
)
branches
by_names
(
branches
)
end
end
...
...
app/finders/ci/daily_build_group_report_results_finder.rb
View file @
40c8a21c
...
...
@@ -35,8 +35,7 @@ module Ci
return
Ci
::
DailyBuildGroupReportResult
.
none
unless
query_allowed?
collection
=
Ci
::
DailyBuildGroupReportResult
.
by_projects
(
params
[
:project
])
collection
=
filter_report_results
(
collection
)
collection
filter_report_results
(
collection
)
end
private
...
...
@@ -51,8 +50,7 @@ module Ci
collection
=
by_dates
(
collection
)
collection
=
sort
(
collection
)
collection
=
limit_by
(
collection
)
collection
limit_by
(
collection
)
end
def
by_coverage
(
items
)
...
...
app/finders/ci/variables_finder.rb
View file @
40c8a21c
...
...
@@ -11,8 +11,7 @@ module Ci
def
execute
variables
=
resource
.
variables
variables
=
by_key
(
variables
)
variables
=
by_environment_scope
(
variables
)
variables
by_environment_scope
(
variables
)
end
private
...
...
app/finders/context_commits_finder.rb
View file @
40c8a21c
...
...
@@ -11,9 +11,7 @@ class ContextCommitsFinder
def
execute
commits
=
init_collection
commits
=
filter_existing_commits
(
commits
)
commits
filter_existing_commits
(
commits
)
end
private
...
...
@@ -21,19 +19,15 @@ class ContextCommitsFinder
attr_reader
:project
,
:merge_request
,
:search
,
:limit
,
:offset
def
init_collection
commits
=
if
search
.
present?
search_commits
else
project
.
repository
.
commits
(
merge_request
.
target_branch
,
{
limit:
limit
,
offset:
offset
})
end
commits
end
def
filter_existing_commits
(
commits
)
commits
.
select!
{
|
commit
|
already_included_ids
.
exclude?
(
commit
.
id
)
}
commits
end
...
...
app/finders/deployments_finder.rb
View file @
40c8a21c
...
...
@@ -33,9 +33,7 @@ class DeploymentsFinder
items
=
by_environment
(
items
)
items
=
by_status
(
items
)
items
=
preload_associations
(
items
)
items
=
sort
(
items
)
items
sort
(
items
)
end
private
...
...
app/finders/environments_finder.rb
View file @
40c8a21c
...
...
@@ -15,9 +15,7 @@ class EnvironmentsFinder
environments
=
by_search
(
environments
)
# Raises InvalidStatesError if params[:states] contains invalid states.
environments
=
by_states
(
environments
)
environments
by_states
(
environments
)
end
private
...
...
app/finders/group_projects_finder.rb
View file @
40c8a21c
...
...
@@ -48,8 +48,7 @@ class GroupProjectsFinder < ProjectsFinder
def
filter_projects
(
collection
)
projects
=
super
projects
=
by_feature_availability
(
projects
)
projects
by_feature_availability
(
projects
)
end
def
limit
(
collection
)
...
...
app/finders/issuable_finder.rb
View file @
40c8a21c
...
...
@@ -119,9 +119,7 @@ class IssuableFinder
# https://www.postgresql.org/docs/current/static/queries-with.html
items
=
by_search
(
items
)
items
=
sort
(
items
)
items
sort
(
items
)
end
def
filter_items
(
items
)
...
...
app/finders/issues_finder.rb
View file @
40c8a21c
...
...
@@ -81,8 +81,7 @@ class IssuesFinder < IssuableFinder
issues
=
super
issues
=
by_due_date
(
issues
)
issues
=
by_confidential
(
issues
)
issues
=
by_issue_types
(
issues
)
issues
by_issue_types
(
issues
)
end
def
by_confidential
(
items
)
...
...
app/finders/merge_request/metrics_finder.rb
View file @
40c8a21c
...
...
@@ -14,9 +14,7 @@ class MergeRequest::MetricsFinder
items
=
init_collection
items
=
by_target_project
(
items
)
items
=
by_merged_after
(
items
)
items
=
by_merged_before
(
items
)
items
by_merged_before
(
items
)
end
private
...
...
app/finders/namespaces/projects_finder.rb
View file @
40c8a21c
...
...
@@ -39,8 +39,7 @@ module Namespaces
def
filter_projects
(
collection
)
collection
=
by_ids
(
collection
)
collection
=
by_similarity
(
collection
)
collection
by_similarity
(
collection
)
end
def
by_ids
(
items
)
...
...
app/finders/packages/conan/package_file_finder.rb
View file @
40c8a21c
...
...
@@ -8,8 +8,7 @@ module Packages
def
package_files
files
=
super
files
=
by_conan_file_type
(
files
)
files
=
by_conan_package_reference
(
files
)
files
by_conan_package_reference
(
files
)
end
def
by_conan_file_type
(
files
)
...
...
app/finders/packages/debian/distributions_finder.rb
View file @
40c8a21c
...
...
@@ -11,8 +11,7 @@ module Packages
collection
=
relation
.
with_container
(
container
)
collection
=
by_codename
(
collection
)
collection
=
by_suite
(
collection
)
collection
=
by_codename_or_suite
(
collection
)
collection
by_codename_or_suite
(
collection
)
end
private
...
...
app/finders/packages/group_packages_finder.rb
View file @
40c8a21c
...
...
@@ -32,8 +32,7 @@ module Packages
packages
=
filter_with_version
(
packages
)
packages
=
filter_by_package_type
(
packages
)
packages
=
filter_by_package_name
(
packages
)
packages
=
filter_by_status
(
packages
)
packages
filter_by_status
(
packages
)
end
def
group_projects_visible_to_current_user
...
...
app/finders/packages/package_file_finder.rb
View file @
40c8a21c
...
...
@@ -21,9 +21,7 @@ class Packages::PackageFileFinder
def
package_files
files
=
package
.
package_files
files
=
by_file_name
(
files
)
files
by_file_name
(
files
)
end
def
by_file_name
(
files
)
...
...
app/finders/packages/packages_finder.rb
View file @
40c8a21c
...
...
@@ -22,8 +22,7 @@ module Packages
packages
=
filter_by_package_type
(
packages
)
packages
=
filter_by_package_name
(
packages
)
packages
=
filter_by_status
(
packages
)
packages
=
order_packages
(
packages
)
packages
order_packages
(
packages
)
end
private
...
...
app/finders/pending_todos_finder.rb
View file @
40c8a21c
...
...
@@ -26,9 +26,7 @@ class PendingTodosFinder
todos
=
by_project
(
todos
)
todos
=
by_target_id
(
todos
)
todos
=
by_target_type
(
todos
)
todos
=
by_commit_id
(
todos
)
todos
by_commit_id
(
todos
)
end
def
by_project
(
todos
)
...
...
app/finders/projects/export_job_finder.rb
View file @
40c8a21c
...
...
@@ -12,9 +12,7 @@ module Projects
def
execute
export_jobs
=
project
.
export_jobs
export_jobs
=
by_status
(
export_jobs
)
export_jobs
by_status
(
export_jobs
)
end
private
...
...
app/finders/projects/prometheus/alerts_finder.rb
View file @
40c8a21c
...
...
@@ -30,9 +30,7 @@ module Projects
relation
=
by_environment
(
relation
)
relation
=
by_metric
(
relation
)
relation
=
by_id
(
relation
)
relation
=
ordered
(
relation
)
relation
ordered
(
relation
)
end
private
...
...
app/finders/projects_finder.rb
View file @
40c8a21c
...
...
@@ -83,8 +83,7 @@ class ProjectsFinder < UnionFinder
collection
=
by_deleted_status
(
collection
)
collection
=
by_last_activity_after
(
collection
)
collection
=
by_last_activity_before
(
collection
)
collection
=
by_repository_storage
(
collection
)
collection
by_repository_storage
(
collection
)
end
def
collection_with_user
...
...
app/finders/prometheus_metrics_finder.rb
View file @
40c8a21c
...
...
@@ -36,9 +36,7 @@ class PrometheusMetricsFinder
metrics
=
by_common
(
metrics
)
metrics
=
by_ordered
(
metrics
)
metrics
=
by_identifier
(
metrics
)
metrics
=
by_id
(
metrics
)
metrics
by_id
(
metrics
)
end
private
...
...
app/finders/protected_branches_finder.rb
View file @
40c8a21c
...
...
@@ -20,9 +20,7 @@ class ProtectedBranchesFinder
def
execute
protected_branches
=
project
.
limited_protected_branches
(
LIMIT
)
protected_branches
=
by_name
(
protected_branches
)
protected_branches
by_name
(
protected_branches
)
end
private
...
...
app/finders/releases_finder.rb
View file @
40c8a21c
...
...
@@ -20,8 +20,7 @@ class ReleasesFinder
releases
=
get_releases
releases
=
by_tag
(
releases
)
releases
=
releases
.
preloaded
if
preload
releases
=
order_releases
(
releases
)
releases
order_releases
(
releases
)
end
private
...
...
app/finders/tags_finder.rb
View file @
40c8a21c
...
...
@@ -7,7 +7,6 @@ class TagsFinder < GitRefsFinder
def
execute
tags
=
repository
.
tags_sorted_by
(
sort
)
tags
=
by_search
(
tags
)
tags
by_search
(
tags
)
end
end
app/finders/users_star_projects_finder.rb
View file @
40c8a21c
...
...
@@ -15,9 +15,7 @@ class UsersStarProjectsFinder
stars
=
UsersStarProject
.
all
stars
=
by_project
(
stars
)
stars
=
by_search
(
stars
)
stars
=
filter_visible_profiles
(
stars
)
stars
filter_visible_profiles
(
stars
)
end
private
...
...
app/helpers/application_helper.rb
View file @
40c8a21c
...
...
@@ -165,7 +165,7 @@ module ApplicationHelper
css_classes
=
[
short_format
?
'js-short-timeago'
:
'js-timeago'
]
css_classes
<<
html_class
unless
html_class
.
blank?
element
=
content_tag
:time
,
l
(
time
,
format:
"%b %d, %Y"
),
content_tag
:time
,
l
(
time
,
format:
"%b %d, %Y"
),
class:
css_classes
.
join
(
' '
),
title:
l
(
time
.
to_time
.
in_time_zone
,
format: :timeago_tooltip
),
datetime:
time
.
to_time
.
getutc
.
iso8601
,
...
...
@@ -174,8 +174,6 @@ module ApplicationHelper
placement:
placement
,
container:
'body'
}
element
end
def
edited_time_ago_with_tooltip
(
object
,
placement:
'top'
,
html_class:
'time_ago'
,
exclude_author:
false
)
...
...
app/helpers/git_helper.rb
View file @
40c8a21c
...
...
@@ -4,8 +4,7 @@ module GitHelper
def
strip_signature
(
text
)
text
=
text
.
gsub
(
/-----BEGIN PGP SIGNATURE-----(.*)-----END PGP SIGNATURE-----/m
,
""
)
text
=
text
.
gsub
(
/-----BEGIN PGP MESSAGE-----(.*)-----END PGP MESSAGE-----/m
,
""
)
text
=
text
.
gsub
(
/-----BEGIN SIGNED MESSAGE-----(.*)-----END SIGNED MESSAGE-----/m
,
""
)
text
text
.
gsub
(
/-----BEGIN SIGNED MESSAGE-----(.*)-----END SIGNED MESSAGE-----/m
,
""
)
end
def
short_sha
(
text
)
...
...
app/models/ci/build_dependencies.rb
View file @
40c8a21c
...
...
@@ -21,8 +21,7 @@ module Ci
deps
=
model_class
.
where
(
pipeline_id:
processable
.
pipeline_id
).
latest
deps
=
from_previous_stages
(
deps
)
deps
=
from_needs
(
deps
)
deps
=
from_dependencies
(
deps
)
deps
from_dependencies
(
deps
)
end
# Dependencies from the same parent-pipeline hierarchy excluding
...
...
app/services/merge_requests/add_context_service.rb
View file @
40c8a21c
...
...
@@ -49,11 +49,9 @@ module MergeRequests
def
duplicates
existing_oids
=
merge_request
.
merge_request_context_commits
.
map
{
|
commit
|
commit
.
sha
.
to_s
}
duplicate_oids
=
existing_oids
.
select
do
|
existing_oid
|
existing_oids
.
select
do
|
existing_oid
|
commit_ids
.
select
{
|
commit_id
|
existing_oid
.
start_with?
(
commit_id
)
}.
count
>
0
end
duplicate_oids
end
def
build_context_commit_rows
(
merge_request_id
,
commits
)
...
...
app/services/resource_events/base_synthetic_notes_builder_service.rb
View file @
40c8a21c
...
...
@@ -25,9 +25,7 @@ module ResourceEvents
def
apply_common_filters
(
events
)
events
=
apply_last_fetched_at
(
events
)
events
=
apply_fetch_until
(
events
)
events
apply_fetch_until
(
events
)
end
def
apply_last_fetched_at
(
events
)
...
...
app/workers/irker_worker.rb
View file @
40c8a21c
...
...
@@ -147,8 +147,7 @@ class IrkerWorker # rubocop:disable Scalability/IdempotentWorker
def
files_count
(
commit
)
diff_size
=
commit
.
raw_deltas
.
size
files
=
"
#{
diff_size
}
file"
.
pluralize
(
diff_size
)
files
"
#{
diff_size
}
file"
.
pluralize
(
diff_size
)
end
def
colorize_sha
(
sha
)
...
...
changelogs/unreleased/pl-rubocop-todo-redundant-assignment.yml
0 → 100644
View file @
40c8a21c
---
title
:
Resolves offenses Style/RedundantAssignment
merge_request
:
58013
author
:
Shubham Kumar (@imskr)
type
:
fixed
config/initializers/hangouts_chat_http_override.rb
View file @
40c8a21c
...
...
@@ -17,9 +17,8 @@ module HangoutsChat
headers:
{
'Content-Type'
=>
'application/json'
},
parse:
nil
# disables automatic response parsing
)
net_http_response
=
httparty_response
.
response
httparty_response
.
response
# The rest of the integration expects a Net::HTTP response
net_http_response
end
end
...
...
ee/app/controllers/ee/projects/merge_requests/application_controller.rb
View file @
40c8a21c
...
...
@@ -22,7 +22,7 @@ module EE
end
def
merge_request_params_attributes
attrs
=
super
.
push
(
super
.
push
(
{
blocking_merge_request_references:
[]
},
:update_blocking_merge_request_refs
,
:remove_hidden_blocking_merge_requests
,
...
...
@@ -32,8 +32,6 @@ module EE
:approver_ids
,
:reset_approval_rules_to_defaults
)
attrs
end
def
approval_rule_attributes
...
...
ee/app/controllers/registrations/projects_controller.rb
View file @
40c8a21c
...
...
@@ -54,7 +54,7 @@ module Registrations
end
def
create_learn_gitlab_project
learn_gitlab_project
=
File
.
open
(
learn_gitlab_template_path
)
do
|
archive
|
File
.
open
(
learn_gitlab_template_path
)
do
|
archive
|
::
Projects
::
GitlabProjectsImportService
.
new
(
current_user
,
namespace_id:
@project
.
namespace_id
,
...
...
@@ -62,8 +62,6 @@ module Registrations
name:
learn_gitlab_project_name
).
execute
end
learn_gitlab_project
end
def
authorize_create_project!
...
...
ee/app/finders/dast_scanner_profiles_finder.rb
View file @
40c8a21c
...
...
@@ -9,8 +9,7 @@ class DastScannerProfilesFinder
relation
=
DastScannerProfile
.
all
relation
=
by_id
(
relation
)
relation
=
by_project
(
relation
)
relation
=
by_name
(
relation
)
relation
by_name
(
relation
)
end
private
...
...
ee/app/finders/dast_site_profiles_finder.rb
View file @
40c8a21c
...
...
@@ -9,8 +9,7 @@ class DastSiteProfilesFinder
relation
=
DastSiteProfile
.
with_dast_site_and_validation
relation
=
by_id
(
relation
)
relation
=
by_project
(
relation
)
relation
=
by_name
(
relation
)
relation
by_name
(
relation
)
end
private
...
...
ee/app/finders/ee/ci/daily_build_group_report_results_finder.rb
View file @
40c8a21c
...
...
@@ -20,8 +20,7 @@ module EE
return
::
Ci
::
DailyBuildGroupReportResult
.
none
unless
query_allowed?
collection
=
::
Ci
::
DailyBuildGroupReportResult
.
by_group
(
params
[
:group
])
collection
=
filter_report_results
(
collection
)
collection
filter_report_results
(
collection
)
end
private
...
...
@@ -29,8 +28,7 @@ module EE
override
:filter_report_results
def
filter_report_results
(
collection
)
collection
=
super
(
collection
)
collection
=
by_activity_per_group
(
collection
)
collection
by_activity_per_group
(
collection
)
end
def
by_activity_per_group
(
items
)
...
...
ee/app/finders/ee/group_projects_finder.rb
View file @
40c8a21c
...
...
@@ -14,8 +14,7 @@ module EE
override
:filter_projects
def
filter_projects
(
collection
)
collection
=
super
(
collection
)
collection
=
by_security_reports_presence
(
collection
)
collection
by_security_reports_presence
(
collection
)
end
def
by_security_reports_presence
(
collection
)
...
...
ee/app/finders/ee/merge_requests_finder.rb
View file @
40c8a21c
...
...
@@ -9,9 +9,7 @@ module EE
def
filter_items
(
items
)
items
=
super
(
items
)
items
=
by_approvers
(
items
)
items
=
by_merge_commit_sha
(
items
)
items
by_merge_commit_sha
(
items
)
end
# Filter by merge requests approval list that contains specified user directly or as part of group membership
...
...
ee/app/finders/ee/namespaces/projects_finder.rb
View file @
40c8a21c
...
...
@@ -21,8 +21,7 @@ module EE
collection
=
super
(
collection
)
collection
=
with_vulnerabilities
(
collection
)
collection
=
with_code_coverage
(
collection
)
collection
=
by_storage
(
collection
)
collection
by_storage
(
collection
)
end
def
by_storage
(
items
)
...
...
ee/app/finders/ee/projects_finder.rb
View file @
40c8a21c
...
...
@@ -17,8 +17,7 @@ module EE
def
filter_projects
(
collection
)
collection
=
super
(
collection
)
collection
=
by_plans
(
collection
)
collection
=
by_aimed_for_deletion
(
collection
)
collection
by_aimed_for_deletion
(
collection
)
end
def
by_plans
(
collection
)
...
...
ee/app/finders/incident_management/oncall_rotations_finder.rb
View file @
40c8a21c
...
...
@@ -13,9 +13,7 @@ module IncidentManagement
return
IncidentManagement
::
OncallRotation
.
none
unless
schedule
&&
allowed?
collection
=
schedule
.
rotations
collection
=
by_id
(
collection
)
collection
by_id
(
collection
)
end
private
...
...
ee/app/finders/incident_management/oncall_schedules_finder.rb
View file @
40c8a21c
...
...
@@ -12,9 +12,7 @@ module IncidentManagement
return
IncidentManagement
::
OncallSchedule
.
none
unless
allowed?
collection
=
project
.
incident_management_oncall_schedules
collection
=
by_iid
(
collection
)
collection
by_iid
(
collection
)
end
private
...
...
ee/app/finders/status_page/incident_comments_finder.rb
View file @
40c8a21c
...
...
@@ -37,8 +37,7 @@ module StatusPage
notes
=
init_collection
notes
=
only_user
(
notes
)
notes
=
to_publish
(
notes
)
notes
=
chronological
(
notes
)
notes
chronological
(
notes
)
end
def
init_collection
...
...
ee/app/helpers/ee/application_helper.rb
View file @
40c8a21c
...
...
@@ -20,14 +20,12 @@ module EE
end
def
maintenance_mode_message
html
=
tag
.
div
do
tag
.
div
do
tag
.
p
(
class:
'gl-mb-3'
)
do
concat
(
sprite_icon
(
'information-o'
,
css_class:
'gl-icon gl-mr-3'
))
concat
(
custom_maintenance_mode_message
)
end
end
html
end
def
geo_secondary_read_only_message
...
...
ee/app/helpers/ee/labels_helper.rb
View file @
40c8a21c
...
...
@@ -30,9 +30,7 @@ module EE
border_width
=
small
?
'1px'
:
'2px'
html
=
%(<span class="#{wrapper_classes.join(' ')}" style="--label-inset-border: inset 0 0 0 #{border_width} #{label.color}; color: #{label.color}">#{label_html}</span>)
.
html_safe
html
%(<span class="#{wrapper_classes.join(' ')}" style="--label-inset-border: inset 0 0 0 #{border_width} #{label.color}; color: #{label.color}">#{label_html}</span>)
.
html_safe
end
def
label_tooltip_title
(
label
)
...
...
ee/app/services/dashboard/projects/list_service.rb
View file @
40c8a21c
...
...
@@ -14,9 +14,7 @@ module Dashboard
return
Project
.
none
unless
License
.
feature_available?
(
feature
)
project_ids
=
available_project_ids
(
project_ids
)
unless
include_unavailable
projects
=
find_projects
(
project_ids
)
projects
find_projects
(
project_ids
)
end
private
...
...
ee/app/services/security/dependency_list_service.rb
View file @
40c8a21c
...
...
@@ -23,8 +23,7 @@ module Security
collection
=
init_collection
collection
=
filter_by_package_manager
(
collection
)
collection
=
filter_by_vulnerable
(
collection
)
collection
=
sort
(
collection
)
collection
sort
(
collection
)
end
private
...
...
ee/lib/gitlab/database/load_balancing/connection_proxy.rb
View file @
40c8a21c
...
...
@@ -106,7 +106,7 @@ module Gitlab
raise
WriteInsideReadOnlyTransactionError
,
'A write query is performed inside a read-only transaction'
end
result
=
@load_balancer
.
read_write
do
|
connection
|
@load_balancer
.
read_write
do
|
connection
|
# Sticking has to be enabled before calling the method. Not doing so
# could lead to methods called in a block still being performed on a
# secondary instead of on a primary (when necessary).
...
...
@@ -114,8 +114,6 @@ module Gitlab
connection
.
send
(
name
,
*
args
,
&
block
)
end
result
end
private
...
...
ee/spec/migrations/backfill_operations_feature_flags_iid_spec.rb
View file @
40c8a21c
...
...
@@ -13,9 +13,7 @@ RSpec.describe BackfillOperationsFeatureFlagsIid do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
project
projects
.
create!
(
namespace_id:
namespace
.
id
)
end
it
'backfills the iid for a flag'
do
...
...
ee/spec/services/feature_flag_issues/destroy_service_spec.rb
View file @
40c8a21c
...
...
@@ -19,9 +19,7 @@ RSpec.describe FeatureFlagIssues::DestroyService do
def
setup
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
issue
=
create
(
:issue
,
project:
project
)
feature_flag_issue
=
create
(
:feature_flag_issue
,
feature_flag:
feature_flag
,
issue:
issue
)
feature_flag_issue
create
(
:feature_flag_issue
,
feature_flag:
feature_flag
,
issue:
issue
)
end
describe
'#execute'
do
...
...
lib/api/groups.rb
View file @
40c8a21c
...
...
@@ -52,9 +52,7 @@ module API
groups
=
groups
.
where
.
not
(
id:
params
[
:skip_groups
])
if
params
[
:skip_groups
].
present?
order_options
=
{
params
[
:order_by
]
=>
params
[
:sort
]
}
order_options
[
"id"
]
||=
"asc"
groups
=
groups
.
reorder
(
order_options
)
groups
groups
.
reorder
(
order_options
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
lib/api/helpers/packages/conan/api_helpers.rb
View file @
40c8a21c
...
...
@@ -209,10 +209,8 @@ module API
end
def
find_personal_access_token
personal_access_token
=
find_personal_access_token_from_conan_jwt
||
find_personal_access_token_from_conan_jwt
||
find_personal_access_token_from_http_basic_auth
personal_access_token
end
def
find_user_from_job_token
...
...
lib/error_tracking/sentry_client/issue.rb
View file @
40c8a21c
...
...
@@ -113,9 +113,7 @@ module ErrorTracking
uri
=
URI
(
url
)
uri
.
path
.
squeeze!
(
'/'
)
# Remove trailing slash
uri
=
uri
.
to_s
.
delete_suffix
(
'/'
)
uri
uri
.
to_s
.
delete_suffix
(
'/'
)
end
def
map_to_errors
(
issues
)
...
...
lib/gitlab/ci/config.rb
View file @
40c8a21c
...
...
@@ -96,9 +96,7 @@ module Gitlab
initial_config
=
Config
::
External
::
Processor
.
new
(
initial_config
,
@context
).
perform
initial_config
=
Config
::
Extendable
.
new
(
initial_config
).
to_hash
initial_config
=
Config
::
Yaml
::
Tags
::
Resolver
.
new
(
initial_config
).
to_hash
initial_config
=
Config
::
EdgeStagesInjector
.
new
(
initial_config
).
to_hash
initial_config
Config
::
EdgeStagesInjector
.
new
(
initial_config
).
to_hash
end
def
find_sha
(
project
)
...
...
lib/gitlab/crypto_helper.rb
View file @
40c8a21c
...
...
@@ -25,8 +25,7 @@ module Gitlab
return
unless
value
encrypted_token
=
Base64
.
decode64
(
value
)
decrypted_token
=
Encryptor
.
decrypt
(
AES256_GCM_OPTIONS
.
merge
(
value:
encrypted_token
,
iv:
nonce
))
decrypted_token
Encryptor
.
decrypt
(
AES256_GCM_OPTIONS
.
merge
(
value:
encrypted_token
,
iv:
nonce
))
end
end
end
lib/gitlab/data_builder/build.rb
View file @
40c8a21c
...
...
@@ -12,7 +12,7 @@ module Gitlab
author_url
=
build_author_url
(
build
.
commit
,
commit
)
data
=
{
{
object_kind:
'build'
,
ref:
build
.
ref
,
...
...
@@ -67,8 +67,6 @@ module Gitlab
environment:
build_environment
(
build
)
}
data
end
private
...
...
lib/gitlab/fogbugz_import/importer.rb
View file @
40c8a21c
...
...
@@ -199,8 +199,7 @@ module Gitlab
def
linkify_issues
(
str
)
str
=
str
.
gsub
(
/([Ii]ssue) ([0-9]+)/
,
'\1 #\2'
)
str
=
str
.
gsub
(
/([Cc]ase) ([0-9]+)/
,
'\1 #\2'
)
str
str
.
gsub
(
/([Cc]ase) ([0-9]+)/
,
'\1 #\2'
)
end
def
escape_for_markdown
(
str
)
...
...
@@ -208,8 +207,7 @@ module Gitlab
str
=
str
.
gsub
(
/^-/
,
"
\\
-"
)
str
=
str
.
gsub
(
"`"
,
"
\\
~"
)
str
=
str
.
delete
(
"
\r
"
)
str
=
str
.
gsub
(
"
\n
"
,
"
\n
"
)
str
str
.
gsub
(
"
\n
"
,
"
\n
"
)
end
def
format_content
(
raw_content
)
...
...
lib/gitlab/git/diff_collection.rb
View file @
40c8a21c
...
...
@@ -127,10 +127,9 @@ module Gitlab
end
def
decorate!
collection
=
each_with_index
do
|
element
,
i
|
each_with_index
do
|
element
,
i
|
@array
[
i
]
=
yield
(
element
)
end
collection
end
alias_method
:to_ary
,
:to_a
...
...
lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition.rb
View file @
40c8a21c
...
...
@@ -30,15 +30,13 @@ module Gitlab
# ex: " OR (relative_position = 23 AND id > 500)"
def
second_attribute_condition
condition
=
<<~
SQL
<<~
SQL
OR (
#{
table_condition
(
order_list
.
first
,
values
.
first
,
'='
).
to_sql
}
AND
#{
table_condition
(
order_list
[
1
],
values
[
1
],
operators
[
1
]).
to_sql
}
)
SQL
condition
end
# ex: " OR (relative_position IS NULL)"
...
...
lib/gitlab/graphql/pagination/keyset/conditions/null_condition.rb
View file @
40c8a21c
...
...
@@ -14,15 +14,13 @@ module Gitlab
# ex: "(relative_position IS NULL AND id > 500)"
def
first_attribute_condition
condition
=
<<~
SQL
<<~
SQL
(
#{
table_condition
(
order_list
.
first
,
nil
,
'is_null'
).
to_sql
}
AND
#{
table_condition
(
order_list
[
1
],
values
[
1
],
operators
[
1
]).
to_sql
}
)
SQL
condition
end
# ex: " OR (relative_position IS NOT NULL)"
...
...
lib/gitlab/graphql/queries.rb
View file @
40c8a21c
...
...
@@ -224,11 +224,9 @@ module Gitlab
frag_path
=
frag_path
.
gsub
(
DOTS_RE
)
do
|
dots
|
rel_dir
(
dots
.
split
(
'/'
).
count
)
end
frag_path
=
frag_path
.
gsub
(
IMPLICIT_ROOT
)
do
frag_path
.
gsub
(
IMPLICIT_ROOT
)
do
(
Rails
.
root
/
'app'
).
to_s
+
'/'
end
frag_path
end
def
rel_dir
(
n_steps_up
)
...
...
lib/gitlab/metrics/dashboard/stages/grafana_formatter.rb
View file @
40c8a21c
...
...
@@ -104,9 +104,7 @@ module Gitlab
def
format_query
(
metric
)
expression
=
remove_new_lines
(
metric
[
:expr
])
expression
=
replace_variables
(
expression
)
expression
=
replace_global_variables
(
expression
,
metric
)
expression
replace_global_variables
(
expression
,
metric
)
end
# Accomodates instance-defined Grafana variables.
...
...
@@ -135,9 +133,7 @@ module Gitlab
def
replace_global_variables
(
expression
,
metric
)
expression
=
expression
.
gsub
(
'$__interval'
,
metric
[
:interval
])
if
metric
[
:interval
]
expression
=
expression
.
gsub
(
'$__from'
,
query_params
[
:from
])
expression
=
expression
.
gsub
(
'$__to'
,
query_params
[
:to
])
expression
expression
.
gsub
(
'$__to'
,
query_params
[
:to
])
end
# Removes new lines from expression.
...
...
lib/gitlab/slug/environment.rb
View file @
40c8a21c
...
...
@@ -26,7 +26,6 @@ module Gitlab
# Repeated dashes are invalid (OpenShift limitation)
slugified
.
squeeze!
(
'-'
)
slugified
=
if
slugified
.
size
>
24
||
slugified
!=
name
# Maximum length: 24 characters (OpenShift limitation)
shorten_and_add_suffix
(
slugified
)
...
...
@@ -34,8 +33,6 @@ module Gitlab
# Cannot end with a dash (Kubernetes label limitation)
slugified
.
chomp
(
'-'
)
end
slugified
end
private
...
...
qa/qa/flow/saml.rb
View file @
40c8a21c
...
...
@@ -53,12 +53,10 @@ module QA
end
def
run_saml_idp_service
(
group_name
)
service
=
Service
::
DockerRun
::
SamlIdp
.
new
(
Runtime
::
Scenario
.
gitlab_address
,
group_name
).
tap
do
|
runner
|
Service
::
DockerRun
::
SamlIdp
.
new
(
Runtime
::
Scenario
.
gitlab_address
,
group_name
).
tap
do
|
runner
|
runner
.
pull
runner
.
register!
end
service
end
def
remove_saml_idp_service
(
saml_idp_service
)
...
...
scripts/gitaly_test.rb
View file @
40c8a21c
...
...
@@ -43,7 +43,7 @@ module GitalyTest
end
def
env
env_hash
=
{
{
'HOME'
=>
File
.
expand_path
(
'tmp/tests'
),
'GEM_PATH'
=>
Gem
.
path
.
join
(
':'
),
'BUNDLE_APP_CONFIG'
=>
File
.
join
(
gemfile_dir
,
'.bundle'
),
...
...
@@ -54,8 +54,6 @@ module GitalyTest
# Git hooks can't run during tests as the internal API is not running.
'GITALY_TESTING_NO_GIT_HOOKS'
=>
"1"
}
env_hash
end
# rubocop:disable GitlabSecurity/SystemCommandInjection
...
...
spec/lib/gitlab/database/migration_helpers_spec.rb
View file @
40c8a21c
...
...
@@ -2016,9 +2016,7 @@ RSpec.describe Gitlab::Database::MigrationHelpers do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
project
projects
.
create!
(
namespace_id:
namespace
.
id
)
end
it
'generates iids properly for models created after the migration'
do
...
...
spec/migrations/backfill_operations_feature_flags_active_spec.rb
View file @
40c8a21c
...
...
@@ -10,9 +10,7 @@ RSpec.describe BackfillOperationsFeatureFlagsActive do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
project
projects
.
create!
(
namespace_id:
namespace
.
id
)
end
it
'executes successfully when there are no flags in the table'
do
...
...
spec/migrations/backfill_operations_feature_flags_iid_spec.rb
View file @
40c8a21c
...
...
@@ -10,9 +10,7 @@ RSpec.describe BackfillOperationsFeatureFlagsIid do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
project
projects
.
create!
(
namespace_id:
namespace
.
id
)
end
it
'migrates successfully when there are no flags in the database'
do
...
...
spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb
View file @
40c8a21c
...
...
@@ -10,9 +10,7 @@ RSpec.describe DeleteInternalIdsWhereFeatureFlagsUsage do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
project
projects
.
create!
(
namespace_id:
namespace
.
id
)
end
it
'deletes feature flag rows from the internal_ids table'
do
...
...
spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb
View file @
40c8a21c
...
...
@@ -12,9 +12,7 @@ RSpec.describe MigrateOpsFeatureFlagsScopesTargetUserIds do
def
setup
namespace
=
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
project
=
projects
.
create!
(
namespace_id:
namespace
.
id
)
flag
=
flags
.
create!
(
project_id:
project
.
id
,
active:
true
,
name:
'test_flag'
)
flag
flags
.
create!
(
project_id:
project
.
id
,
active:
true
,
name:
'test_flag'
)
end
it
'migrates successfully when there are no scopes in the database'
do
...
...
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