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