From 31522c5182bf14886900131c12d17d004ce28534 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Aug 2022 09:11:27 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo/layout/hash_alignment.yml | 21 -- app/assets/javascripts/blob/sketch/index.js | 51 ++-- .../components/board_add_new_column_form.vue | 2 +- .../boards/components/board_blocked_icon.vue | 2 +- .../boards/components/board_card.vue | 6 +- .../boards/components/board_card_inner.vue | 25 +- .../boards/components/board_column.vue | 4 +- .../boards/components/board_content.vue | 2 +- .../boards/components/board_list.vue | 10 +- .../boards/components/board_list_header.vue | 16 +- .../boards/components/board_new_item.vue | 2 +- .../boards/components/issue_due_date.vue | 6 +- .../boards/components/issue_time_estimate.vue | 2 +- .../boards/components/item_count.vue | 4 +- .../components/action_buttons.vue | 8 +- .../components/extensions/base.vue | 7 +- .../components/extensions/child_content.vue | 1 + .../components/extensions/status_icon.vue | 1 + .../components/widget/widget.vue | 36 ++- .../extensions/test_report/index.js | 2 +- .../stylesheets/page_bundles/boards.scss | 240 +----------------- .../concerns/verifies_with_email.rb | 58 +---- .../groups/settings/repository_controller.rb | 11 +- app/models/ci/job_artifact.rb | 3 +- app/models/resource_timebox_event.rb | 3 +- app/models/users_star_project.rb | 2 +- .../resource_events/change_labels_service.rb | 5 +- .../system_notes/issuables_service.rb | 4 +- .../system_notes/time_tracking_service.rb | 14 +- .../users/email_verification/base_service.rb | 27 ++ .../generate_token_service.rb | 21 ++ .../validate_token_service.rb | 76 ++++++ .../groups/settings/repository/show.html.haml | 10 +- app/views/shared/boards/_show.html.haml | 2 +- config/dependency_decisions.yml | 6 - doc/user/free_user_limit.md | 11 +- .../integrations/gitlab_slack_application.md | 1 - doc/user/project/integrations/harbor.md | 10 +- .../import_export/group/import_export.yml | 38 +++ .../group/legacy_import_export.yml | 37 +++ .../import_export/group/relation_factory.rb | 3 +- .../issue_activity_unique_counter.rb | 18 +- lib/sidebars/groups/menus/settings_menu.rb | 27 +- locale/gitlab.pot | 3 - package.json | 1 - spec/features/groups/navbar_spec.rb | 1 + .../users/email_verification_on_login_spec.rb | 6 +- spec/frontend/blob/sketch/index_spec.js | 22 +- .../board_blocked_icon_spec.js.snap | 2 +- .../boards/components/item_count_spec.js | 4 +- .../new_failures_with_null_files_report.json | 40 +++ .../components/widget/widget_spec.js | 34 ++- .../extensions/test_report/index_spec.js | 10 + spec/lib/api/helpers/pagination_spec.rb | 2 +- spec/lib/backup/database_backup_error_spec.rb | 2 +- spec/lib/backup/task_spec.rb | 2 +- spec/lib/banzai/color_parser_spec.rb | 2 +- spec/lib/banzai/filter/output_safety_spec.rb | 2 +- spec/lib/banzai/filter_array_spec.rb | 2 +- spec/lib/banzai/pipeline_spec.rb | 2 +- spec/lib/banzai/querying_spec.rb | 2 +- spec/lib/bitbucket/collection_spec.rb | 2 +- spec/lib/bitbucket/page_spec.rb | 2 +- spec/lib/bitbucket/paginator_spec.rb | 2 +- .../bitbucket/representation/comment_spec.rb | 2 +- .../bitbucket/representation/issue_spec.rb | 2 +- .../pull_request_comment_spec.rb | 2 +- .../representation/pull_request_spec.rb | 2 +- .../lib/bitbucket/representation/repo_spec.rb | 2 +- .../lib/bitbucket/representation/user_spec.rb | 2 +- spec/lib/bitbucket_server/page_spec.rb | 2 +- .../pipeline/extracted_data_spec.rb | 2 +- spec/lib/bulk_imports/pipeline_spec.rb | 2 +- .../bulk_imports/retry_pipeline_error_spec.rb | 2 +- .../jira_encoded_url_constrainer_spec.rb | 2 +- spec/lib/declarative_enum_spec.rb | 2 +- spec/lib/error_tracking/sentry_client_spec.rb | 2 +- .../stage_events/stage_event_spec.rb | 2 +- .../base_strategy_spec.rb | 2 +- .../gitlab/asciidoc/html5_converter_spec.rb | 2 +- spec/lib/gitlab/audit/null_target_spec.rb | 2 +- spec/lib/gitlab/changes_list_spec.rb | 2 +- spec/lib/gitlab/chat/responder/base_spec.rb | 2 +- spec/lib/gitlab/ci/ansi2json/parser_spec.rb | 2 +- spec/lib/gitlab/ci/ansi2json/result_spec.rb | 2 +- .../gitlab/ci/build/artifacts/path_spec.rb | 2 +- spec/lib/gitlab/ci/build/policy_spec.rb | 2 +- spec/lib/gitlab/ci/build/port_spec.rb | 2 +- .../ci/config/entry/product/matrix_spec.rb | 2 +- spec/lib/gitlab/ci/mask_secret_spec.rb | 2 +- .../parsers/sbom/cyclonedx_properties_spec.rb | 2 +- .../sbom/source/dependency_scanning_spec.rb | 2 +- spec/lib/gitlab/ci/parsers_spec.rb | 2 +- spec/lib/gitlab/ci/pipeline/duration_spec.rb | 2 +- .../pipeline/expression/lexeme/null_spec.rb | 2 +- .../pipeline/expression/lexeme/string_spec.rb | 2 +- .../expression/lexeme/variable_spec.rb | 2 +- spec/lib/gitlab/ci/pipeline/metrics_spec.rb | 2 +- .../accessibility_reports_comparer_spec.rb | 2 +- .../ci/reports/accessibility_reports_spec.rb | 2 +- .../gitlab/ci/reports/coverage_report_spec.rb | 2 +- .../gitlab/ci/reports/sbom/component_spec.rb | 2 +- .../gitlab/ci/reports/sbom/reports_spec.rb | 2 +- .../lib/gitlab/ci/reports/sbom/source_spec.rb | 2 +- .../gitlab/ci/reports/security/flag_spec.rb | 2 +- .../gitlab/ci/reports/security/link_spec.rb | 2 +- .../gitlab/ci/reports/security/scan_spec.rb | 2 +- .../reports/security/scanned_resource_spec.rb | 2 +- .../ci/reports/terraform_reports_spec.rb | 2 +- spec/lib/gitlab/ci/status/extended_spec.rb | 2 +- .../gitlab/ci/status/group/factory_spec.rb | 2 +- spec/lib/gitlab/ci_access_spec.rb | 2 +- .../puma_worker_killer_observer_spec.rb | 2 +- .../gitlab/config/entry/attributable_spec.rb | 2 +- .../gitlab/config/entry/simplifiable_spec.rb | 2 +- .../lib/gitlab/config/entry/undefined_spec.rb | 2 +- .../gitlab/config/entry/unspecified_spec.rb | 2 +- .../check_collection_spec.rb | 2 +- .../cross_project_access/check_info_spec.rb | 2 +- .../class_methods_spec.rb | 2 +- spec/lib/gitlab/cross_project_access_spec.rb | 2 +- .../cycle_analytics/summary/value_spec.rb | 2 +- .../dependency_linker/parser/gemfile_spec.rb | 2 +- spec/lib/gitlab/dependency_linker_spec.rb | 2 +- .../diff/file_collection_sorter_spec.rb | 2 +- .../diff/inline_diff_markdown_marker_spec.rb | 2 +- .../gitlab/diff/inline_diff_marker_spec.rb | 2 +- .../experimentation/group_types_spec.rb | 2 +- spec/lib/gitlab/file_detector_spec.rb | 2 +- .../gitlab/file_markdown_link_builder_spec.rb | 2 +- spec/lib/gitlab/git/changed_path_spec.rb | 2 +- spec/lib/gitlab/git/changes_spec.rb | 2 +- spec/lib/gitlab/git/conflict/file_spec.rb | 2 +- spec/lib/gitlab/git/conflict/parser_spec.rb | 2 +- spec/lib/gitlab/git/gitmodules_parser_spec.rb | 2 +- spec/lib/gitlab/git/lfs_pointer_file_spec.rb | 2 +- spec/lib/gitlab/git/util_spec.rb | 2 +- spec/lib/gitlab/gitaly_client/diff_spec.rb | 2 +- .../gitaly_client/diff_stitcher_spec.rb | 2 +- spec/lib/gitlab/gitaly_client/util_spec.rb | 2 +- .../issue_and_label_links_importer_spec.rb | 2 +- .../diff_notes/suggestion_formatter_spec.rb | 2 +- .../representation/expose_attribute_spec.rb | 2 +- .../representation/lfs_object_spec.rb | 2 +- .../github_import/representation/note_spec.rb | 2 +- .../pull_request_review_spec.rb | 2 +- .../representation/pull_request_spec.rb | 2 +- .../representation/to_hash_spec.rb | 2 +- .../github_import/representation/user_spec.rb | 2 +- .../github_import/representation_spec.rb | 2 +- .../gitlab/health_checks/gitaly_check_spec.rb | 2 +- .../gitlab/health_checks/master_check_spec.rb | 2 +- spec/lib/gitlab/i18n/metadata_entry_spec.rb | 2 +- .../lib/gitlab/i18n/translation_entry_spec.rb | 2 +- .../import_export/attribute_cleaner_spec.rb | 2 +- .../import_export/json/legacy_writer_spec.rb | 2 +- spec/lib/gitlab/import_formatter_spec.rb | 2 +- spec/lib/gitlab/incoming_email_spec.rb | 2 +- .../gitlab/insecure_key_fingerprint_spec.rb | 2 +- .../internal_post_receive/response_spec.rb | 2 +- spec/lib/gitlab/jira/middleware_spec.rb | 2 +- .../jira_import/metadata_collector_spec.rb | 2 +- .../kubernetes/helm/v2/certificate_spec.rb | 2 +- .../kubeconfig/entry/cluster_spec.rb | 2 +- .../kubeconfig/entry/context_spec.rb | 2 +- .../kubernetes/kubeconfig/entry/user_spec.rb | 2 +- .../kubernetes/kubeconfig/template_spec.rb | 2 +- spec/lib/gitlab/lazy_spec.rb | 2 +- .../issuable_formatter_spec.rb | 2 +- spec/lib/gitlab/loop_helpers_spec.rb | 2 +- spec/lib/gitlab/markup_helper_spec.rb | 2 +- .../mergeability/results_store_spec.rb | 2 +- .../gitlab/metrics/dashboard/defaults_spec.rb | 2 +- spec/lib/gitlab/metrics/delta_spec.rb | 2 +- .../gitlab/metrics/rack_middleware_spec.rb | 2 +- spec/lib/gitlab/metrics/system_spec.rb | 2 +- spec/lib/gitlab/metrics/transaction_spec.rb | 2 +- .../lib/gitlab/middleware/release_env_spec.rb | 2 +- .../middleware/sidekiq_web_static_spec.rb | 2 +- .../gitlab/namespaced_session_store_spec.rb | 2 +- spec/lib/gitlab/nav/top_nav_menu_item_spec.rb | 2 +- spec/lib/gitlab/net_http_adapter_spec.rb | 2 +- spec/lib/gitlab/null_request_store_spec.rb | 2 +- .../representation/task_spec.rb | 2 +- .../representation/user_spec.rb | 2 +- spec/lib/gitlab/popen/runner_spec.rb | 2 +- spec/lib/gitlab/push_options_spec.rb | 2 +- .../substitution_definition_spec.rb | 2 +- spec/lib/gitlab/redis/boolean_spec.rb | 2 +- spec/lib/gitlab/render_timeout_spec.rb | 2 +- spec/lib/gitlab/service_desk_email_spec.rb | 2 +- spec/lib/gitlab/session_spec.rb | 2 +- .../lib/gitlab/setup_helper/workhorse_spec.rb | 2 +- .../size_limiter/server_spec.rb | 2 +- spec/lib/gitlab/sidekiq_signals_spec.rb | 2 +- .../sidekiq_status/server_middleware_spec.rb | 2 +- spec/lib/gitlab/slug/environment_spec.rb | 2 +- .../string_placeholder_replacer_spec.rb | 2 +- spec/lib/gitlab/string_range_marker_spec.rb | 2 +- spec/lib/gitlab/string_regex_marker_spec.rb | 2 +- spec/lib/gitlab/tcp_checker_spec.rb | 2 +- .../tracking/incident_management_spec.rb | 2 +- .../domain_allowlist_entry_spec.rb | 2 +- .../url_blockers/ip_allowlist_entry_spec.rb | 2 +- .../usage_data_counters/base_counter_spec.rb | 2 +- .../issue_activity_unique_counter_spec.rb | 20 +- spec/lib/gitlab/usage_data_counters_spec.rb | 2 +- spec/lib/gitlab/utils/deep_size_spec.rb | 2 +- .../gitlab/utils/json_size_estimator_spec.rb | 2 +- spec/lib/gitlab/utils/markdown_spec.rb | 2 +- spec/lib/gitlab/utils/merge_hash_spec.rb | 2 +- .../gitlab/word_diff/chunk_collection_spec.rb | 2 +- .../gitlab/word_diff/line_processor_spec.rb | 2 +- spec/lib/gitlab/word_diff/parser_spec.rb | 2 +- .../word_diff/positions_counter_spec.rb | 2 +- .../gitlab/word_diff/segments/chunk_spec.rb | 2 +- .../word_diff/segments/diff_hunk_spec.rb | 2 +- .../gitlab/word_diff/segments/newline_spec.rb | 2 +- spec/lib/gitlab_edition_spec.rb | 2 +- spec/lib/microsoft_teams/activity_spec.rb | 2 +- .../report_schema_version_matcher_spec.rb | 2 +- .../container_with_html_options_spec.rb | 2 +- .../concerns/link_with_html_options_spec.rb | 2 +- spec/lib/sidebars/menu_item_spec.rb | 2 +- spec/lib/system_check/base_check_spec.rb | 2 +- spec/models/user_spec.rb | 16 +- spec/models/users_star_project_spec.rb | 7 + .../change_labels_service_spec.rb | 19 +- .../time_tracking_service_spec.rb | 91 +++++-- .../generate_token_service_spec.rb | 37 +++ .../validate_token_service_spec.rb | 81 ++++++ .../navbar_structure_context.rb | 17 +- yarn.lock | 74 ++---- 233 files changed, 944 insertions(+), 718 deletions(-) create mode 100644 app/services/users/email_verification/base_service.rb create mode 100644 app/services/users/email_verification/generate_token_service.rb create mode 100644 app/services/users/email_verification/validate_token_service.rb create mode 100644 spec/frontend/reports/mock_data/new_failures_with_null_files_report.json create mode 100644 spec/models/users_star_project_spec.rb create mode 100644 spec/services/users/email_verification/generate_token_service_spec.rb create mode 100644 spec/services/users/email_verification/validate_token_service_spec.rb diff --git a/.rubocop_todo/layout/hash_alignment.yml b/.rubocop_todo/layout/hash_alignment.yml index 4a98bcea706..2a44a7a3798 100644 --- a/.rubocop_todo/layout/hash_alignment.yml +++ b/.rubocop_todo/layout/hash_alignment.yml @@ -29,27 +29,6 @@ Layout/HashAlignment: - 'ee/lib/gitlab/ci/parsers/security/formatters/dependency_list.rb' - 'ee/lib/gitlab/elastic/helper.rb' - 'ee/lib/gitlab/elastic/indexer.rb' - - 'ee/spec/controllers/ee/projects/variables_controller_spec.rb' - - 'ee/spec/controllers/groups/epic_boards_controller_spec.rb' - - 'ee/spec/controllers/groups/issues_controller_spec.rb' - - 'ee/spec/controllers/projects/settings/operations_controller_spec.rb' - - 'ee/spec/controllers/trials_controller_spec.rb' - - 'ee/spec/factories/dependencies.rb' - - 'ee/spec/factories/projects.rb' - - 'ee/spec/features/billings/billing_plans_spec.rb' - - 'ee/spec/features/groups/settings/protected_environments_spec.rb' - - 'ee/spec/features/projects/environments/environments_spec.rb' - - 'ee/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb' - - 'ee/spec/features/projects/feature_flags/user_updates_feature_flag_spec.rb' - - 'ee/spec/finders/epics_finder_spec.rb' - - 'ee/spec/finders/merge_requests_finder_spec.rb' - - 'ee/spec/frontend/fixtures/dast_profiles.rb' - - 'ee/spec/graphql/ee/mutations/ci/runner/update_spec.rb' - - 'ee/spec/graphql/ee/resolvers/namespace_projects_resolver_spec.rb' - - 'ee/spec/graphql/resolvers/path_locks_resolver_spec.rb' - - 'ee/spec/graphql/resolvers/security_orchestration/scan_execution_policy_resolver_spec.rb' - - 'ee/spec/graphql/resolvers/security_report_summary_resolver_spec.rb' - - 'ee/spec/graphql/resolvers/vulnerabilities/issue_links_resolver_spec.rb' - 'ee/spec/helpers/billing_plans_helper_spec.rb' - 'ee/spec/helpers/routing/pseudonymization_helper_spec.rb' - 'ee/spec/lib/ee/gitlab/auth/ldap/access_levels_spec.rb' diff --git a/app/assets/javascripts/blob/sketch/index.js b/app/assets/javascripts/blob/sketch/index.js index a92161bbc1b..bb29224cda2 100644 --- a/app/assets/javascripts/blob/sketch/index.js +++ b/app/assets/javascripts/blob/sketch/index.js @@ -1,5 +1,5 @@ import JSZip from 'jszip'; -import JSZipUtils from 'jszip-utils'; +import axios from '~/lib/utils/axios_utils'; import { __ } from '~/locale'; export default class SketchLoader { @@ -7,37 +7,30 @@ export default class SketchLoader { this.container = container; this.loadingIcon = this.container.querySelector('.js-loading-icon'); - this.load(); - } - - load() { - return this.getZipFile() - .then((data) => JSZip.loadAsync(data)) - .then((asyncResult) => asyncResult.files['previews/preview.png'].async('uint8array')) - .then((content) => { - const url = window.URL || window.webkitURL; - const blob = new Blob([new Uint8Array(content)], { - type: 'image/png', - }); - const previewUrl = url.createObjectURL(blob); - - this.render(previewUrl); - }) - .catch(this.error.bind(this)); - } - - getZipFile() { - return new Promise((resolve, reject) => { - JSZipUtils.getBinaryContent(this.container.dataset.endpoint, (err, data) => { - if (err) { - reject(err); - } else { - resolve(data); - } - }); + this.load().catch(() => { + this.error(); }); } + async load() { + const zipContents = await this.getZipContents(); + const previewContents = await zipContents.files['previews/preview.png'].async('uint8array'); + + const blob = new Blob([previewContents], { + type: 'image/png', + }); + + this.render(window.URL.createObjectURL(blob)); + } + + async getZipContents() { + const { data } = await axios.get(this.container.dataset.endpoint, { + responseType: 'arraybuffer', + }); + + return JSZip.loadAsync(data); + } + render(previewUrl) { const previewLink = document.createElement('a'); const previewImage = document.createElement('img'); diff --git a/app/assets/javascripts/boards/components/board_add_new_column_form.vue b/app/assets/javascripts/boards/components/board_add_new_column_form.vue index c4a2f83ab50..1899d42fa4d 100644 --- a/app/assets/javascripts/boards/components/board_add_new_column_form.vue +++ b/app/assets/javascripts/boards/components/board_add_new_column_form.vue @@ -102,7 +102,7 @@ export default { data-qa-selector="board_add_new_list" >

{{ $options.i18n.newList }} diff --git a/app/assets/javascripts/boards/components/board_blocked_icon.vue b/app/assets/javascripts/boards/components/board_blocked_icon.vue index b81edb4dfe6..73b3db3b387 100644 --- a/app/assets/javascripts/boards/components/board_blocked_icon.vue +++ b/app/assets/javascripts/boards/components/board_blocked_icon.vue @@ -154,7 +154,7 @@ export default { :id="glIconId" ref="icon" name="issue-block" - class="issue-blocked-icon gl-mr-2 gl-cursor-pointer" + class="issue-blocked-icon gl-mr-2 gl-cursor-pointer gl-text-red-500" data-testid="issue-blocked-icon" @mouseenter="handleMouseEnter" /> diff --git a/app/assets/javascripts/boards/components/board_card.vue b/app/assets/javascripts/boards/components/board_card.vue index 192bc4b5d25..4456f5a0d2e 100644 --- a/app/assets/javascripts/boards/components/board_card.vue +++ b/app/assets/javascripts/boards/components/board_card.vue @@ -81,10 +81,10 @@ export default { data-qa-selector="board_card" :class="[ { - 'multi-select': multiSelectVisible, + 'multi-select gl-bg-blue-50 gl-border-blue-200': multiSelectVisible, 'gl-cursor-grab': isDraggable, 'is-disabled': isDisabled, - 'is-active': isActive, + 'is-active gl-bg-blue-50': isActive, 'gl-cursor-not-allowed gl-bg-gray-10': item.isLoading, }, colorClass, @@ -95,7 +95,7 @@ export default { :data-item-path="item.referencePath" :style="cardStyle" data-testid="board_card" - class="board-card gl-p-5 gl-rounded-base" + class="board-card gl-p-5 gl-rounded-base gl-line-height-normal gl-relative gl-mb-3" @click="toggleIssue($event)" > diff --git a/app/assets/javascripts/boards/components/board_card_inner.vue b/app/assets/javascripts/boards/components/board_card_inner.vue index a9a4912d9e9..055ed912663 100644 --- a/app/assets/javascripts/boards/components/board_card_inner.vue +++ b/app/assets/javascripts/boards/components/board_card_inner.vue @@ -208,7 +208,7 @@ export default {