Skip to content

Commit a6898c8

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 37ccd66 commit a6898c8

28 files changed

+299
-236
lines changed

.rubocop_todo/layout/line_length.yml

-3
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@ Layout/LineLength:
564564
- 'ee/app/models/concerns/approver_migrate_hook.rb'
565565
- 'ee/app/models/concerns/ee/issuable_link.rb'
566566
- 'ee/app/models/concerns/elastic/application_versioned_search.rb'
567-
- 'ee/app/models/concerns/elastic/repositories_search.rb'
568567
- 'ee/app/models/concerns/geo/verification_state.rb'
569568
- 'ee/app/models/concerns/geo/verification_state_definition.rb'
570569
- 'ee/app/models/concerns/issue_widgets/acts_like_requirement.rb'
@@ -1422,7 +1421,6 @@ Layout/LineLength:
14221421
- 'ee/spec/models/namespace_setting_spec.rb'
14231422
- 'ee/spec/models/packages/package_file_spec.rb'
14241423
- 'ee/spec/models/project_import_data_spec.rb'
1425-
- 'ee/spec/models/project_import_state_spec.rb'
14261424
- 'ee/spec/models/protected_environment_spec.rb'
14271425
- 'ee/spec/models/protected_environments/approval_rule_spec.rb'
14281426
- 'ee/spec/models/release_highlight_spec.rb'
@@ -1687,7 +1685,6 @@ Layout/LineLength:
16871685
- 'ee/spec/services/ee/system_notes/issuables_service_spec.rb'
16881686
- 'ee/spec/services/ee/users/destroy_service_spec.rb'
16891687
- 'ee/spec/services/ee/users/update_service_spec.rb'
1690-
- 'ee/spec/services/elastic/process_initial_bookkeeping_service_spec.rb'
16911688
- 'ee/spec/services/epics/issue_promote_service_spec.rb'
16921689
- 'ee/spec/services/epics/update_service_spec.rb'
16931690
- 'ee/spec/services/external_status_checks/update_service_spec.rb'

.rubocop_todo/lint/symbol_conversion.yml

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Lint/SymbolConversion:
5353
- 'ee/spec/helpers/push_rules_helper_spec.rb'
5454
- 'ee/spec/models/concerns/elastic/repository_spec.rb'
5555
- 'ee/spec/models/plan_spec.rb'
56-
- 'ee/spec/models/project_feature_spec.rb'
5756
- 'ee/spec/requests/api/dependency_proxy/packages/npm_spec.rb'
5857
- 'ee/spec/services/phone_verification/users/send_verification_code_service_spec.rb'
5958
- 'ee/spec/support/matchers/ee/epic_aggregate_matchers.rb'

.rubocop_todo/performance/string_identifier_argument.yml

-4
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,10 @@ Performance/StringIdentifierArgument:
5858
- 'ee/spec/lib/ee/gitlab/hook_data/merge_request_builder_spec.rb'
5959
- 'ee/spec/lib/ee/sidebars/projects/menus/packages_registries_menu_spec.rb'
6060
- 'ee/spec/lib/gitlab/insights/reducers/count_per_period_reducer_spec.rb'
61-
- 'ee/spec/models/concerns/elastic/projects_search_spec.rb'
62-
- 'ee/spec/models/concerns/elastic/repositories_search_spec.rb'
6361
- 'ee/spec/models/ee/namespace_spec.rb'
6462
- 'ee/spec/models/ee/project_spec.rb'
6563
- 'ee/spec/models/gitlab_subscription_spec.rb'
6664
- 'ee/spec/models/namespace_setting_spec.rb'
67-
- 'ee/spec/models/project_feature_spec.rb'
6865
- 'ee/spec/models/project_import_data_spec.rb'
6966
- 'ee/spec/policies/audit_events/group/namespace_filter_policy_spec.rb'
7067
- 'ee/spec/policies/project_policy_spec.rb'
@@ -74,7 +71,6 @@ Performance/StringIdentifierArgument:
7471
- 'ee/spec/requests/api/issues_spec.rb'
7572
- 'ee/spec/requests/ee/omniauth_callbacks_controller_spec.rb'
7673
- 'ee/spec/services/dependency_proxy/packages/settings/update_service_spec.rb'
77-
- 'ee/spec/services/elastic/process_initial_bookkeeping_service_spec.rb'
7874
- 'ee/spec/services/vulnerabilities/manually_create_service_spec.rb'
7975
- 'ee/spec/support/helpers/search_results_helpers.rb'
8076
- 'ee/spec/support/shared_examples/features/protected_branches_access_control_shared_examples.rb'

.rubocop_todo/rspec/be_eq.yml

-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ RSpec/BeEq:
269269
- 'ee/spec/models/onboarding/progress_spec.rb'
270270
- 'ee/spec/models/onboarding_spec.rb'
271271
- 'ee/spec/models/product_analytics/funnel_spec.rb'
272-
- 'ee/spec/models/project_feature_spec.rb'
273272
- 'ee/spec/models/projects/all_protected_branches_rule_spec.rb'
274273
- 'ee/spec/models/push_rule_spec.rb'
275274
- 'ee/spec/models/requirements_management/requirement_spec.rb'

.rubocop_todo/rspec/context_wording.yml

-2
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ RSpec/ContextWording:
441441
- 'ee/spec/models/packages/package_file_spec.rb'
442442
- 'ee/spec/models/path_lock_spec.rb'
443443
- 'ee/spec/models/project_import_data_spec.rb'
444-
- 'ee/spec/models/project_import_state_spec.rb'
445444
- 'ee/spec/models/protected_environment_spec.rb'
446445
- 'ee/spec/models/push_rule_spec.rb'
447446
- 'ee/spec/models/release_highlight_spec.rb'
@@ -619,7 +618,6 @@ RSpec/ContextWording:
619618
- 'ee/spec/services/ee/boards/lists/create_service_spec.rb'
620619
- 'ee/spec/services/ee/ci/create_pipeline_service_spec.rb'
621620
- 'ee/spec/services/ee/ci/job_artifacts/destroy_batch_service_spec.rb'
622-
- 'ee/spec/services/ee/git/branch_push_service_spec.rb'
623621
- 'ee/spec/services/ee/groups/autocomplete_service_spec.rb'
624622
- 'ee/spec/services/ee/integrations/test/project_service_spec.rb'
625623
- 'ee/spec/services/ee/ip_restrictions/update_service_spec.rb'

.rubocop_todo/rspec/dialect.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ RSpec/Dialect:
1212
- 'ee/spec/models/gitlab_subscriptions/features_spec.rb'
1313
- 'ee/spec/models/license_spec.rb'
1414
- 'ee/spec/models/merge_request_spec.rb'
15-
- 'ee/spec/models/project_feature_spec.rb'
1615
- 'ee/spec/models/work_items/type_spec.rb'
1716
- 'ee/spec/policies/project_policy_spec.rb'
1817
- 'ee/spec/requests/api/epic_boards_spec.rb'

.rubocop_todo/rspec/example_without_description.yml

-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ RSpec/ExampleWithoutDescription:
174174
- 'ee/spec/services/ci/pipeline_creation/drop_secrets_provider_not_found_builds_service_spec.rb'
175175
- 'ee/spec/services/ci/register_job_service_spec.rb'
176176
- 'ee/spec/services/compliance_management/standards/soc2/at_least_one_non_author_approval_service_spec.rb'
177-
- 'ee/spec/services/ee/git/branch_push_service_spec.rb'
178177
- 'ee/spec/services/ee/issues/update_service_spec.rb'
179178
- 'ee/spec/services/ee/members/create_service_spec.rb'
180179
- 'ee/spec/services/ee/merge_requests/post_merge_service_spec.rb'
@@ -215,7 +214,6 @@ RSpec/ExampleWithoutDescription:
215214
- 'ee/spec/views/trial_registrations/new.html.haml_spec.rb'
216215
- 'ee/spec/workers/active_user_count_threshold_worker_spec.rb'
217216
- 'ee/spec/workers/compliance_management/update_default_framework_worker_spec.rb'
218-
- 'ee/spec/workers/concurrency_limit/resume_worker_spec.rb'
219217
- 'ee/spec/workers/ee/ci/build_finished_worker_spec.rb'
220218
- 'ee/spec/workers/gitlab_subscriptions/member_management/apply_pending_member_approvals_worker_spec.rb'
221219
- 'ee/spec/workers/gitlab_subscriptions/members/record_last_activity_worker_spec.rb'

.rubocop_todo/rspec/expect_change.yml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ RSpec/ExpectChange:
3030
- 'ee/spec/models/gitlab_subscription_spec.rb'
3131
- 'ee/spec/models/group_wiki_spec.rb'
3232
- 'ee/spec/models/incident_management/issuable_escalation_status_spec.rb'
33-
- 'ee/spec/models/project_import_state_spec.rb'
3433
- 'ee/spec/models/push_rule_spec.rb'
3534
- 'ee/spec/models/security/orchestration_policy_configuration_spec.rb'
3635
- 'ee/spec/models/upload_spec.rb'

.rubocop_todo/rspec/expect_in_hook.yml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ RSpec/ExpectInHook:
4040
- 'ee/spec/models/ee/project_spec.rb'
4141
- 'ee/spec/models/gitlab_subscription_spec.rb'
4242
- 'ee/spec/models/license_spec.rb'
43-
- 'ee/spec/models/project_import_state_spec.rb'
4443
- 'ee/spec/presenters/group_member_presenter_spec.rb'
4544
- 'ee/spec/requests/api/geo_spec.rb'
4645
- 'ee/spec/requests/api/internal/base_spec.rb'

.rubocop_todo/rspec/named_subject.yml

-3
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ RSpec/NamedSubject:
486486
- 'ee/spec/models/compliance_management/framework_spec.rb'
487487
- 'ee/spec/models/concerns/approval_rule_like_spec.rb'
488488
- 'ee/spec/models/concerns/ee/packages/downloadable_spec.rb'
489-
- 'ee/spec/models/concerns/elastic/projects_search_spec.rb'
490489
- 'ee/spec/models/concerns/geo/has_replicator_spec.rb'
491490
- 'ee/spec/models/concerns/geo/replicable_model_spec.rb'
492491
- 'ee/spec/models/concerns/geo/verifiable_model_spec.rb'
@@ -585,7 +584,6 @@ RSpec/NamedSubject:
585584
- 'ee/spec/models/packages/package_file_spec.rb'
586585
- 'ee/spec/models/product_analytics/dashboard_spec.rb'
587586
- 'ee/spec/models/product_analytics/visualization_spec.rb'
588-
- 'ee/spec/models/project_feature_spec.rb'
589587
- 'ee/spec/models/projects/all_protected_branches_rule_spec.rb'
590588
- 'ee/spec/models/projects/target_branch_rule_spec.rb'
591589
- 'ee/spec/models/protected_environment_spec.rb'
@@ -857,7 +855,6 @@ RSpec/NamedSubject:
857855
- 'ee/spec/services/ee/ci/job_artifacts/destroy_all_expired_service_spec.rb'
858856
- 'ee/spec/services/ee/ci/job_artifacts/destroy_batch_service_spec.rb'
859857
- 'ee/spec/services/ee/deployments/update_environment_service_spec.rb'
860-
- 'ee/spec/services/ee/git/branch_push_service_spec.rb'
861858
- 'ee/spec/services/ee/gpg_keys/create_service_spec.rb'
862859
- 'ee/spec/services/ee/gpg_keys/destroy_service_spec.rb'
863860
- 'ee/spec/services/ee/groups/autocomplete_service_spec.rb'

.rubocop_todo/rspec/receive_messages.yml

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ RSpec/ReceiveMessages:
9898
- 'ee/spec/models/merge_request_spec.rb'
9999
- 'ee/spec/models/merge_trains/train_spec.rb'
100100
- 'ee/spec/models/namespace_setting_spec.rb'
101-
- 'ee/spec/models/project_feature_spec.rb'
102101
- 'ee/spec/models/security/scan_result_policy_read_spec.rb'
103102
- 'ee/spec/policies/issue_policy_spec.rb'
104103
- 'ee/spec/presenters/ci/minutes/usage_presenter_spec.rb'

.rubocop_todo/style/redundant_self.yml

-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ Style/RedundantSelf:
167167
- 'ee/app/models/ee/issue.rb'
168168
- 'ee/app/models/ee/member.rb'
169169
- 'ee/app/models/ee/project.rb'
170-
- 'ee/app/models/ee/project_import_state.rb'
171170
- 'ee/app/models/ee/snippet_repository.rb'
172171
- 'ee/app/models/ee/user.rb'
173172
- 'ee/app/models/geo/base_registry.rb'

app/finders/autocomplete/group_users_finder.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ module Autocomplete
1212
class GroupUsersFinder
1313
include Gitlab::Utils::StrongMemoize
1414

15-
def initialize(group:)
15+
attr_reader :group, :current_user
16+
17+
def initialize(group:, current_user:)
1618
@group = group
19+
@current_user = current_user
1720
end
1821

1922
def execute
@@ -67,7 +70,7 @@ def members_from_descendant_project_shares
6770
end
6871

6972
def group_hierarchy_cte
70-
Gitlab::SQL::CTE.new(:group_hierarchy, @group.self_and_hierarchy.select(:id))
73+
Gitlab::SQL::CTE.new(:group_hierarchy, group.self_and_hierarchy.select(:id))
7174
end
7275
strong_memoize_attr :group_hierarchy_cte
7376

@@ -76,7 +79,7 @@ def group_hierarchy_ids
7679
end
7780

7881
def descendant_projects_cte
79-
Gitlab::SQL::CTE.new(:descendant_projects, @group.all_projects.select(:id))
82+
Gitlab::SQL::CTE.new(:descendant_projects, group.all_projects.select(:id))
8083
end
8184
strong_memoize_attr :descendant_projects_cte
8285

@@ -85,3 +88,5 @@ def descendant_project_ids
8588
end
8689
end
8790
end
91+
92+
Autocomplete::GroupUsersFinder.prepend_mod_with('Autocomplete::GroupUsersFinder')

app/finders/autocomplete/users_finder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def find_users
9191
if project
9292
project_users
9393
elsif group
94-
::Autocomplete::GroupUsersFinder.new(group: group).execute # rubocop: disable CodeReuse/Finder
94+
::Autocomplete::GroupUsersFinder.new(group: group, current_user: current_user).execute # rubocop: disable CodeReuse/Finder
9595
elsif current_user
9696
User.all
9797
else

app/finders/users_finder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def base_scope
6767
if group
6868
raise Gitlab::Access::AccessDeniedError unless user_can_read_group?(group)
6969

70-
scope = ::Autocomplete::GroupUsersFinder.new(group: group).execute # rubocop: disable CodeReuse/Finder -- For SQL optimization sake we need to scope out group members first see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137647#note_1664081899
70+
scope = ::Autocomplete::GroupUsersFinder.new(group: group, current_user: current_user).execute # rubocop: disable CodeReuse/Finder -- For SQL optimization sake we need to scope out group members first see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137647#note_1664081899
7171
else
7272
scope = current_user&.can_admin_all_resources? ? User.all : User.without_forbidden_states
7373
end

app/services/groups/participants_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def all_members
3030
def group_hierarchy_users
3131
return [] unless group
3232

33-
relation = Autocomplete::GroupUsersFinder.new(group: group).execute
33+
relation = Autocomplete::GroupUsersFinder.new(group: group, current_user: current_user).execute
3434

3535
filter_and_sort_users(relation)
3636
end

bin/rspec-stackprof

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ defaults = {
1616
}
1717

1818
options = {
19-
mode: ENV.fetch('MODE', defaults[:mode]) || defaults[:mode],
20-
interval: ENV['INTERVAL'],
21-
limit: ENV.fetch('LIMIT', nil) || defaults[:limit],
22-
raw: ENV.fetch('RAW', false) === 'true' || defaults[:raw],
23-
output: ENV.fetch('OUTPUT', nil),
24-
speedscope: ENV.fetch('SPEEDSCOPE', false) === 'true' || defaults[:speedscope]
19+
mode: defaults[:mode],
20+
interval: nil,
21+
limit: defaults[:limit],
22+
raw: defaults[:raw],
23+
output: nil,
24+
speedscope: defaults[:speedscope]
2525
}
2626

2727
OptionParser.new do |opt|

doc/.vale/gitlab_base/Uppercase.yml

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ exceptions:
173173
- PHP
174174
- PID
175175
- PKCS
176+
- PMD
176177
- PNG
177178
- POSIX
178179
- POST

0 commit comments

Comments
 (0)