diff --git a/.rubocop.yml b/.rubocop.yml index d814e41156bfc176a1e5cc525899bf730c734d22..9171c586b9c6216a43633b46a26560a5e7424203 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -67,6 +67,13 @@ Rails/Date: # See https://gitlab.com/gitlab-org/gitlab/-/issues/502580 - danger/database/Dangerfile +Rails/Pluck: + Exclude: + # See https://gitlab.com/gitlab-org/gitlab/-/issues/502580 + - 'tooling/danger/**/*' + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94047#note_1179689274 + AutoCorrect: false + RSpec: Language: Includes: @@ -363,9 +370,6 @@ Rails/MailerName: # See for the context on why it's excluded https://gitlab.com/gitlab-org/gitlab/-/issues/239356#note_956419227 - 'app/mailers/notify.rb' -Rails/Pluck: - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94047#note_1179689274 - AutoCorrect: false Rails/RakeEnvironment: # Context on why it's disabled: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93419#note_1048223982 diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index bd6600e325efe06b6c0d86d2247d0678cc9f94ab..a1e8a5c2f7672e788a37eb09d6cfcb4a0255fe56 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -17,6 +17,7 @@ Layout/LineLength: - 'app/controllers/concerns/issuable_collections.rb' - 'app/controllers/concerns/membership_actions.rb' - 'app/controllers/concerns/notes_actions.rb' + - 'app/controllers/groups/milestones_controller.rb' - 'app/controllers/groups_controller.rb' - 'app/controllers/import/base_controller.rb' - 'app/controllers/import/bitbucket_controller.rb' @@ -1078,6 +1079,7 @@ Layout/LineLength: - 'ee/spec/features/groups/saml_providers_spec.rb' - 'ee/spec/features/groups/scim_token_spec.rb' - 'ee/spec/features/groups/security/compliance_dashboards_spec.rb' + - 'ee/spec/features/groups/settings/domain_verification_spec.rb' - 'ee/spec/features/integrations/jira/jira_issues_list_spec.rb' - 'ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb' - 'ee/spec/features/labels_hierarchy_spec.rb' @@ -1099,6 +1101,7 @@ Layout/LineLength: - 'ee/spec/features/projects/iterations/user_views_iteration_spec.rb' - 'ee/spec/features/projects/members/member_is_removed_from_project_spec.rb' - 'ee/spec/features/projects/members/member_leaves_project_spec.rb' + - 'ee/spec/features/projects/mirror_spec.rb' - 'ee/spec/features/projects/new_project_spec.rb' - 'ee/spec/features/projects/pipelines/pipeline_spec.rb' - 'ee/spec/features/projects/quality/test_case_list_spec.rb' @@ -1254,6 +1257,7 @@ Layout/LineLength: - 'ee/spec/lib/audit/details_spec.rb' - 'ee/spec/lib/banzai/filter/jira_private_image_link_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/epic_reference_filter_spec.rb' + - 'ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/label_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/vulnerability_reference_filters_spec.rb' - 'ee/spec/lib/bulk_imports/projects/pipelines/issues_pipeline_spec.rb' @@ -1390,6 +1394,7 @@ Layout/LineLength: - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_event_streaming_destinations_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_groups_with_event_streaming_destinations_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_projects_with_external_status_checks_metric_spec.rb' + - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_users_associating_group_milestones_to_releases_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_users_creating_ci_builds_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/license_metric_spec.rb' @@ -1894,6 +1899,7 @@ Layout/LineLength: - 'ee/spec/support/shared_contexts/status_page/status_page_list_objects.rb' - 'ee/spec/support/shared_examples/controllers/analytics/cycle_analytics/shared_stage_shared_examples.rb' - 'ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb' + - 'ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb' - 'ee/spec/support/shared_examples/features/epics_filtered_search_shared_examples.rb' - 'ee/spec/support/shared_examples/features/sidebar_shared_examples.rb' - 'ee/spec/support/shared_examples/finders/geo/registry_finder_shared_examples.rb' @@ -2069,6 +2075,7 @@ Layout/LineLength: - 'lib/api/settings.rb' - 'lib/api/snippet_repository_storage_moves.rb' - 'lib/api/snippets.rb' + - 'lib/api/submodules.rb' - 'lib/api/suggestions.rb' - 'lib/api/tags.rb' - 'lib/api/templates.rb' @@ -2430,6 +2437,7 @@ Layout/LineLength: - 'qa/qa/resource/registry_repository.rb' - 'qa/qa/resource/repository/push.rb' - 'qa/qa/resource/snippet.rb' + - 'qa/qa/resource/user_runners.rb' - 'qa/qa/resource/wiki/group_page.rb' - 'qa/qa/runtime/api/repository_storage_moves.rb' - 'qa/qa/runtime/env.rb' @@ -2438,6 +2446,7 @@ Layout/LineLength: - 'qa/qa/scenario/bootable.rb' - 'qa/qa/service/cluster_provider/gcloud.rb' - 'qa/qa/service/cluster_provider/k3s.rb' + - 'qa/qa/service/docker_run/gitlab_runner.rb' - 'qa/qa/service/praefect_manager.rb' - 'qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb' - 'qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb' @@ -2519,6 +2528,7 @@ Layout/LineLength: - 'qa/qa/tools/delete_test_users.rb' - 'qa/qa/tools/generate_perf_testdata.rb' - 'qa/qa/tools/initialize_gitlab_auth.rb' + - 'qa/qa/vendor/one_password/cli.rb' - 'qa/spec/git/repository_spec.rb' - 'qa/spec/resource/api_fabricator_spec.rb' - 'qa/spec/runtime/env_spec.rb' @@ -2702,6 +2712,7 @@ Layout/LineLength: - 'spec/features/groups/milestone_spec.rb' - 'spec/features/groups/milestones_sorting_spec.rb' - 'spec/features/groups/packages_spec.rb' + - 'spec/features/groups/participants_autocomplete_spec.rb' - 'spec/features/groups/settings/access_tokens_spec.rb' - 'spec/features/groups/settings/repository_spec.rb' - 'spec/features/groups_spec.rb' @@ -2738,6 +2749,7 @@ Layout/LineLength: - 'spec/features/merge_request/user_comments_on_diff_spec.rb' - 'spec/features/merge_request/user_creates_image_diff_notes_spec.rb' - 'spec/features/merge_request/user_creates_merge_request_spec.rb' + - 'spec/features/merge_request/user_edits_mr_spec.rb' - 'spec/features/merge_request/user_expands_diff_spec.rb' - 'spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb' - 'spec/features/merge_request/user_posts_diff_notes_spec.rb' @@ -3264,6 +3276,8 @@ Layout/LineLength: - 'spec/lib/gitlab/diff/inline_diff_marker_spec.rb' - 'spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb' - 'spec/lib/gitlab/diff/suggestion_spec.rb' + - 'spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb' + - 'spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb' - 'spec/lib/gitlab/email/failure_handler_spec.rb' - 'spec/lib/gitlab/email/handler/create_issue_handler_spec.rb' - 'spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb' @@ -3365,6 +3379,7 @@ Layout/LineLength: - 'spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb' - 'spec/lib/gitlab/lfs/client_spec.rb' - 'spec/lib/gitlab/mail_room/authenticator_spec.rb' + - 'spec/lib/gitlab/merge_requests/message_generator_spec.rb' - 'spec/lib/gitlab/metrics/background_transaction_spec.rb' - 'spec/lib/gitlab/metrics/boot_time_tracker_spec.rb' - 'spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb' @@ -3410,6 +3425,7 @@ Layout/LineLength: - 'spec/lib/gitlab/route_map_spec.rb' - 'spec/lib/gitlab/sanitizers/exif_spec.rb' - 'spec/lib/gitlab/sanitizers/svg_spec.rb' + - 'spec/lib/gitlab/search/abuse_detection_spec.rb' - 'spec/lib/gitlab/search/found_blob_spec.rb' - 'spec/lib/gitlab/search_results_spec.rb' - 'spec/lib/gitlab/serializer/pagination_spec.rb' @@ -3488,6 +3504,7 @@ Layout/LineLength: - 'spec/mailers/emails/service_desk_spec.rb' - 'spec/mailers/notify_spec.rb' - 'spec/migrations/active_record/schema_spec.rb' + - 'spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb' - 'spec/models/active_session_spec.rb' - 'spec/models/alert_management/alert_spec.rb' - 'spec/models/analytics/cycle_analytics/aggregation_spec.rb' @@ -3839,6 +3856,7 @@ Layout/LineLength: - 'spec/requests/projects/merge_requests/context_commit_diffs_spec.rb' - 'spec/requests/projects/merge_requests_discussions_spec.rb' - 'spec/requests/projects/merge_requests_spec.rb' + - 'spec/requests/projects/releases_controller_spec.rb' - 'spec/requests/projects/settings/access_tokens_controller_spec.rb' - 'spec/requests/projects/tags_controller_spec.rb' - 'spec/requests/projects_controller_spec.rb' @@ -4133,6 +4151,7 @@ Layout/LineLength: - 'spec/support/helpers/live_debugger.rb' - 'spec/support/helpers/login_helpers.rb' - 'spec/support/helpers/merge_request_diff_helpers.rb' + - 'spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb' - 'spec/support/helpers/prometheus_helpers.rb' - 'spec/support/helpers/seed_repo.rb' - 'spec/support/helpers/selection_helper.rb' @@ -4175,6 +4194,7 @@ Layout/LineLength: - 'spec/support/shared_examples/features/editable_merge_request_shared_examples.rb' - 'spec/support/shared_examples/features/error_tracking_shared_example.rb' - 'spec/support/shared_examples/features/manage_applications_shared_examples.rb' + - 'spec/support/shared_examples/features/milestone_editing_shared_examples.rb' - 'spec/support/shared_examples/features/page_description_shared_examples.rb' - 'spec/support/shared_examples/features/sidebar/sidebar_milestone_shared_examples.rb' - 'spec/support/shared_examples/features/wiki/user_views_asciidoc_page_with_includes_shared_examples.rb' diff --git a/.rubocop_todo/lint/redundant_cop_disable_directive.yml b/.rubocop_todo/lint/redundant_cop_disable_directive.yml index dddd82cc01e6ccf00db93c1644b0d14fabe3d93f..1fb50dbba974200ff178fdda1a7e231b25b40caa 100644 --- a/.rubocop_todo/lint/redundant_cop_disable_directive.yml +++ b/.rubocop_todo/lint/redundant_cop_disable_directive.yml @@ -1,56 +1,5 @@ --- # Cop supports --autocorrect. Lint/RedundantCopDisableDirective: - # Offense count: 62 - # Temporarily disabled due to too many offenses + # Temporarily disabled Enabled: false - Exclude: - - 'app/controllers/groups/milestones_controller.rb' - - 'app/models/concerns/integrations/base/integration.rb' - - 'app/models/work_items/type.rb' - - 'app/policies/issue_policy.rb' - - 'app/services/ci/runners/set_runner_associated_projects_service.rb' - - 'app/services/work_items/data_sync/clone_service.rb' - - 'app/services/work_items/data_sync/move_service.rb' - - 'db/migrate/20241021082113_create_partitioned_ci_runners.rb' - - 'db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb' - - 'db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb' - - 'ee/app/controllers/ee/projects/settings/ci_cd_controller.rb' - - 'ee/app/models/ee/audit_events/project_audit_event.rb' - - 'ee/app/services/search/zoekt/routing_service.rb' - - 'ee/app/services/vulnerabilities/statistics/adjustment_service.rb' - - 'ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb' - - 'ee/spec/features/groups/settings/domain_verification_spec.rb' - - 'ee/spec/features/projects/mirror_spec.rb' - - 'ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb' - - 'ee/spec/lib/gitlab/elastic/client_spec.rb' - - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb' - - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb' - - 'ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb' - - 'ee/spec/views/admin/users/show.html.haml_spec.rb' - - 'lib/api/submodules.rb' - - 'lib/gitlab/popen/runner.rb' - - 'qa/qa/resource/user_runners.rb' - - 'qa/qa/service/docker_run/gitlab_runner.rb' - - 'qa/qa/vendor/one_password/cli.rb' - - 'spec/components/previews/pajamas/banner_component_preview.rb' - - 'spec/features/groups/participants_autocomplete_spec.rb' - - 'spec/features/merge_request/user_edits_mr_spec.rb' - - 'spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb' - - 'spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb' - - 'spec/lib/gitlab/merge_requests/message_generator_spec.rb' - - 'spec/lib/gitlab/search/abuse_detection_spec.rb' - - 'spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb' - - 'spec/models/concerns/encrypted_user_password_spec.rb' - - 'spec/requests/api/alert_management_alerts_spec.rb' - - 'spec/requests/projects/releases_controller_spec.rb' - - 'spec/scripts/setup/tests-metadata_spec.rb' - - 'spec/services/ci/create_pipeline_service/logger_spec.rb' - - 'spec/services/packages/pypi/create_package_service_spec.rb' - - 'spec/services/pages_domains/create_acme_order_service_spec.rb' - - 'spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb' - - 'spec/support/helpers/wait_for_requests.rb' - - 'spec/support/shared_examples/features/milestone_editing_shared_examples.rb' - - 'spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb' - - 'tooling/danger/sidekiq_queues.rb' - - 'tooling/danger/stable_branch.rb' diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 0c91631ab7b4deeb7bc822b61fec0d037719d62d..9855ce4986436cb0999037e5fd76b8688a699395 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -70,7 +70,7 @@ def update render json: { errors: [ format( - _("Someone edited this %{model_name} at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."), model_name: _('milestone') ) ] diff --git a/app/graphql/types/work_items/widgets/development_type.rb b/app/graphql/types/work_items/widgets/development_type.rb index d61045e621e92040aebfe87d82bebb01205e6874..a709289d05b904e824a90a079c1e9b1110415292 100644 --- a/app/graphql/types/work_items/widgets/development_type.rb +++ b/app/graphql/types/work_items/widgets/development_type.rb @@ -16,7 +16,7 @@ class DevelopmentType < BaseObject Types::WorkItems::ClosingMergeRequestType.connection_type, null: true, description: 'Merge requests that will close the work item when merged.' - field :related_branches, # rubocop:disable GraphQL/ExtractType -- no need to extract to related + field :related_branches, Types::WorkItems::RelatedBranchType.connection_type, calls_gitaly: true, description: 'Branches that have referred to the work item, but do not have an associated merge request.', diff --git a/app/models/concerns/integrations/base/integration.rb b/app/models/concerns/integrations/base/integration.rb index dd6fd217ef3bc1cbd6bdb83bc2db838ce9282e7f..4d7fe31c956b668298355d9010b330ec139c4a4b 100644 --- a/app/models/concerns/integrations/base/integration.rb +++ b/app/models/concerns/integrations/base/integration.rb @@ -692,7 +692,7 @@ def event_names def api_field_names fields # rubocop:disable Style/NumberedParameters -- existing code moved as is - .reject { _1[:type] == :password || _1[:name] == 'webhook' || (_1.key?(:if) && _1[:if] != true) } # rubocop:disable Style/NumberedParameters -- existing code moved as is + .reject { _1[:type] == :password || _1[:name] == 'webhook' || (_1.key?(:if) && _1[:if] != true) } .pluck(:name) # rubocop:disable Database/AvoidUsingPluckWithoutLimit -- existing code moved as is end diff --git a/app/models/work_items/type.rb b/app/models/work_items/type.rb index 2bf41c206d8261f4f629784c9ca81c68754904d8..3803999400b85623102d94124ffcd1d021dc1922 100644 --- a/app/models/work_items/type.rb +++ b/app/models/work_items/type.rb @@ -41,7 +41,7 @@ class Type < ApplicationRecord issue: { name: TYPE_NAMES[:issue], icon_name: 'issue-type-issue', enum_value: 0, id: 1 }, incident: { name: TYPE_NAMES[:incident], icon_name: 'issue-type-incident', enum_value: 1, id: 2 }, test_case: { name: TYPE_NAMES[:test_case], icon_name: 'issue-type-test-case', enum_value: 2, id: 3 }, ## EE-only - requirement: { name: TYPE_NAMES[:requirement], icon_name: 'issue-type-requirements', enum_value: 3, id: 4 }, ## EE-only # rubocop:disable Layout/LineLength -- Only comment exceeds length + requirement: { name: TYPE_NAMES[:requirement], icon_name: 'issue-type-requirements', enum_value: 3, id: 4 }, ## EE task: { name: TYPE_NAMES[:task], icon_name: 'issue-type-task', enum_value: 4, id: 5 }, objective: { name: TYPE_NAMES[:objective], icon_name: 'issue-type-objective', enum_value: 5, id: 6 }, ## EE-only key_result: { name: TYPE_NAMES[:key_result], icon_name: 'issue-type-keyresult', enum_value: 6, id: 7 }, ## EE-only diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb index 20150cc7c3e87cc6329fd4f7be6b203ce5904df5..57be3952ba53f046e1de5b05c765bc3f857acd49 100644 --- a/app/policies/issue_policy.rb +++ b/app/policies/issue_policy.rb @@ -45,13 +45,11 @@ def epics_license_available? end end - # rubocop:disable Gitlab/FeatureFlagWithoutActor -- this is a on/off toggle # group level issues license for now is equivalent to epics license. We'll have to migrate epics license to # work items context once epics are fully migrated to work items. condition(:group_level_issues_license_available) do epics_license_available? end - # rubocop:enable Gitlab/FeatureFlagWithoutActor rule { group_issue & can?(:read_group) }.policy do enable :create_note diff --git a/app/services/ci/runners/set_runner_associated_projects_service.rb b/app/services/ci/runners/set_runner_associated_projects_service.rb index 9c18f672c24f97e486754014c12fefa48ad8cb5f..ec79b0c433cbb301ad462e935d7d1a2cf994a1d6 100644 --- a/app/services/ci/runners/set_runner_associated_projects_service.rb +++ b/app/services/ci/runners/set_runner_associated_projects_service.rb @@ -30,7 +30,7 @@ def set_associated_projects response = ServiceResponse.success runner.transaction do - current_project_ids = runner.project_ids # rubocop:disable CodeReuse/ActiveRecord -- reasonable use + current_project_ids = runner.project_ids response = associate_new_projects(new_project_ids, current_project_ids) response = disassociate_old_projects(new_project_ids, current_project_ids) if response.success? diff --git a/app/services/work_items/data_sync/clone_service.rb b/app/services/work_items/data_sync/clone_service.rb index e59a47b0945ede78c594500f22beb4885392470d..7f893cd679ca2956db35b4c21b5a6a299588b652 100644 --- a/app/services/work_items/data_sync/clone_service.rb +++ b/app/services/work_items/data_sync/clone_service.rb @@ -41,7 +41,7 @@ def verify_can_clone_work_item(work_item, target_namespace) return error(error_message, :unprocessable_entity) end - if target_namespace.pending_delete? # rubocop:disable Style/GuardClause -- does not read right with other checks above + if target_namespace.pending_delete? error_message = s_('CloneWorkItem|Cannot clone work item to target namespace as it is pending deletion.') return error(error_message, :unprocessable_entity) diff --git a/app/services/work_items/data_sync/move_service.rb b/app/services/work_items/data_sync/move_service.rb index d5c668a9a97f1808cff48eb5fbc8ffa4b8da26bd..52211caa8c80f99e37d05b78b5a4b62b574b236a 100644 --- a/app/services/work_items/data_sync/move_service.rb +++ b/app/services/work_items/data_sync/move_service.rb @@ -33,7 +33,7 @@ def verify_can_move_work_item(work_item, target_namespace) return error(error_message, :unprocessable_entity) end - if target_namespace.pending_delete? # rubocop:disable Style/GuardClause -- does not read right with other checks above + if target_namespace.pending_delete? error_message = s_('MoveWorkItem|Cannot move work item to target namespace as it is pending deletion.') return error(error_message, :unprocessable_entity) diff --git a/db/migrate/20241021082113_create_partitioned_ci_runners.rb b/db/migrate/20241021082113_create_partitioned_ci_runners.rb index 79c3fec301835a5de4aa7c3ca7c48bff5fd6e6a5..d61018f8d3a21d0167b0563a949069c0761afe7e 100644 --- a/db/migrate/20241021082113_create_partitioned_ci_runners.rb +++ b/db/migrate/20241021082113_create_partitioned_ci_runners.rb @@ -35,7 +35,6 @@ def down def create_partitioned_table(name) options = 'PARTITION BY LIST (runner_type)' - # rubocop: disable Migration/EnsureFactoryForTable -- we'll reuse the ci_runners factory once migrated create_table name, primary_key: PARTITIONED_TABLE_PK, options: options do |t| t.bigint :id, null: false t.bigint :creator_id @@ -88,6 +87,5 @@ def create_partitioned_table(name) t.index %i[token_expires_at id], name: "idx_#{name}_on_token_expires_at_desc_and_id_desc", order: { token_expires_at: :desc, runner_type: :asc, id: :desc } end - # rubocop: enable Migration/EnsureFactoryForTable end end diff --git a/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb b/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb index d2e4376d2581970283bcc5e034adf6468d34d73c..f7d6dd49807ea5dc3af3750d60f53e812865fdae 100644 --- a/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb +++ b/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb @@ -28,7 +28,6 @@ def down def create_partitioned_table(name) options = 'PARTITION BY LIST (runner_type)' - # rubocop: disable Migration/EnsureFactoryForTable -- we'll reuse the ci_runner_machines factory once migrated create_table name, primary_key: PARTITIONED_TABLE_PK, options: options do |t| t.bigint :id, null: false t.bigint :runner_id, null: false @@ -59,6 +58,5 @@ def create_partitioned_table(name) name: "index_#{name}_on_patch_version" t.index :version, name: "index_#{name}_on_version" end - # rubocop: enable Migration/EnsureFactoryForTable end end diff --git a/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb b/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb index 5f9beb6e4b344d24c5b5537bd5aa0eb07ac339ac..06b460228728f040532f3488fbf5526d6a9cdc1d 100644 --- a/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb +++ b/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb @@ -12,7 +12,7 @@ def down create_table :user_canonical_emails do |t| t.timestamps_with_timezone t.references :user, index: false, null: false, foreign_key: { on_delete: :cascade } - t.string :canonical_email, null: false, index: true # rubocop:disable Migration/AddLimitToStringColumns -- limit ignored in original migration + t.string :canonical_email, null: false, index: true end add_index :user_canonical_emails, [:user_id, :canonical_email], unique: true diff --git a/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb b/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb index 0b6439112b737f1f7d1503f4832401aa3febe834..b2ccf97800ac3642dfa6d2df36922e33d1827311 100644 --- a/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb +++ b/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb @@ -38,7 +38,7 @@ def define_protected_env_variables @protected_environments = @project.protected_environments.with_environment_id.sorted_by_name @protected_environment = ProtectedEnvironment.new(project: @project) # ignoring Layout/LineLength because if we break this into multiple lines, we cause Style/GuardClause errors - @group_protected_environments = ProtectedEnvironment.for_groups(@project.group.self_and_ancestor_ids) if @project.group # rubocop:disable Layout/LineLength + @group_protected_environments = ProtectedEnvironment.for_groups(@project.group.self_and_ancestor_ids) if @project.group # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective end def assign_variables_to_gon diff --git a/ee/app/models/ee/audit_events/project_audit_event.rb b/ee/app/models/ee/audit_events/project_audit_event.rb index a21940ac87798d6999ceb86d084527aa17ab0da1..4650bd02fef2a9d8081cc7727cfce89bbdcb449b 100644 --- a/ee/app/models/ee/audit_events/project_audit_event.rb +++ b/ee/app/models/ee/audit_events/project_audit_event.rb @@ -28,7 +28,7 @@ def entity_type end def present - AuditEventPresenter.new(self) # rubocop:disable CodeReuse/Presenter -- This is called in AuditEventSerializer + AuditEventPresenter.new(self) end def root_group_entity diff --git a/ee/app/services/search/zoekt/routing_service.rb b/ee/app/services/search/zoekt/routing_service.rb index c9f37b70ea0cca1ea307514101caad797c456bc2..72d9ae194d3b3a9039af52ab0ee0153c7f667f2e 100644 --- a/ee/app/services/search/zoekt/routing_service.rb +++ b/ee/app/services/search/zoekt/routing_service.rb @@ -20,7 +20,6 @@ def initialize(projects) # @returns [Hash] { node_id => [1,2,3], node_id2 => [4,5,6] } # rubocop:disable CodeReuse/ActiveRecord -- this service builds a complex custom AR query # rubocop:disable Database/AvoidUsingPluckWithoutLimit -- we restrict the number of projects in the guard clause - # rubocop:disable Layout/LineLength -- not breaking lines for better readability def execute raise "Too many projects" if projects.count > MAX_NUMBER_OF_PROJECTS @@ -49,7 +48,7 @@ def fetch_projects_through_replicas projects.without_order.joins(zoekt_repositories: { zoekt_index: { replica: :zoekt_enabled_namespace } }) .merge(EnabledNamespace.search_enabled).merge(Replica.ready) end - # rubocop:enable CodeReuse/ActiveRecord, Layout/LineLength, Database/AvoidUsingPluckWithoutLimit + # rubocop:enable CodeReuse/ActiveRecord, Database/AvoidUsingPluckWithoutLimit end end end diff --git a/ee/app/services/vulnerabilities/statistics/adjustment_service.rb b/ee/app/services/vulnerabilities/statistics/adjustment_service.rb index 582ad4a922695e530b959e9d9636cfc2d8b98f66..e18e1c65dd3f8a8215320f887b3edbe3c9d3929a 100644 --- a/ee/app/services/vulnerabilities/statistics/adjustment_service.rb +++ b/ee/app/services/vulnerabilities/statistics/adjustment_service.rb @@ -92,11 +92,9 @@ def execute delegate :connection, to: ApplicationRecord, private: true - # rubocop: disable Database/AvoidUsingPluckWithoutLimit -- already limited by caller BulkDismissService def filter_project_ids self.project_ids = Project.id_in(project_ids).pluck_primary_key end - # rubocop: enable Database/AvoidUsingPluckWithoutLimit def upsert_sql UPSERT_SQL % { stats_sql: stats_sql } diff --git a/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb b/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb index bb1a3aff767fe33b9c8cc705eb4f76442481aaca..ca0be1210e4e4b5ee3ae43e8553406e49e69a421 100644 --- a/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb +++ b/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb @@ -12,7 +12,7 @@ def up add_column_unless_exists :checksum_mismatch, :boolean add_column_unless_exists :verification_checksum, :binary add_column_unless_exists :verification_checksum_mismatched, :binary - add_column_unless_exists :verification_failure, :string, limit: 255 # rubocop:disable Migration/PreventStrings -- See https://gitlab.com/gitlab-org/gitlab/-/issues/323806 + add_column_unless_exists :verification_failure, :string, limit: 255 end def add_column_unless_exists(column_name, type, **options) diff --git a/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb b/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb index 7c9e53a20a8d012c21bd9ad8720f63d085ceed2a..e471306778173335b74c89650dab100d219ca432 100644 --- a/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb +++ b/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb @@ -131,7 +131,8 @@ def initialize(jira_integration) def execute(page, per_page) jql = build_jql start_at = (page - 1) * per_page - url = "#{context_path}/rest/api/2/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=description,project" # rubocop:disable Layout/LineLength -- Whole URL is too long + url = "#{context_path}/rest/api/2/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&" \ + "maxResults=#{per_page}&fields=description,project" request(url) end diff --git a/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb b/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb index ef6d2ef542cdac0df8f29c8c2c550ffcd5192efd..9b6b73ea115edcf7a4c2ba7349bc15fe96bf0f97 100644 --- a/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb +++ b/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb @@ -140,10 +140,7 @@ def create_merge_request_with_resolution( def add_note_from_vulnerable_mr_to_resolution(vulnerable_mr, resolution_mr, vulnerability, user) return unless vulnerable_mr - # rubocop: disable CodeReuse/Presenter -- Presenter methods are used in ERB presentation. finding_presenter = Vulnerabilities::FindingPresenter.new(vulnerability.finding) - # rubocop: enable CodeReuse/Presenter - resolution_mr_url = Gitlab::Routing.url_helpers.project_merge_request_url( resolution_mr.project, resolution_mr diff --git a/ee/spec/features/groups/settings/domain_verification_spec.rb b/ee/spec/features/groups/settings/domain_verification_spec.rb index 852e782885ccdcfdf4e87dac948202e34658579f..13d6fc57689e27cbadd2627d1b6c691cdbd150a9 100644 --- a/ee/spec/features/groups/settings/domain_verification_spec.rb +++ b/ee/spec/features/groups/settings/domain_verification_spec.rb @@ -41,7 +41,7 @@ it 'displays no domains present message' do visit_domain_verification_page - expect(page).to have_content s_('DomainVerification|No domains configured. Create a domain in a project in this group hierarchy.') # rubocop:disable Layout/LineLength + expect(page).to have_content s_('DomainVerification|No domains configured. Create a domain in a project in this group hierarchy.') end end diff --git a/ee/spec/features/projects/mirror_spec.rb b/ee/spec/features/projects/mirror_spec.rb index 15d4a87c6cdc55d39089908b65e1a82fbc34283a..3b178db9b92145a6a6c717e22b327b929e3b86fb 100644 --- a/ee/spec/features/projects/mirror_spec.rb +++ b/ee/spec/features/projects/mirror_spec.rb @@ -205,7 +205,7 @@ def add_mirror end end - it 'can be changed to unauthenticated', quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' do # rubocop:disable Layout/LineLength + it 'can be changed to unauthenticated', quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' do project.update!(import_url: 'http://user:password@example.com') visit project_settings_repository_path(project) diff --git a/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb b/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb index e5fa586f98f45a1b0291a0afb9083c5df5612fa7..e7686c03cda94d146418f6bc97776b919bfd8e66 100644 --- a/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb +++ b/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb @@ -114,7 +114,7 @@ def doc(text) expect(control.count).to eq 1 - markdown = "#{cadence.to_reference} #{cadence.to_reference(format: :title)} #{another_cadence.to_reference} #{another_cadence.to_reference(format: :title)}" # rubocop:disable Layout/LineLength -- readability + markdown = "#{cadence.to_reference} #{cadence.to_reference(format: :title)} #{another_cadence.to_reference} #{another_cadence.to_reference(format: :title)}" expect { reference_filter(markdown, context) }.not_to exceed_all_query_limit(1) end diff --git a/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb b/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb index e47209edb01381b8602839dd3d58b13a5d221e82..031c1873f4b6c4bf4a73512f31e82ebd9231dbc8 100644 --- a/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb +++ b/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb @@ -230,7 +230,10 @@ def self.encryption_options let(:finder) { described_class::JiraIssuesFinder.new(mock_jira_integration) } it "makes a call to the correct jira url" do - expect(finder).to receive(:request).with("/rest/api/2/search?jql=project+in+%28key1%2C+key2%29+AND+description+~+%22Issue+created+from+vulnerability%22+order+by+created+DESC&startAt=0&maxResults=100&fields=description,project") # rubocop:disable Layout/LineLength -- URL is too long + expect(finder).to receive(:request) + .with("/rest/api/2/search?jql=project+in+%28key1%2C+key2%29+AND+description+~+%" \ + "22Issue+created+from+vulnerability%22+order+by+created+DESC&startAt=0&" \ + "maxResults=100&fields=description,project") finder.execute(1, 100) end diff --git a/ee/spec/lib/gitlab/elastic/client_spec.rb b/ee/spec/lib/gitlab/elastic/client_spec.rb index 7d749a512f577e8c2d31a5b068723c32d2b4ac39..037c12bdcf346edabd8be520838fb75690a9b526 100644 --- a/ee/spec/lib/gitlab/elastic/client_spec.rb +++ b/ee/spec/lib/gitlab/elastic/client_spec.rb @@ -114,7 +114,8 @@ end let(:meta_string) do - "es=#{Elasticsearch::VERSION},rb=#{RUBY_VERSION},t=#{Elasticsearch::Transport::VERSION},fd=#{Faraday::VERSION},ty=#{Typhoeus::VERSION}" # rubocop:disable Layout/LineLength -- This is just a long string + "es=#{Elasticsearch::VERSION},rb=#{RUBY_VERSION},t=#{Elasticsearch::Transport::VERSION}," \ + "fd=#{Faraday::VERSION},ty=#{Typhoeus::VERSION}" end it 'signs_requests' do diff --git a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb index dc760b5a131d195147aeb059177f28b32e94e41b..4ad44387ccb591c4545ef3be2d2327357756743b 100644 --- a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb +++ b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb @@ -112,7 +112,9 @@ let(:start) { 30.days.ago.to_fs(:db) } let(:finish) { 2.days.ago.to_fs(:db) } let(:expected_query) do - %{SELECT COUNT(DISTINCT "security_scans"."pipeline_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + "SELECT COUNT(DISTINCT \"security_scans\".\"pipeline_id\") FROM \"security_scans\" WHERE " \ + "\"security_scans\".\"created_at\" BETWEEN '#{start}' AND '#{finish}' AND " \ + "\"security_scans\".\"scan_type\" = #{scan_type}" end it 'has correct value' do diff --git a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb index d567d37be562525dfb1f007f42722efa5ba30c66..08bd23f1c6989e50ea3543dcac4cc3719ec9e893 100644 --- a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb +++ b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb @@ -18,9 +18,9 @@ let(:scan_type) { scan_type } let(:expected_query) do if params[:time_frame] == 'all' - %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."scan_type" = #{scan_type}} else - %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} end end diff --git a/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb b/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb index 25aa5e141cc315c7bd63b89bba87eeafca7255e6..59d96059853a7f838efa53403200cf87a7abda47 100644 --- a/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb +++ b/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb @@ -332,7 +332,6 @@ end end - # rubocop:disable RSpec/MultipleMemoizedHelpers -- Need helpers for scenarios context 'when params are valid' do let(:params) { { llm_patch: llm_patch, description_options: { analysis_data: analysis_data, summary_data: summary_data } } } @@ -570,6 +569,5 @@ end end end - # rubocop:enable RSpec/MultipleMemoizedHelpers end end diff --git a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb index 82cedf0bb9a91bfb91e3012ef3c78ce747d68330..bdeafa308cab6979983b445f714172ac1b455266 100644 --- a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb +++ b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb @@ -24,7 +24,7 @@ visit page_path expect(page).to have_content( - s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') # rubocop:disable Layout/LineLength -- Single string + s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') ) link = page.find_link(restricted_group.path) @@ -48,7 +48,7 @@ visit page_path expect(page).not_to have_content( - s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') # rubocop:disable Layout/LineLength -- Single string + s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') ) end end diff --git a/ee/spec/views/admin/users/show.html.haml_spec.rb b/ee/spec/views/admin/users/show.html.haml_spec.rb index 259f92fea5f8eb7f206086ebb5a0674763deb6e9..d49966cc75f73edd21e4f9bcd309ee9640078e3c 100644 --- a/ee/spec/views/admin/users/show.html.haml_spec.rb +++ b/ee/spec/views/admin/users/show.html.haml_spec.rb @@ -94,8 +94,8 @@ let(:timestamp) { page.at("[data-testid=\"#{test_id}\"]") } where(:sent_at_attr, :test_id, :displayed, :label) do - :confirmation_sent_at | 'email-confirmation-code-last-sent-at' | lazy { timestamp } | 'Email confirmation code last sent at' # rubocop:disable Layout/LineLength -- should be in a single line - :locked_at | 'email-verification-code-last-sent-at' | lazy { timestamp } | 'Locked account email verification code last sent at' # rubocop:disable Layout/LineLength -- should be in a single line + :confirmation_sent_at | 'email-confirmation-code-last-sent-at' | lazy { timestamp } | 'Email confirmation code last sent at' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- should be in a single line + :locked_at | 'email-verification-code-last-sent-at' | lazy { timestamp } | 'Locked account email verification code last sent at' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- should be in a single line end with_them do diff --git a/lib/api/submodules.rb b/lib/api/submodules.rb index 454454da67c45a40cd0ba9a6050648c1eb805367..dbeff31fd028e78f97d56dec0e0fa2fa47ab7ffd 100644 --- a/lib/api/submodules.rb +++ b/lib/api/submodules.rb @@ -2,7 +2,7 @@ module API class Submodules < ::API::Base - SUBMODULE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(submodule: API::NO_SLASH_URL_PART_REGEX) # rubocop:disable Layout/LineLength -- no way to shorten this and adhere to naming convention + SUBMODULE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(submodule: API::NO_SLASH_URL_PART_REGEX) before { authenticate! } diff --git a/lib/gitlab/background_migration/backfill_security_policies.rb b/lib/gitlab/background_migration/backfill_security_policies.rb index eaef26415b256791036bb57918a34e26064be345..7d2a4b5f549b73788740e6afb5bf616b92038079 100644 --- a/lib/gitlab/background_migration/backfill_security_policies.rb +++ b/lib/gitlab/background_migration/backfill_security_policies.rb @@ -10,4 +10,4 @@ def perform; end end end -Gitlab::BackgroundMigration::BackfillSecurityPolicies.prepend_mod_with('Gitlab::BackgroundMigration::BackfillSecurityPolicies') # rubocop:disable Layout/LineLength -- ignore +Gitlab::BackgroundMigration::BackfillSecurityPolicies.prepend_mod diff --git a/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb b/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb index 3436df9ba0d887fbdc02891f25c40fc33317cb53..a2303afda9e75b9aa21f5e6ab2a9b0b7594c5c2c 100644 --- a/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb +++ b/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb @@ -10,7 +10,6 @@ class ProjectBotUserDetailsBotNamespaceMigration < BatchedMigrationJob feature_category :system_access - # rubocop:disable Metrics/BlockLength -- Method is long due to formatted SQL def perform each_sub_batch do |sub_batch| connection.execute( @@ -39,7 +38,6 @@ def perform ) end end - # rubocop:enable Metrics/BlockLength end end end diff --git a/lib/gitlab/popen/runner.rb b/lib/gitlab/popen/runner.rb index cd9ad270cd80c2fde537007181ec33ac54719cca..1cef3b84ef30eeee24ea10388430b8dfb3616885 100644 --- a/lib/gitlab/popen/runner.rb +++ b/lib/gitlab/popen/runner.rb @@ -12,7 +12,7 @@ def initialize def run(commands, &block) commands.each do |cmd| # yield doesn't support blocks, so we need to use a block variable - block.call(cmd) do # rubocop:disable Performance/RedundantBlockCall + block.call(cmd) do cmd_result = Gitlab::Popen.popen_with_detail(cmd) results << cmd_result diff --git a/qa/qa/resource/user_runners.rb b/qa/qa/resource/user_runners.rb index da1c808bb681d546caebc5b23198c9b0cf141cce..fb504bc725f9a67cbc0f5f1a89c23441b939d82f 100644 --- a/qa/qa/resource/user_runners.rb +++ b/qa/qa/resource/user_runners.rb @@ -27,7 +27,7 @@ def initialize @run_untagged = nil @name = "qa-runner-#{SecureRandom.hex(4)}" @executor = :shell - @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" # rubocop:disable Layout/LineLength -- image path + @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" end def fabricate! diff --git a/qa/qa/service/docker_run/gitlab_runner.rb b/qa/qa/service/docker_run/gitlab_runner.rb index c9885791a634a68f5530dce0164e172803fd3c55..7283a65fe8523fb0ce5e6cabfebab5ee862606b5 100644 --- a/qa/qa/service/docker_run/gitlab_runner.rb +++ b/qa/qa/service/docker_run/gitlab_runner.rb @@ -15,10 +15,10 @@ class GitlabRunner < Base MSG def initialize(name) - @image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.runner_container_image}" # rubocop:disable Layout/LineLength + @image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.runner_container_image}" @name = name || "qa-runner-#{SecureRandom.hex(4)}" @executor = :shell - @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" # rubocop:disable Layout/LineLength + @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" super() end diff --git a/qa/qa/vendor/one_password/cli.rb b/qa/qa/vendor/one_password/cli.rb index f443ba0549232fcef0196c4553e43d5537bd92a8..191c50618defa5c14383975336d909e99b964906 100644 --- a/qa/qa/vendor/one_password/cli.rb +++ b/qa/qa/vendor/one_password/cli.rb @@ -51,7 +51,7 @@ def current_otp # But note that if we add more tests that use this class, we might need to add a mechanism to invalidate # the cache after 30 minutes or if the session_token is rejected by op CLI. def session_token - @session_token ||= `echo '#{@password}' | op account add --address #{@address} --email #{@email} --secret-key #{@secret} --signin --raw` # rubocop:disable Layout/LineLength + @session_token ||= `echo '#{@password}' | op account add --address #{@address} --email #{@email} --secret-key #{@secret} --signin --raw` end end end diff --git a/spec/components/previews/pajamas/banner_component_preview.rb b/spec/components/previews/pajamas/banner_component_preview.rb index 8bb7b82527d845e44e9807524eefc494a6715da6..e3942895cd9164caeca11fe79cbc5c11ca928081 100644 --- a/spec/components/previews/pajamas/banner_component_preview.rb +++ b/spec/components/previews/pajamas/banner_component_preview.rb @@ -42,7 +42,7 @@ def with_primary_action_slot def with_illustration_slot render(Pajamas::BannerComponent.new) do |c| c.with_illustration do - '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>'.html_safe # rubocop:disable Layout/LineLength + '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>'.html_safe # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective end content_tag :p, "This banner uses the illustration slot." end diff --git a/spec/features/groups/participants_autocomplete_spec.rb b/spec/features/groups/participants_autocomplete_spec.rb index 77423ef82a6a2159fa32fd981790e67a475ffd92..90ae5540a1f25739fc58fcf9c32ecae874b78606 100644 --- a/spec/features/groups/participants_autocomplete_spec.rb +++ b/spec/features/groups/participants_autocomplete_spec.rb @@ -37,7 +37,7 @@ create(:group_group_link, shared_group: group, shared_with_group: private_group) end - it 'suggests member of private group as well', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/444683' do # rubocop:disable Layout/LineLength -- We prefer to keep it on a single line, for simplicity sake + it 'suggests member of private group as well', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/444683' do visit edit_group_milestone_path(group, noteable) fill_in 'Description', with: '@' diff --git a/spec/features/merge_request/user_edits_mr_spec.rb b/spec/features/merge_request/user_edits_mr_spec.rb index de277688a98385e158b55527b9db60d7420437b6..ac5e764c302f4921b76667f339e17533a7d5d9c8 100644 --- a/spec/features/merge_request/user_edits_mr_spec.rb +++ b/spec/features/merge_request/user_edits_mr_spec.rb @@ -94,7 +94,7 @@ expect(page).to have_content( format( - _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), model_name: _('merge request'), link_to_model: _('merge request') ) diff --git a/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb b/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb index fb433923db50a01357e5d0cfe1878325f1a48e41..fd55050d4b9f91e1a6763c487d104885fdb73e4a 100644 --- a/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb +++ b/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb @@ -8,7 +8,7 @@ it 'generates a PBKDF2+SHA512 hashed value in the correct format' do expect(described_class.transform_secret(plaintext_secret)) - .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") # rubocop:disable Layout/LineLength + .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") end end @@ -27,7 +27,7 @@ describe '.secret_matches?' do it "match by hashing the input if the stored value is hashed" do plain_secret = 'plain_secret' - stored_value = '$pbkdf2-sha512$20000$$/BwQRdwSpL16xkQhstavh7nvA5avCP7.4n9LLKe9AupgJDeA7M5xOAvG3N3E5XbRyGWWBbbr.BsojPVWzd1Sqg' # rubocop:disable Layout/LineLength + stored_value = '$pbkdf2-sha512$20000$$/BwQRdwSpL16xkQhstavh7nvA5avCP7.4n9LLKe9AupgJDeA7M5xOAvG3N3E5XbRyGWWBbbr.BsojPVWzd1Sqg' expect(described_class.secret_matches?(plain_secret, stored_value)).to be true end end diff --git a/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb b/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb index e267d27ed139623bf2e455d41d25ac80858e5b13..8163817f62e0b3de23e21c6753fdd6c222e86e1d 100644 --- a/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb +++ b/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb @@ -8,7 +8,7 @@ it 'generates a PBKDF2+SHA512 hashed value in the correct format' do expect(described_class.transform_secret(plaintext_token)) - .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") # rubocop:disable Layout/LineLength + .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") end end diff --git a/spec/lib/gitlab/merge_requests/message_generator_spec.rb b/spec/lib/gitlab/merge_requests/message_generator_spec.rb index b1b355b2f399461cd40abef6e92cbb1efac22d55..13af4033368d0f03a4b9538c324486c6bb2e8f65 100644 --- a/spec/lib/gitlab/merge_requests/message_generator_spec.rb +++ b/spec/lib/gitlab/merge_requests/message_generator_spec.rb @@ -260,7 +260,7 @@ context 'when project has template with CRLF newlines' do let(message_template_name) do - "Merge branch '%{source_branch}' into '%{target_branch}'\r\n\r\n%{title}\r\n\r\n%{description}\r\n\r\nSee merge request %{reference}" # rubocop: disable Layout/LineLength + "Merge branch '%{source_branch}' into '%{target_branch}'\r\n\r\n%{title}\r\n\r\n%{description}\r\n\r\nSee merge request %{reference}" end it 'converts it to LF newlines' do diff --git a/spec/lib/gitlab/search/abuse_detection_spec.rb b/spec/lib/gitlab/search/abuse_detection_spec.rb index f849b1f996bf1334e9c80c46c930f2be42b1eef2..e500faf93d5e1c72f32d14c8e2cbdfa11225fdbb 100644 --- a/spec/lib/gitlab/search/abuse_detection_spec.rb +++ b/spec/lib/gitlab/search/abuse_detection_spec.rb @@ -83,7 +83,7 @@ word | { query_string: ['stopword only abusive search detected'] } end - (['apples'] * (described_class::MAX_PIPE_SYNTAX_FILTERS + 1)).join('|') | { query_string: ['too many pipe syntax filters'] } # rubocop:disable Layout/LineLength + (['apples'] * (described_class::MAX_PIPE_SYNTAX_FILTERS + 1)).join('|') | { query_string: ['too many pipe syntax filters'] } (['apples'] * described_class::MAX_PIPE_SYNTAX_FILTERS).join('|') | {} 'x' | { query_string: ['abusive tiny search detected'] } 'apples|x' | { query_string: ['abusive tiny search detected'] } diff --git a/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb b/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb index 5ee2c311655248e9c078a8d60c8f94bf26b5fa12..154900938b45853f8931d3dede253715a2ce8ac2 100644 --- a/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb +++ b/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb @@ -40,7 +40,7 @@ :p_ci_builds, [:commit_id, :artifacts_expire_at, :id], name: :p_ci_builds_commit_id_artifacts_expire_at_id_convert_to_big_idx, - where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))" # rubocop:disable Layout/LineLength -- Just too long + where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))" ) end diff --git a/spec/models/concerns/encrypted_user_password_spec.rb b/spec/models/concerns/encrypted_user_password_spec.rb index b644731396765fbc78e0038200fa51d18c8d0099..2ee3867fcd47db088ebf8c76cd30dbcd5d5ebedf 100644 --- a/spec/models/concerns/encrypted_user_password_spec.rb +++ b/spec/models/concerns/encrypted_user_password_spec.rb @@ -17,7 +17,10 @@ end context 'when password is stored in PBKDF2 format' do - let(:encrypted_password) { '$pbkdf2-sha512$20000$rKbYsScsDdk$iwWBewXmrkD2fFfaG1SDcMIvl9gvEo3fBWUAfiqyVceTlw/DYgKBByHzf45pF5Qn59R4R.NQHsFpvZB4qlsYmw' } # rubocop:disable Layout/LineLength + let(:encrypted_password) do + '$pbkdf2-sha512$20000$rKbYsScsDdk$iwWBewXmrkD2fFfaG1SDcMIvl9gvEo3fBWUAfiqyVceTlw/DYgKBByHzf45pF5Qn59R4R.NQHs' \ + 'FpvZB4qlsYmw' + end it 'uses the decoded password salt' do expect(authenticatable_salt).to eq('aca6d8b1272c0dd9') diff --git a/spec/requests/api/alert_management_alerts_spec.rb b/spec/requests/api/alert_management_alerts_spec.rb index 8dd0c46eab62a1bf338d034bf602f9fd0356ee28..bd08bed02f6be059e5bdc9c20a2872b855798803 100644 --- a/spec/requests/api/alert_management_alerts_spec.rb +++ b/spec/requests/api/alert_management_alerts_spec.rb @@ -303,7 +303,9 @@ context 'and metric image not found' do subject do - put api("/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user) # rubocop: disable Layout/LineLength + put api( + "/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user + ) end it 'returns an error' do @@ -378,7 +380,9 @@ context 'when metric image not found' do subject do - delete api("/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user) # rubocop: disable Layout/LineLength + delete api( + "/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user + ) end it 'returns an error' do diff --git a/spec/requests/projects/releases_controller_spec.rb b/spec/requests/projects/releases_controller_spec.rb index bb12f80f0fa45ab4a7fea8b74582a12e2518235d..8cf1c83e13d93fcc1d174bde1e9c034fef863755 100644 --- a/spec/requests/projects/releases_controller_spec.rb +++ b/spec/requests/projects/releases_controller_spec.rb @@ -107,7 +107,7 @@ context 'when private project' do let_it_be(:private_project) { create(:project, :repository, :private) } - it_behaves_like 'authenticates sessionless user for the request spec', 'index atom', public_resource: false, ignore_metrics: true do # rubocop:disable Layout/LineLength -- We prefer to keep it on a single line, for simplicity sake + it_behaves_like 'authenticates sessionless user for the request spec', 'index atom', public_resource: false, ignore_metrics: true do let(:url) { project_releases_url(private_project, format: :atom) } before do diff --git a/spec/scripts/setup/tests-metadata_spec.rb b/spec/scripts/setup/tests-metadata_spec.rb index 29b7df39e8d7b44ae45a30b8252a79fac9b839bd..0ca58448331c8b2b8e313a9f326b07e609c4ebc6 100644 --- a/spec/scripts/setup/tests-metadata_spec.rb +++ b/spec/scripts/setup/tests-metadata_spec.rb @@ -6,7 +6,7 @@ # rubocop:disable Gitlab/Json, Lint/MissingCopEnableDirective -- It's not intended to have extra dependency -RSpec.describe TestsMetadata, feature_category: :tooling do # rubocop:disable Rails/FilePath,RSpec/SpecFilePathFormat -- We use dashes in scripts +RSpec.describe TestsMetadata, feature_category: :tooling do # rubocop:disable RSpec/SpecFilePathFormat -- We use dashes in scripts subject(:metadata) do described_class.new( mode: mode, diff --git a/spec/services/ci/create_pipeline_service/logger_spec.rb b/spec/services/ci/create_pipeline_service/logger_spec.rb index aee2f9b6370037c84c6e4ab005c84e0ab08d2263..d7027f624c5ab64723777a0d6b297f199823f08b 100644 --- a/spec/services/ci/create_pipeline_service/logger_spec.rb +++ b/spec/services/ci/create_pipeline_service/logger_spec.rb @@ -2,8 +2,7 @@ require 'spec_helper' -RSpec.describe Ci::CreatePipelineService, # rubocop: disable RSpec/SpecFilePathForm - feature_category: :continuous_integration do +RSpec.describe Ci::CreatePipelineService, feature_category: :continuous_integration do describe 'pipeline logger' do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { project.first_owner } diff --git a/spec/services/packages/conan/create_package_service_spec.rb b/spec/services/packages/conan/create_package_service_spec.rb index 602179a122433b94ea4892f2b223b221cf838e28..c056dd5f4208548c3af6278f3a29e2cd1efaa696 100644 --- a/spec/services/packages/conan/create_package_service_spec.rb +++ b/spec/services/packages/conan/create_package_service_spec.rb @@ -169,15 +169,12 @@ stub_feature_flags(packages_protected_packages_conan: false) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user) do ref(:package_name) | :maintainer | ref(:project_developer) ref(:package_name) | :admin | ref(:project_owner) ref(:package_name_pattern_no_match) | :maintainer | ref(:project_developer) ref(:package_name_pattern_no_match) | :admin | ref(:project_owner) end - # rubocop:enable Layout/LineLength - with_them do it_behaves_like 'a service response for valid package' end diff --git a/spec/services/packages/pypi/create_package_service_spec.rb b/spec/services/packages/pypi/create_package_service_spec.rb index 954c25083f564e3b25bcb4d8c0cd414af2fbf602..28a636967a8601275a7a49c95a004f6c03db8a3d 100644 --- a/spec/services/packages/pypi/create_package_service_spec.rb +++ b/spec/services/packages/pypi/create_package_service_spec.rb @@ -278,7 +278,7 @@ minimum_access_level_for_push: minimum_access_level_for_push) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax + # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user, :shared_examples_name) do ref(:package_name) | :maintainer | ref(:project_developer) | 'an error service response for protected package' ref(:package_name) | :maintainer | ref(:project_maintainer) | 'a service response for valid package' @@ -297,7 +297,7 @@ ref(:package_name) | :maintainer | nil | 'an error service response for unauthorized' ref(:package_name) | :admin | ref(:unauthorized_deploy_token) | 'an error service response for unauthorized' end - # rubocop:enable Layout/LineLength + # rubocop:enable Layout/LineLength, Lint/RedundantCopDisableDirective with_them do it_behaves_like params[:shared_examples_name] @@ -308,15 +308,12 @@ stub_feature_flags(packages_protected_packages_pypi: false) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user) do ref(:package_name) | :maintainer | ref(:project_developer) ref(:package_name) | :admin | ref(:project_owner) ref(:package_name_pattern_no_match) | :maintainer | ref(:project_developer) ref(:package_name_pattern_no_match) | :admin | ref(:project_owner) end - # rubocop:enable Layout/LineLength - with_them do it_behaves_like 'a service response for valid package' end diff --git a/spec/services/pages_domains/create_acme_order_service_spec.rb b/spec/services/pages_domains/create_acme_order_service_spec.rb index 46601d07ed9a4191f7c97a277d7dd3a059d57c9b..2eab23cae5d32cfd38b58df1a7fc37cd821244e2 100644 --- a/spec/services/pages_domains/create_acme_order_service_spec.rb +++ b/spec/services/pages_domains/create_acme_order_service_spec.rb @@ -82,7 +82,7 @@ end where(:lets_encrypt_client_error, :lets_encrypt_client_error_message) do - Acme::Client::Error::RejectedIdentifier | 'Invalid identifiers requested :: Cannot issue for "local": Domain name needs at least one dot' # rubocop:disable Layout/LineLength -- Ensuring one line table syntax + Acme::Client::Error::RejectedIdentifier | 'Invalid identifiers requested :: Cannot issue for "local": Domain name needs at least one dot' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- Ensuring one line table syntax Acme::Client::Error::BadCSR | 'Error finalizing order :: signature algorithm not supported' Acme::Client::Error | 'Other acme client error' Acme::Client::Error | nil diff --git a/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb b/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb index 1f8505978f5ecd4b24747d42629aeccc2e4c0463..4be78f690c34ef36d1510954427de59c561967e1 100644 --- a/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb +++ b/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb @@ -20,7 +20,7 @@ def raw_metadata "description" => "The cipher does not provide data integrity update 1", "message" => "The cipher does not provide data integrity", "cve" => "818bf5dacb291e15d9e6dc3c5ac32178:CIPHER", - "solution" => "GCM mode introduces an HMAC into the resulting encrypted data, providing integrity of the result.", # rubocop:disable Layout/LineLength + "solution" => "GCM mode introduces an HMAC into the resulting encrypted data, providing integrity of the result.", "location" => { "file" => "maven/src/main/java/com/gitlab/security_products/tests/App.java", "start_line" => 29, diff --git a/spec/support/helpers/wait_for_requests.rb b/spec/support/helpers/wait_for_requests.rb index b7a3b77a694f2dac3685d74bce775f6b8287aa73..ab9cca7c6b0f1bc7da32b9497e976a11e6471489 100644 --- a/spec/support/helpers/wait_for_requests.rb +++ b/spec/support/helpers/wait_for_requests.rb @@ -72,6 +72,9 @@ def finished_all_js_requests? end def finished_all_ajax_requests? - Capybara.page.evaluate_script('window.pendingRequests || window.pendingApolloRequests || window.pendingRailsUJSRequests || 0').zero? # rubocop:disable Style/NumericPredicate + Capybara + .page + .evaluate_script('window.pendingRequests || window.pendingApolloRequests || window.pendingRailsUJSRequests || 0') + .zero? end end diff --git a/spec/support/shared_examples/features/milestone_editing_shared_examples.rb b/spec/support/shared_examples/features/milestone_editing_shared_examples.rb index 53498a1bb3963fbc72bdeea19198552466be17b5..062e8fc3644415af888176bf8951d93f3ceb7289 100644 --- a/spec/support/shared_examples/features/milestone_editing_shared_examples.rb +++ b/spec/support/shared_examples/features/milestone_editing_shared_examples.rb @@ -14,7 +14,7 @@ expect(page).to have_content( format( - _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), model_name: _('milestone'), link_to_model: _('milestone') ) diff --git a/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb b/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb index 6676fbf070e4774255c96bb36d6ac88f78939809..e001a96acb51394b6a22967e8fa6491a1f0decf3 100644 --- a/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb +++ b/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb @@ -131,7 +131,7 @@ context 'when current_user cannot push_code to project' do before do - allow(current_user).to receive(:can?).with(:push_code, project).and_return(false) # rubocop:disable CodeReuse/ActiveRecord -- false positive flag on `with` + allow(current_user).to receive(:can?).with(:push_code, project).and_return(false) end it { is_expected.to eq false } diff --git a/tooling/danger/sidekiq_queues.rb b/tooling/danger/sidekiq_queues.rb index bd6480fcba63525f050c9385e4174e7bf3543d60..ae32b12868207d6c6a546190a69de3c6de56c401 100644 --- a/tooling/danger/sidekiq_queues.rb +++ b/tooling/danger/sidekiq_queues.rb @@ -14,7 +14,7 @@ def added_queue_names def changed_queue_names @changed_queue_names ||= (new_queues.values_at(*old_queues.keys) - old_queues.values) - .compact.map { |queue| queue[:name] } # rubocop:disable Rails/Pluck + .compact.map { |queue| queue[:name] } end private diff --git a/tooling/danger/stable_branch.rb b/tooling/danger/stable_branch.rb index abeed0be88a849fcbec733dcd514986d81496748..13e867b843232f00e265198ef7aefa9ecd92a8e4 100644 --- a/tooling/danger/stable_branch.rb +++ b/tooling/danger/stable_branch.rb @@ -182,7 +182,7 @@ def versions(page = 1) raise VersionApiError unless response.success? - version_list = response.parsed_response.map { |v| v['version'] } # rubocop:disable Rails/Pluck + version_list = response.parsed_response.map { |v| v['version'] } version_list.sort_by { |v| Gem::Version.new(v) }.reverse end