diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index 7f373769ded..68c71b359c2 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -91,7 +91,7 @@ gemnasium-python-dependency_scanning: yarn-audit-dependency_scanning: extends: .ds-analyzer - image: "${REGISTRY_HOST}/${REGISTRY_GROUP}/security-products/analyzers/npm-audit:1.4.1" + image: "${REGISTRY_HOST}/${REGISTRY_GROUP}/security-products/analyzers/npm-audit:1" variables: TOOL: yarn rules: !reference [".reports:rules:yarn-audit-dependency_scanning", rules] diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 3a8a8677706..ba64a1d91b1 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -184,6 +184,17 @@ - "*.yml" - "**/*.yml" +.lint-pipeline-yaml-patterns: &lint-pipeline-yaml-patterns + - ".gitlab-ci.yml" + - ".gitlab/ci/**/*.yml" + - "lib/gitlab/ci/templates/**/*.yml" + - "data/deprecations/**/*.yml" + - "data/removals/**/*.yml" + - "data/whats_new/**/*.yml" + +.lint-metrics-yaml-patterns: &lint-metrics-yaml-patterns + - "config/metrics/**/*.yml" + .docs-patterns: &docs-patterns - ".gitlab/route-map.yml" - "doc/**/*" @@ -1801,3 +1812,13 @@ rules: - <<: *if-default-refs changes: *yaml-lint-patterns + +.lint-pipeline-yaml:rules: + rules: + - <<: *if-default-refs + changes: *lint-pipeline-yaml-patterns + +.lint-metrics-yaml:rules: + rules: + - <<: *if-default-refs + changes: *lint-metrics-yaml-patterns diff --git a/.gitlab/ci/yaml.gitlab-ci.yml b/.gitlab/ci/yaml.gitlab-ci.yml index a0665d712dc..0420f158bbb 100644 --- a/.gitlab/ci/yaml.gitlab-ci.yml +++ b/.gitlab/ci/yaml.gitlab-ci.yml @@ -18,7 +18,7 @@ lint-yaml: lint-pipeline-yaml: extends: - .default-retry - - .yaml-lint:rules + - .lint-pipeline-yaml:rules image: pipelinecomponents/yamllint:latest stage: lint needs: [] @@ -30,7 +30,7 @@ lint-pipeline-yaml: lint-metrics-yaml: extends: - .default-retry - - .yaml-lint:rules + - .lint-metrics-yaml:rules image: pipelinecomponents/yamllint:latest stage: lint needs: [] diff --git a/.rubocop_todo/cop/user_admin.yml b/.rubocop_todo/cop/user_admin.yml index 5f0f7213950..ab5f76a002d 100644 --- a/.rubocop_todo/cop/user_admin.yml +++ b/.rubocop_todo/cop/user_admin.yml @@ -26,7 +26,6 @@ Cop/UserAdmin: - app/models/protected_branch.rb - app/models/user.rb - app/policies/note_policy.rb - - app/serializers/deploy_key_entity.rb - app/services/auth/container_registry_authentication_service.rb - app/services/emails/create_service.rb - app/services/projects/enable_deploy_key_service.rb diff --git a/.rubocop_todo/gitlab/feature_available_usage.yml b/.rubocop_todo/gitlab/feature_available_usage.yml index 2a0975a6e9b..168edd94f90 100644 --- a/.rubocop_todo/gitlab/feature_available_usage.yml +++ b/.rubocop_todo/gitlab/feature_available_usage.yml @@ -25,7 +25,6 @@ Gitlab/FeatureAvailableUsage: - ee/app/controllers/projects/subscriptions_controller.rb - ee/app/finders/autocomplete/vulnerabilities_autocomplete_finder.rb - ee/app/finders/clusters/agents_finder.rb - - ee/app/finders/ee/alert_management/alerts_finder.rb - ee/app/finders/ee/alert_management/http_integrations_finder.rb - ee/app/graphql/ee/types/group_type.rb - ee/app/graphql/mutations/dast/profiles/create.rb diff --git a/.rubocop_todo/gitlab/namespaced_class.yml b/.rubocop_todo/gitlab/namespaced_class.yml index 0125456954a..23ff86ba289 100644 --- a/.rubocop_todo/gitlab/namespaced_class.yml +++ b/.rubocop_todo/gitlab/namespaced_class.yml @@ -500,8 +500,6 @@ Gitlab/NamespacedClass: - 'app/serializers/current_board_entity.rb' - 'app/serializers/current_board_serializer.rb' - 'app/serializers/current_user_entity.rb' - - 'app/serializers/deploy_key_entity.rb' - - 'app/serializers/deploy_key_serializer.rb' - 'app/serializers/deploy_keys_project_entity.rb' - 'app/serializers/deployment_cluster_entity.rb' - 'app/serializers/deployment_entity.rb' @@ -770,7 +768,6 @@ Gitlab/NamespacedClass: - 'app/workers/error_tracking_issue_link_worker.rb' - 'app/workers/expire_build_artifacts_worker.rb' - 'app/workers/expire_job_cache_worker.rb' - - 'app/workers/expire_pipeline_cache_worker.rb' - 'app/workers/export_csv_worker.rb' - 'app/workers/external_service_reactive_caching_worker.rb' - 'app/workers/file_hook_worker.rb' @@ -812,7 +809,6 @@ Gitlab/NamespacedClass: - 'app/workers/post_receive.rb' - 'app/workers/process_commit_worker.rb' - 'app/workers/project_cache_worker.rb' - - 'app/workers/project_daily_statistics_worker.rb' - 'app/workers/project_destroy_worker.rb' - 'app/workers/project_export_worker.rb' - 'app/workers/propagate_integration_group_worker.rb' @@ -1017,7 +1013,6 @@ Gitlab/NamespacedClass: - 'ee/app/serializers/group_analytics_serializer.rb' - 'ee/app/serializers/group_vulnerability_autocomplete_entity.rb' - 'ee/app/serializers/group_vulnerability_autocomplete_serializer.rb' - - 'ee/app/serializers/invited_group_entity.rb' - 'ee/app/serializers/invited_group_serializer.rb' - 'ee/app/serializers/iteration_serializer.rb' - 'ee/app/serializers/license_entity.rb' @@ -1216,7 +1211,6 @@ Gitlab/NamespacedClass: - 'lib/gitlab/object_hierarchy.rb' - 'lib/gitlab/omniauth_initializer.rb' - 'lib/gitlab/otp_key_rotator.rb' - - 'lib/gitlab/pages_transfer.rb' - 'lib/gitlab/pipeline_scope_counts.rb' - 'lib/gitlab/polling_interval.rb' - 'lib/gitlab/process_memory_cache.rb' @@ -1270,7 +1264,6 @@ Gitlab/NamespacedClass: - 'lib/gitlab/unicode.rb' - 'lib/gitlab/untrusted_regexp.rb' - 'lib/gitlab/untrusted_regexp/ruby_syntax.rb' - - 'lib/gitlab/updated_notes_paginator.rb' - 'lib/gitlab/uploads_transfer.rb' - 'lib/gitlab/url_blocker.rb' - 'lib/gitlab/url_builder.rb' diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index 6cbc062aae6..e889a05ad36 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -293,7 +293,6 @@ Layout/ArgumentAlignment: - 'ee/app/controllers/subscriptions_controller.rb' - 'ee/app/finders/geo/registry_finder.rb' - 'ee/app/graphql/ee/mutations/boards/issues/issue_move_list.rb' - - 'ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.rb' - 'ee/app/graphql/ee/types/ci/pipeline_type.rb' - 'ee/app/graphql/ee/types/deprecated_mutations.rb' - 'ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb' @@ -395,7 +394,6 @@ Layout/ArgumentAlignment: - 'ee/spec/features/uncompleted_learn_gitlab_link_spec.rb' - 'ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb' - 'ee/spec/frontend/fixtures/search.rb' - - 'ee/spec/graphql/mutations/incident_management/timeline_event/create_spec.rb' - 'ee/spec/graphql/mutations/requirements_management/export_requirements_spec.rb' - 'ee/spec/helpers/billing_plans_helper_spec.rb' - 'ee/spec/helpers/ee/users/callouts_helper_spec.rb' diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 4c4e13b0436..16d22183345 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -383,7 +383,6 @@ Layout/LineLength: - 'app/models/concerns/redis_cacheable.rb' - 'app/models/concerns/restricted_signup.rb' - 'app/models/concerns/routable.rb' - - 'app/models/concerns/sha256_attribute.rb' - 'app/models/concerns/shardable.rb' - 'app/models/concerns/sortable.rb' - 'app/models/concerns/storage/legacy_namespace.rb' @@ -529,7 +528,6 @@ Layout/LineLength: - 'app/serializers/base_discussion_entity.rb' - 'app/serializers/build_details_entity.rb' - 'app/serializers/ci/pipeline_entity.rb' - - 'app/serializers/deploy_key_entity.rb' - 'app/serializers/deployment_cluster_entity.rb' - 'app/serializers/deployment_entity.rb' - 'app/serializers/diff_file_base_entity.rb' @@ -649,7 +647,6 @@ Layout/LineLength: - 'app/services/members/approve_access_request_service.rb' - 'app/services/members/destroy_service.rb' - 'app/services/members/invitation_reminder_email_service.rb' - - 'app/services/members/mailgun/process_webhook_service.rb' - 'app/services/members/update_service.rb' - 'app/services/merge_requests/add_context_service.rb' - 'app/services/merge_requests/assign_issues_service.rb' @@ -795,7 +792,6 @@ Layout/LineLength: - 'app/workers/packages/maven/metadata/sync_worker.rb' - 'app/workers/personal_access_tokens/expired_notification_worker.rb' - 'app/workers/pipeline_metrics_worker.rb' - - 'app/workers/quality/test_data_cleanup_worker.rb' - 'app/workers/repository_fork_worker.rb' - 'app/workers/repository_import_worker.rb' - 'app/workers/ssh_keys/expired_notification_worker.rb' @@ -831,7 +827,6 @@ Layout/LineLength: - 'config/initializers/wikicloth_redos_patch.rb' - 'config/initializers/zz_metrics.rb' - 'config/object_store_settings.rb' - - 'config/puma.rb' - 'config/routes.rb' - 'config/routes/admin.rb' - 'config/routes/api.rb' @@ -1176,7 +1171,6 @@ Layout/LineLength: - 'ee/app/controllers/projects/requirements_management/requirements_controller.rb' - 'ee/app/controllers/projects/security/policies_controller.rb' - 'ee/app/controllers/projects/security/vulnerabilities/notes_controller.rb' - - 'ee/app/controllers/projects/threat_monitoring_controller.rb' - 'ee/app/controllers/registrations/groups_controller.rb' - 'ee/app/controllers/registrations/groups_projects_controller.rb' - 'ee/app/controllers/subscriptions_controller.rb' @@ -1324,7 +1318,6 @@ Layout/LineLength: - 'ee/app/helpers/projects/security/dast_configuration_helper.rb' - 'ee/app/helpers/projects/security/dast_profiles_helper.rb' - 'ee/app/helpers/projects/security/discover_helper.rb' - - 'ee/app/helpers/projects/security/policies_helper.rb' - 'ee/app/helpers/push_rules_helper.rb' - 'ee/app/helpers/seats_count_alert_helper.rb' - 'ee/app/helpers/security_helper.rb' @@ -1524,7 +1517,6 @@ Layout/LineLength: - 'ee/app/services/ee/users/update_service.rb' - 'ee/app/services/elastic/cluster_reindexing_service.rb' - 'ee/app/services/elastic/indexing_control_service.rb' - - 'ee/app/services/epic_links/create_service.rb' - 'ee/app/services/epic_links/list_service.rb' - 'ee/app/services/epics/issue_promote_service.rb' - 'ee/app/services/epics/update_service.rb' @@ -1818,7 +1810,6 @@ Layout/LineLength: - 'ee/lib/gitlab/geo/jwt_request_decoder.rb' - 'ee/lib/gitlab/geo/log_cursor/events/repository_created_event.rb' - 'ee/lib/gitlab/geo/registry_batcher.rb' - - 'ee/lib/gitlab/geo/replication/base_downloader.rb' - 'ee/lib/gitlab/geo/replication/base_transfer.rb' - 'ee/lib/gitlab/geo/replication/blob_downloader.rb' - 'ee/lib/gitlab/geo/replicator.rb' diff --git a/.rubocop_todo/rspec/verified_doubles.yml b/.rubocop_todo/rspec/verified_doubles.yml index 0c920287bfe..a69ab9198b1 100644 --- a/.rubocop_todo/rspec/verified_doubles.yml +++ b/.rubocop_todo/rspec/verified_doubles.yml @@ -79,8 +79,6 @@ RSpec/VerifiedDoubles: - ee/spec/lib/gitlab/geo/log_cursor/lease_spec.rb - ee/spec/lib/gitlab/geo/oauth/logout_token_spec.rb - ee/spec/lib/gitlab/geo/oauth/session_spec.rb - - ee/spec/lib/gitlab/geo/replication/job_artifact_retriever_spec.rb - - ee/spec/lib/gitlab/geo/replication/job_artifact_transfer_spec.rb - ee/spec/lib/gitlab/geo/replicator_spec.rb - ee/spec/lib/gitlab/geo_spec.rb - ee/spec/lib/gitlab/git_access_spec.rb @@ -91,7 +89,6 @@ RSpec/VerifiedDoubles: - ee/spec/lib/gitlab/prometheus/queries/cluster_query_spec.rb - ee/spec/lib/gitlab/subscription_portal/clients/rest_spec.rb - ee/spec/lib/sidebars/groups/menus/analytics_menu_spec.rb - - ee/spec/lib/system_check/app/elasticsearch_check_spec.rb - ee/spec/lib/system_check/geo/geo_database_configured_check_spec.rb - ee/spec/models/app_sec/fuzzing/api/ci_configuration_spec.rb - ee/spec/models/approvable_spec.rb @@ -111,7 +108,6 @@ RSpec/VerifiedDoubles: - ee/spec/presenters/group_member_presenter_spec.rb - ee/spec/presenters/merge_request_approver_presenter_spec.rb - ee/spec/presenters/project_member_presenter_spec.rb - - ee/spec/requests/api/alert_management_alerts_spec.rb - ee/spec/requests/api/geo_spec.rb - ee/spec/requests/api/graphql/mutations/dast_site_profiles/delete_spec.rb - ee/spec/requests/api/internal/base_spec.rb @@ -142,7 +138,6 @@ RSpec/VerifiedDoubles: - ee/spec/serializers/issuable_sidebar_extras_entity_spec.rb - ee/spec/serializers/issues/linked_issue_feature_flag_entity_spec.rb - ee/spec/serializers/linked_feature_flag_issue_entity_spec.rb - - ee/spec/serializers/merge_request_compliance_entity_spec.rb - ee/spec/serializers/merge_request_poll_widget_entity_spec.rb - ee/spec/serializers/merge_request_sidebar_basic_entity_spec.rb - ee/spec/serializers/merge_request_widget_entity_spec.rb @@ -173,9 +168,6 @@ RSpec/VerifiedDoubles: - ee/spec/services/ee/merge_requests/refresh_service_spec.rb - ee/spec/services/ee/notification_service_spec.rb - ee/spec/services/ee/post_receive_service_spec.rb - - ee/spec/services/ee/service_ping/build_payload_service_spec.rb - - ee/spec/services/ee/service_ping/permit_data_categories_service_spec.rb - - ee/spec/services/ee/service_ping/service_ping_settings_spec.rb - ee/spec/services/geo/blob_download_service_spec.rb - ee/spec/services/geo/graphql_request_service_spec.rb - ee/spec/services/geo/node_status_request_service_spec.rb @@ -1040,8 +1032,6 @@ RSpec/VerifiedDoubles: - spec/services/repositories/changelog_service_spec.rb - spec/services/search_service_spec.rb - spec/services/service_ping/build_payload_service_spec.rb - - spec/services/service_ping/permit_data_categories_service_spec.rb - - spec/services/service_ping/service_ping_settings_spec.rb - spec/services/service_ping/submit_service_ping_service_spec.rb - spec/services/snippets/update_repository_storage_service_spec.rb - spec/services/spam/akismet_mark_as_spam_service_spec.rb @@ -1155,7 +1145,6 @@ RSpec/VerifiedDoubles: - spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb - spec/workers/gitlab_performance_bar_stats_worker_spec.rb - spec/workers/invalid_gpg_signature_update_worker_spec.rb - - spec/workers/issue_rebalancing_worker_spec.rb - spec/workers/issues/rebalancing_worker_spec.rb - spec/workers/merge_request_mergeability_check_worker_spec.rb - spec/workers/new_issue_worker_spec.rb diff --git a/.rubocop_todo/style/bare_percent_literals.yml b/.rubocop_todo/style/bare_percent_literals.yml index 658c6c22baa..104ead817d5 100644 --- a/.rubocop_todo/style/bare_percent_literals.yml +++ b/.rubocop_todo/style/bare_percent_literals.yml @@ -10,7 +10,6 @@ Style/BarePercentLiterals: - 'app/models/integrations/datadog.rb' - 'app/services/feature_flags/base_service.rb' - 'app/services/repositories/base_service.rb' - - 'app/services/repositories/destroy_rollback_service.rb' - 'app/services/repositories/destroy_service.rb' - 'ee/app/services/jira/jql_builder_service.rb' - 'ee/lib/ee/gitlab/checks/push_rules/file_size_check.rb' diff --git a/.rubocop_todo/style/class_and_module_children.yml b/.rubocop_todo/style/class_and_module_children.yml index 14f6ccad44f..fab05667adb 100644 --- a/.rubocop_todo/style/class_and_module_children.yml +++ b/.rubocop_todo/style/class_and_module_children.yml @@ -351,9 +351,7 @@ Style/ClassAndModuleChildren: - 'app/serializers/merge_requests/pipeline_entity.rb' - 'app/services/projects/branches_by_mode_service.rb' - 'app/services/repositories/base_service.rb' - - 'app/services/repositories/destroy_rollback_service.rb' - 'app/services/repositories/destroy_service.rb' - - 'app/services/repositories/shell_destroy_service.rb' - 'app/uploaders/dependency_proxy/file_uploader.rb' - 'app/uploaders/packages/composer/cache_uploader.rb' - 'app/uploaders/packages/debian/component_file_uploader.rb' diff --git a/.rubocop_todo/style/format_string.yml b/.rubocop_todo/style/format_string.yml index 13e118d6edc..a9065bb5932 100644 --- a/.rubocop_todo/style/format_string.yml +++ b/.rubocop_todo/style/format_string.yml @@ -182,7 +182,6 @@ Style/FormatString: - 'config/initializers/rack_lineprof.rb' - 'danger/roulette/Dangerfile' - 'ee/app/components/billing/plan_component.rb' - - 'ee/app/components/namespaces/preview_free_user_cap_alert_component.rb' - 'ee/app/controllers/admin/elasticsearch_controller.rb' - 'ee/app/controllers/admin/geo/application_controller.rb' - 'ee/app/controllers/admin/geo/projects_controller.rb' @@ -235,7 +234,6 @@ Style/FormatString: - 'ee/app/services/merge_requests/create_from_vulnerability_data_service.rb' - 'ee/app/services/namespaces/check_excess_storage_size_service.rb' - 'ee/app/services/namespaces/check_storage_size_service.rb' - - 'ee/app/services/network_policies/responses.rb' - 'ee/app/services/security/security_orchestration_policies/policy_configuration_validation_service.rb' - 'ee/app/services/security/security_orchestration_policies/validate_policy_service.rb' - 'ee/app/services/timebox_report_service.rb' diff --git a/.rubocop_todo/style/guard_clause.yml b/.rubocop_todo/style/guard_clause.yml index 008ccb971c4..c7109639677 100644 --- a/.rubocop_todo/style/guard_clause.yml +++ b/.rubocop_todo/style/guard_clause.yml @@ -60,7 +60,6 @@ Style/GuardClause: - 'app/finders/ci/runners_finder.rb' - 'app/finders/deployments_finder.rb' - 'app/finders/group_members_finder.rb' - - 'app/finders/projects/serverless/functions_finder.rb' - 'app/finders/snippets_finder.rb' - 'app/graphql/mutations/concerns/mutations/spam_protection.rb' - 'app/graphql/mutations/design_management/delete.rb' @@ -73,7 +72,6 @@ Style/GuardClause: - 'app/graphql/resolvers/concerns/time_frame_arguments.rb' - 'app/graphql/resolvers/projects/jira_projects_resolver.rb' - 'app/graphql/types/ci/job_type.rb' - - 'app/graphql/types/concerns/find_closest.rb' - 'app/helpers/admin/user_actions_helper.rb' - 'app/helpers/appearances_helper.rb' - 'app/helpers/application_helper.rb' @@ -235,7 +233,6 @@ Style/GuardClause: - 'app/services/post_receive_service.rb' - 'app/services/projects/after_rename_service.rb' - 'app/services/projects/create_service.rb' - - 'app/services/projects/destroy_rollback_service.rb' - 'app/services/projects/destroy_service.rb' - 'app/services/projects/hashed_storage/rollback_service.rb' - 'app/services/projects/import_export/export_service.rb' @@ -463,7 +460,6 @@ Style/GuardClause: - 'ee/lib/gitlab/insights/serializers/chartjs/multi_series_serializer.rb' - 'ee/lib/gitlab/insights/validators/params_validator.rb' - 'ee/lib/omni_auth/strategies/group_saml.rb' - - 'ee/lib/pseudonymizer/dumper.rb' - 'ee/spec/features/billings/billing_plans_spec.rb' - 'ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_spec.rb' - 'ee/spec/workers/update_max_seats_used_for_gitlab_com_subscriptions_worker_spec.rb' @@ -545,7 +541,6 @@ Style/GuardClause: - 'lib/gitlab/database/partitioning/sliding_list_strategy.rb' - 'lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin.rb' - 'lib/gitlab/database/query_analyzers/restrict_allowed_schemas.rb' - - 'lib/gitlab/diff/custom_diff.rb' - 'lib/gitlab/diff/file.rb' - 'lib/gitlab/diff/highlight.rb' - 'lib/gitlab/diff/highlight_cache.rb' @@ -580,7 +575,6 @@ Style/GuardClause: - 'lib/gitlab/graphql/pagination/keyset/conditions/null_condition.rb' - 'lib/gitlab/graphql/pagination/keyset/order_info.rb' - 'lib/gitlab/graphql/pagination/keyset/query_builder.rb' - - 'lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb' - 'lib/gitlab/i18n/metadata_entry.rb' - 'lib/gitlab/i18n/po_linter.rb' - 'lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb' diff --git a/.rubocop_todo/style/if_inside_else.yml b/.rubocop_todo/style/if_inside_else.yml index fcddbae74fc..3ce6e5ec704 100644 --- a/.rubocop_todo/style/if_inside_else.yml +++ b/.rubocop_todo/style/if_inside_else.yml @@ -14,7 +14,6 @@ Style/IfInsideElse: - 'app/models/ci/build.rb' - 'app/models/namespace.rb' - 'app/presenters/project_presenter.rb' - - 'app/services/service_ping/build_payload_service.rb' - 'app/services/system_notes/commit_service.rb' - 'app/services/task_list_toggle_service.rb' - 'app/services/user_project_access_changed_service.rb' diff --git a/.rubocop_todo/style/if_unless_modifier.yml b/.rubocop_todo/style/if_unless_modifier.yml index ddc6a477b85..645fc5f764c 100644 --- a/.rubocop_todo/style/if_unless_modifier.yml +++ b/.rubocop_todo/style/if_unless_modifier.yml @@ -8,7 +8,6 @@ Style/IfUnlessModifier: - 'app/channels/graphql_channel.rb' - 'app/controllers/admin/application_settings_controller.rb' - 'app/controllers/admin/projects_controller.rb' - - 'app/controllers/admin/requests_profiles_controller.rb' - 'app/controllers/admin/runners_controller.rb' - 'app/controllers/admin/users_controller.rb' - 'app/controllers/application_controller.rb' @@ -379,7 +378,6 @@ Style/IfUnlessModifier: - 'app/services/projects/update_repository_storage_service.rb' - 'app/services/resource_access_tokens/create_service.rb' - 'app/services/resource_events/change_labels_service.rb' - - 'app/services/service_ping/devops_report_service.rb' - 'app/services/snippets/create_service.rb' - 'app/services/snippets/destroy_service.rb' - 'app/services/snippets/repository_validation_service.rb' @@ -420,7 +418,6 @@ Style/IfUnlessModifier: - 'app/workers/concerns/worker_attributes.rb' - 'app/workers/database/batched_background_migration/single_database_worker.rb' - 'app/workers/file_hook_worker.rb' - - 'app/workers/issue_rebalancing_worker.rb' - 'app/workers/issues/rebalancing_worker.rb' - 'app/workers/merge_request_mergeability_check_worker.rb' - 'app/workers/object_storage/migrate_uploads_worker.rb' @@ -497,7 +494,6 @@ Style/IfUnlessModifier: - 'ee/app/controllers/projects/push_rules_controller.rb' - 'ee/app/controllers/projects/settings/slacks_controller.rb' - 'ee/app/controllers/trials_controller.rb' - - 'ee/app/finders/ee/alert_management/alerts_finder.rb' - 'ee/app/finders/iterations_finder.rb' - 'ee/app/finders/merge_trains_finder.rb' - 'ee/app/finders/security/pipeline_vulnerabilities_finder.rb' @@ -610,8 +606,6 @@ Style/IfUnlessModifier: - 'ee/app/services/ee/users/update_service.rb' - 'ee/app/services/elastic/indexing_control_service.rb' - 'ee/app/services/elastic/process_bookkeeping_service.rb' - - 'ee/app/services/epic_links/create_service.rb' - - 'ee/app/services/epic_links/update_service.rb' - 'ee/app/services/epics/base_service.rb' - 'ee/app/services/epics/create_service.rb' - 'ee/app/services/epics/update_dates_service.rb' @@ -719,7 +713,6 @@ Style/IfUnlessModifier: - 'ee/lib/gitlab/geo/log_cursor/daemon.rb' - 'ee/lib/gitlab/geo/log_cursor/events/repository_deleted_event.rb' - 'ee/lib/gitlab/geo/oauth/logout_token.rb' - - 'ee/lib/gitlab/geo/replication/base_transfer.rb' - 'ee/lib/gitlab/geo/replication/blob_downloader.rb' - 'ee/lib/gitlab/geo/replicator.rb' - 'ee/lib/gitlab/graphql/aggregations/epics/lazy_epic_aggregate.rb' @@ -735,13 +728,10 @@ Style/IfUnlessModifier: - 'ee/lib/gitlab/usage/metrics/instrumentations/count_users_creating_ci_builds_metric.rb' - 'ee/lib/gitlab/usage/metrics/instrumentations/license_metric.rb' - 'ee/lib/omni_auth/strategies/group_saml.rb' - - 'ee/lib/pseudonymizer/dumper.rb' - - 'ee/lib/pseudonymizer/uploader.rb' - 'ee/lib/sidebars/groups/menus/administration_menu.rb' - 'ee/lib/sidebars/groups/menus/analytics_menu.rb' - 'ee/lib/sidebars/groups/menus/security_compliance_menu.rb' - 'ee/lib/tasks/geo.rake' - - 'ee/lib/tasks/gitlab/db.rake' - 'ee/lib/tasks/gitlab/geo.rake' - 'ee/lib/tasks/gitlab/seed/insights.rake' - 'ee/spec/controllers/subscriptions_controller_spec.rb' @@ -945,7 +935,6 @@ Style/IfUnlessModifier: - 'lib/gitlab/database/reindexing/reindex_concurrently.rb' - 'lib/gitlab/database/transaction/observer.rb' - 'lib/gitlab/database/with_lock_retries.rb' - - 'lib/gitlab/diff/custom_diff.rb' - 'lib/gitlab/diff/formatters/base_formatter.rb' - 'lib/gitlab/diff/rendered/notebook/diff_file.rb' - 'lib/gitlab/elasticsearch/logs/lines.rb' @@ -1154,7 +1143,6 @@ Style/IfUnlessModifier: - 'rubocop/cop/ignored_columns.rb' - 'rubocop/cop/migration/add_limit_to_text_columns.rb' - 'rubocop/cop/migration/add_reference.rb' - - 'rubocop/cop/migration/hash_index.rb' - 'rubocop/cop/migration/remove_column.rb' - 'rubocop/cop/migration/sidekiq_queue_migrate.rb' - 'rubocop/cop/performance/ar_exists_and_present_blank.rb' diff --git a/.rubocop_todo/style/next.yml b/.rubocop_todo/style/next.yml index e1f9b927db6..ba2bd293696 100644 --- a/.rubocop_todo/style/next.yml +++ b/.rubocop_todo/style/next.yml @@ -5,7 +5,6 @@ Style/Next: # Temporarily disabled due to too many offenses Enabled: false Exclude: - - 'app/finders/projects/serverless/functions_finder.rb' - 'app/models/preloaders/environments/deployment_preloader.rb' - 'app/models/route.rb' - 'app/services/authorized_project_update/find_records_due_for_refresh_service.rb' diff --git a/.rubocop_todo/style/numeric_literal_prefix.yml b/.rubocop_todo/style/numeric_literal_prefix.yml index b469a68ff5a..ea0b028d11c 100644 --- a/.rubocop_todo/style/numeric_literal_prefix.yml +++ b/.rubocop_todo/style/numeric_literal_prefix.yml @@ -10,16 +10,12 @@ Style/NumericLiteralPrefix: - 'config/initializers/01_secret_token.rb' - 'config/initializers/1_settings.rb' - 'db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb' - - 'ee/lib/gitlab/geo/replication/base_transfer.rb' - 'ee/lib/gitlab/geo/replication/blob_downloader.rb' - 'ee/spec/lib/bulk_imports/groups/pipelines/iterations_pipeline_spec.rb' - 'ee/spec/lib/gitlab/background_migration/remove_all_trace_expiration_dates_spec.rb' - 'ee/spec/lib/gitlab/geo/replication/blob_downloader_spec.rb' - - 'ee/spec/lib/gitlab/geo/replication/file_transfer_spec.rb' - - 'ee/spec/lib/gitlab/geo/replication/job_artifact_transfer_spec.rb' - 'ee/spec/migrations/schedule_trace_expiry_removal_spec.rb' - 'ee/spec/models/analytics/devops_adoption/snapshot_spec.rb' - - 'ee/spec/models/ci/minutes/quota_spec.rb' - 'ee/spec/models/ee/group_spec.rb' - 'ee/spec/models/gitlab/seat_link_data_spec.rb' - 'ee/spec/services/incident_management/oncall_schedules/update_service_spec.rb' diff --git a/.rubocop_todo/style/percent_literal_delimiters.yml b/.rubocop_todo/style/percent_literal_delimiters.yml index 8611181f430..487e0e7cd20 100644 --- a/.rubocop_todo/style/percent_literal_delimiters.yml +++ b/.rubocop_todo/style/percent_literal_delimiters.yml @@ -177,7 +177,6 @@ Style/PercentLiteralDelimiters: - 'app/services/projects/update_service.rb' - 'app/services/prometheus/proxy_service.rb' - 'app/services/repositories/base_service.rb' - - 'app/services/repositories/destroy_rollback_service.rb' - 'app/services/repositories/destroy_service.rb' - 'app/services/repository_archive_clean_up_service.rb' - 'app/services/resource_access_tokens/create_service.rb' @@ -293,7 +292,6 @@ Style/PercentLiteralDelimiters: - 'ee/lib/api/managed_licenses.rb' - 'ee/lib/api/status_checks.rb' - 'ee/lib/api/visual_review_discussions.rb' - - 'ee/lib/banzai/pipeline/incident_management/timeline_event_pipeline.rb' - 'ee/lib/ee/api/helpers/members_helpers.rb' - 'ee/lib/ee/api/helpers/projects_helpers.rb' - 'ee/lib/ee/api/search.rb' @@ -305,7 +303,6 @@ Style/PercentLiteralDelimiters: - 'ee/lib/ee/gitlab/checks/push_rules/file_size_check.rb' - 'ee/lib/ee/gitlab/ci/parsers/security/validators/schema_validator.rb' - 'ee/lib/ee/gitlab/etag_caching/router/rails.rb' - - 'ee/lib/ee/gitlab/integrations/sti_type.rb' - 'ee/lib/ee/gitlab/middleware/read_only/controller.rb' - 'ee/lib/ee/gitlab/path_regex.rb' - 'ee/lib/ee/gitlab/uploads/migration_helper.rb' @@ -316,7 +313,6 @@ Style/PercentLiteralDelimiters: - 'ee/lib/elastic/latest/git_class_proxy.rb' - 'ee/lib/elastic/latest/project_instance_proxy.rb' - 'ee/lib/elastic/latest/snippet_class_proxy.rb' - - 'ee/lib/gitlab/alert_management/payload/cilium.rb' - 'ee/lib/gitlab/auth/group_saml/auth_hash.rb' - 'ee/lib/gitlab/ci/parsers/security/formatters/dast.rb' - 'ee/lib/gitlab/geo.rb' @@ -368,7 +364,6 @@ Style/PercentLiteralDelimiters: - 'ee/spec/lib/banzai/filter/references/epic_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/iteration_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/vulnerability_reference_filters_spec.rb' - - 'ee/spec/lib/banzai/pipeline/incident_management/timeline_event_pipeline_spec.rb' - 'ee/spec/lib/ee/gitlab/alert_management/payload/generic_spec.rb' - 'ee/spec/lib/ee/gitlab/auth/ldap/access_levels_spec.rb' - 'ee/spec/lib/ee/gitlab/auth/ldap/config_spec.rb' @@ -558,7 +553,6 @@ Style/PercentLiteralDelimiters: - 'lib/gitlab/gitaly_client/diff.rb' - 'lib/gitlab/gitaly_client/wiki_page.rb' - 'lib/gitlab/graphql/pagination/keyset/order_info.rb' - - 'lib/gitlab/graphql/query_analyzers/recursion_analyzer.rb' - 'lib/gitlab/hotlinking_detector.rb' - 'lib/gitlab/import_export/command_line_util.rb' - 'lib/gitlab/import_export/file_importer.rb' @@ -645,10 +639,6 @@ Style/PercentLiteralDelimiters: - 'rubocop/migration_helpers.rb' - 'scripts/qa/testcases-check' - 'scripts/regenerate-schema' - - 'shared/packages/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b/packages/57/files/67/package.gemspec' - - 'shared/packages/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b/packages/6/files/5/package.gemspec' - - 'shared/packages/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b/packages/7/files/7/package.gemspec' - - 'shared/packages/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b/packages/88/files/91/package.gemspec' - 'sidekiq_cluster/cli.rb' - 'spec/benchmarks/banzai_benchmark.rb' - 'spec/commands/sidekiq_cluster/cli_spec.rb' @@ -894,7 +884,6 @@ Style/PercentLiteralDelimiters: - 'spec/lib/gitlab/jira_import/issue_serializer_spec.rb' - 'spec/lib/gitlab/jira_import/labels_importer_spec.rb' - 'spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb' - - 'spec/lib/gitlab/kubernetes/network_policy_spec.rb' - 'spec/lib/gitlab/kubernetes/role_spec.rb' - 'spec/lib/gitlab/language_data_spec.rb' - 'spec/lib/gitlab/markup_helper_spec.rb' diff --git a/.rubocop_todo/style/redundant_interpolation.yml b/.rubocop_todo/style/redundant_interpolation.yml index fb190ff2100..0d3651eb7b2 100644 --- a/.rubocop_todo/style/redundant_interpolation.yml +++ b/.rubocop_todo/style/redundant_interpolation.yml @@ -77,7 +77,6 @@ Style/RedundantInterpolation: - 'qa/qa/resource/events/base.rb' - 'qa/qa/service/praefect_manager.rb' - 'qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb' - - 'qa/qa/specs/features/browser_ui/4_verify/pipeline/parent_child_pipelines_dependent_relationship_spec.rb' - 'qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_spec.rb' - 'qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb' - 'qa/qa/tools/generate_perf_testdata.rb' diff --git a/.rubocop_todo/style/redundant_regexp_escape.yml b/.rubocop_todo/style/redundant_regexp_escape.yml index 1a88f62ab64..969a23601ca 100644 --- a/.rubocop_todo/style/redundant_regexp_escape.yml +++ b/.rubocop_todo/style/redundant_regexp_escape.yml @@ -35,7 +35,6 @@ Style/RedundantRegexpEscape: - 'ee/lib/gitlab/geo/git_ssh_proxy.rb' - 'ee/lib/gitlab/return_to_location.rb' - 'ee/spec/features/read_only_spec.rb' - - 'ee/spec/helpers/seats_count_alert_helper_spec.rb' - 'ee/spec/helpers/vulnerabilities_helper_spec.rb' - 'ee/spec/lib/ee/gitlab/usage_data_counters/hll_redis_counter_spec.rb' - 'ee/spec/mailers/notify_spec.rb' diff --git a/.rubocop_todo/style/redundant_self.yml b/.rubocop_todo/style/redundant_self.yml index e363f83761b..1aba23c90ae 100644 --- a/.rubocop_todo/style/redundant_self.yml +++ b/.rubocop_todo/style/redundant_self.yml @@ -260,7 +260,6 @@ Style/RedundantSelf: - 'ee/lib/elastic/latest/note_config.rb' - 'ee/lib/elastic/migration.rb' - 'ee/lib/gem_extensions/elasticsearch/model/indexing/instance_methods.rb' - - 'ee/lib/gitlab/alert_management/payload/cilium.rb' - 'ee/lib/gitlab/analytics/cycle_analytics/summary/base_time.rb' - 'ee/lib/gitlab/auth/group_saml/response_check.rb' - 'ee/lib/gitlab/auth/group_saml/user.rb' @@ -277,7 +276,6 @@ Style/RedundantSelf: - 'ee/lib/gitlab/geo/oauth/logout_state.rb' - 'ee/lib/gitlab/geo/replicator.rb' - 'ee/lib/gitlab/template/custom_template.rb' - - 'ee/lib/system_check/app/elasticsearch_check.rb' - 'ee/spec/helpers/ee/feature_flags_helper_spec.rb' - 'ee/spec/helpers/ee/graph_helper_spec.rb' - 'ee/spec/models/geo/deleted_project_spec.rb' @@ -365,8 +363,6 @@ Style/RedundantSelf: - 'lib/gitlab/instrumentation/redis_base.rb' - 'lib/gitlab/jira_import.rb' - 'lib/gitlab/jwt_token.rb' - - 'lib/gitlab/kubernetes/cilium_network_policy.rb' - - 'lib/gitlab/kubernetes/network_policy.rb' - 'lib/gitlab/logger.rb' - 'lib/gitlab/marker_range.rb' - 'lib/gitlab/memory/instrumentation.rb' diff --git a/.rubocop_todo/style/string_concatenation.yml b/.rubocop_todo/style/string_concatenation.yml index e21fecfb5e3..8c8dbf86b1c 100644 --- a/.rubocop_todo/style/string_concatenation.yml +++ b/.rubocop_todo/style/string_concatenation.yml @@ -301,11 +301,9 @@ Style/StringConcatenation: - 'spec/services/packages/helm/extract_file_metadata_service_spec.rb' - 'spec/services/packages/helm/process_file_service_spec.rb' - 'spec/services/projects/create_service_spec.rb' - - 'spec/services/projects/destroy_rollback_service_spec.rb' - 'spec/services/projects/destroy_service_spec.rb' - 'spec/services/projects/download_service_spec.rb' - 'spec/services/push_event_payload_service_spec.rb' - - 'spec/services/repositories/destroy_rollback_service_spec.rb' - 'spec/services/repositories/destroy_service_spec.rb' - 'spec/services/snippets/bulk_destroy_service_spec.rb' - 'spec/services/snippets/update_service_spec.rb' diff --git a/.rubocop_todo/style/string_literals_in_interpolation.yml b/.rubocop_todo/style/string_literals_in_interpolation.yml index 3f3cb007306..cded81afa7f 100644 --- a/.rubocop_todo/style/string_literals_in_interpolation.yml +++ b/.rubocop_todo/style/string_literals_in_interpolation.yml @@ -24,7 +24,6 @@ Style/StringLiteralsInInterpolation: - 'ee/app/models/license.rb' - 'ee/app/services/epics/tree_reorder_service.rb' - 'ee/lib/gitlab/elastic/helper.rb' - - 'ee/lib/pseudonymizer/pager.rb' - 'ee/spec/features/admin/admin_settings_spec.rb' - 'lib/api/helpers/snippets_helpers.rb' - 'lib/api/validations/validators/check_assignees_count.rb' @@ -54,7 +53,6 @@ Style/StringLiteralsInInterpolation: - 'qa/qa/specs/helpers/context_selector.rb' - 'qa/qa/tools/generate_perf_testdata.rb' - 'rubocop/cop/migration/prevent_index_creation.rb' - - 'spec/controllers/projects/serverless/functions_controller_spec.rb' - 'spec/features/commits_spec.rb' - 'spec/features/dashboard/merge_requests_spec.rb' - 'spec/features/users/login_spec.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c8d2417bb4..1c178782ebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 15.0.3 (2022-06-16) + +### Fixed (2 changes) + +- [Disconnect alternates when unlinking from a repository pool](gitlab-org/gitlab@a6f4b701af0d5850a10d77feeb4842b1fe017047) ([merge request](gitlab-org/gitlab!90269)) +- [Add GitLab agent image tag to install command](gitlab-org/gitlab@09decb04e391f095139412ed623164cab8023a7c) ([merge request](gitlab-org/gitlab!90269)) + ## 15.0.2 (2022-06-06) ### Added (1 change) diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index e8f59312593..2422b2f9464 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -14.7.3 +14.7.4 diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 8d46ea76be1..e7a5f5ecc06 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -1,4 +1,4 @@ -import createFlash from '~/flash'; +import { createAlert } from '~/flash'; import { __ } from '~/locale'; import axios from './lib/utils/axios_utils'; import { joinPaths } from './lib/utils/url_utility'; @@ -464,7 +464,7 @@ const Api = { throw error; } - createFlash({ + createAlert({ message: __('Something went wrong while fetching projects'), }); @@ -654,7 +654,7 @@ const Api = { }) .then(({ data }) => callback(data)) .catch(() => - createFlash({ + createAlert({ message: __('Something went wrong while fetching projects'), }), ); diff --git a/app/assets/javascripts/behaviors/components/sandboxed_mermaid.vue b/app/assets/javascripts/behaviors/components/sandboxed_mermaid.vue new file mode 100644 index 00000000000..6b4110cff02 --- /dev/null +++ b/app/assets/javascripts/behaviors/components/sandboxed_mermaid.vue @@ -0,0 +1,77 @@ + + diff --git a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js index 543e676e85e..077e96b2fee 100644 --- a/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_sandboxed_mermaid.js @@ -32,7 +32,8 @@ const MAX_CHAR_LIMIT = 2000; const MAX_MERMAID_BLOCK_LIMIT = 50; // Max # of `&` allowed in Chaining of links syntax const MAX_CHAINING_OF_LINKS_LIMIT = 30; -const BUFFER_IFRAME_HEIGHT = 10; +export const BUFFER_IFRAME_HEIGHT = 10; +export const SANDBOX_ATTRIBUTES = 'allow-scripts allow-popups'; // Keep a map of mermaid blocks we've already rendered. const elsProcessingMap = new WeakMap(); let renderedMermaidBlocks = 0; @@ -56,7 +57,7 @@ function fixElementSource(el) { return { source }; } -function getSandboxFrameSrc() { +export function getSandboxFrameSrc() { const path = joinPaths(gon.relative_url_root || '', SANDBOX_FRAME_PATH); if (!darkModeEnabled()) { return path; @@ -69,7 +70,7 @@ function renderMermaidEl(el, source) { const iframeEl = document.createElement('iframe'); setAttributes(iframeEl, { src: getSandboxFrameSrc(), - sandbox: 'allow-scripts allow-popups', + sandbox: SANDBOX_ATTRIBUTES, frameBorder: 0, scrolling: 'no', width: '100%', diff --git a/app/assets/javascripts/content_editor/components/bubble_menus/code_block.vue b/app/assets/javascripts/content_editor/components/bubble_menus/code_block.vue index 4ed89140e5b..6c0ac8e54d2 100644 --- a/app/assets/javascripts/content_editor/components/bubble_menus/code_block.vue +++ b/app/assets/javascripts/content_editor/components/bubble_menus/code_block.vue @@ -36,16 +36,19 @@ export default { directives: { GlTooltip, }, - inject: ['tiptapEditor'], + inject: ['tiptapEditor', 'contentEditor'], data() { return { codeBlockType: undefined, - selectedLanguage: {}, filterTerm: '', filteredLanguages: [], showCustomLanguageInput: false, customLanguageType: '', + + selectedLanguage: {}, + isDiagram: false, + showPreview: false, }; }, watch: { @@ -61,21 +64,36 @@ export default { return CODE_BLOCK_NODE_TYPES.some((type) => editor.isActive(type)); }, - updateSelectedLanguage() { + async updateCodeBlockInfoToState() { this.codeBlockType = CODE_BLOCK_NODE_TYPES.find((type) => this.tiptapEditor.isActive(type)); - if (this.codeBlockType) { - const { language } = this.tiptapEditor.getAttributes(this.codeBlockType); - this.selectedLanguage = codeBlockLanguageLoader.findOrCreateLanguageBySyntax(language); - } + if (!this.codeBlockType) return; + + const { language, isDiagram, showPreview } = this.tiptapEditor.getAttributes( + this.codeBlockType, + ); + this.selectedLanguage = codeBlockLanguageLoader.findOrCreateLanguageBySyntax( + language, + isDiagram, + ); + this.isDiagram = isDiagram; + this.showPreview = showPreview; }, - copyCodeBlockText() { + getCodeBlockText() { const { view } = this.tiptapEditor; const { from } = this.tiptapEditor.state.selection; const node = getParentByTagName(view.domAtPos(from).node, 'pre'); + return node?.textContent || ''; + }, - navigator.clipboard.writeText(node?.textContent || ''); + copyCodeBlockText() { + navigator.clipboard.writeText(this.getCodeBlockText()); + }, + + togglePreview() { + this.showPreview = !this.showPreview; + this.tiptapEditor.commands.updateAttributes(Diagram.name, { showPreview: this.showPreview }); }, async applyLanguage(language) { @@ -125,7 +143,7 @@ export default { getReferenceClientRect, } /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */" > - + + +import { GlDropdown, GlDropdownItem, GlTooltipDirective as GlTooltip } from '@gitlab/ui'; + +export default { + components: { + GlDropdown, + GlDropdownItem, + }, + directives: { + GlTooltip, + }, + inject: ['tiptapEditor'], + methods: { + execute(contentType, attrs) { + this.tiptapEditor.chain().focus().setNode(contentType, attrs).run(); + + this.$emit('execute', { contentType }); + }, + }, +}; + + diff --git a/app/assets/javascripts/content_editor/components/top_toolbar.vue b/app/assets/javascripts/content_editor/components/top_toolbar.vue index 19e150a4da9..b652e634b0c 100644 --- a/app/assets/javascripts/content_editor/components/top_toolbar.vue +++ b/app/assets/javascripts/content_editor/components/top_toolbar.vue @@ -5,6 +5,7 @@ import ToolbarImageButton from './toolbar_image_button.vue'; import ToolbarLinkButton from './toolbar_link_button.vue'; import ToolbarTableButton from './toolbar_table_button.vue'; import ToolbarTextStyleDropdown from './toolbar_text_style_dropdown.vue'; +import ToolbarMoreDropdown from './toolbar_more_dropdown.vue'; export default { components: { @@ -13,6 +14,7 @@ export default { ToolbarLinkButton, ToolbarTableButton, ToolbarImageButton, + ToolbarMoreDropdown, }, methods: { trackToolbarControlExecution({ contentType, value }) { @@ -117,16 +119,8 @@ export default { :label="__('Add a collapsible section')" @execute="trackToolbarControlExecution" /> - - + + diff --git a/app/assets/javascripts/work_items/components/item_title.vue b/app/assets/javascripts/work_items/components/item_title.vue index 232510b108d..ce2fa158596 100644 --- a/app/assets/javascripts/work_items/components/item_title.vue +++ b/app/assets/javascripts/work_items/components/item_title.vue @@ -40,18 +40,18 @@ export default { diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index d9e92ead86c..da8fe222b6a 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -115,7 +115,7 @@ export default {