diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-17 06:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-17 06:08:51 +0300 |
commit | bb6a3bf05eca11bede23c89a4b2a80a946707307 (patch) | |
tree | 18086fbc00d3c13112c4e64dcfe0ef5462fd1fd3 | |
parent | f52c68bbac191605f793686c472425b000a0879a (diff) |
Add latest changes from gitlab-org/gitlab@master
142 files changed, 512 insertions, 498 deletions
diff --git a/.rubocop_todo/rspec/missing_feature_category.yml b/.rubocop_todo/rspec/missing_feature_category.yml index ada21f3d228..bbd6cccef0f 100644 --- a/.rubocop_todo/rspec/missing_feature_category.yml +++ b/.rubocop_todo/rspec/missing_feature_category.yml @@ -1653,7 +1653,6 @@ RSpec/MissingFeatureCategory: - 'ee/spec/services/arkose/blocked_users_report_service_spec.rb' - 'ee/spec/services/arkose/record_user_data_service_spec.rb' - 'ee/spec/services/arkose/token_verification_service_spec.rb' - - 'ee/spec/services/audit_event_service_spec.rb' - 'ee/spec/services/audit_events/build_service_spec.rb' - 'ee/spec/services/audit_events/custom_audit_event_service_spec.rb' - 'ee/spec/services/audit_events/impersonation_audit_event_service_spec.rb' @@ -1676,7 +1675,6 @@ RSpec/MissingFeatureCategory: - 'ee/spec/services/auto_merge/merge_when_pipeline_succeeds_service_spec.rb' - 'ee/spec/services/award_emojis/add_service_spec.rb' - 'ee/spec/services/award_emojis/destroy_service_spec.rb' - - 'ee/spec/services/base_count_service_spec.rb' - 'ee/spec/services/billable_members/destroy_service_spec.rb' - 'ee/spec/services/boards/create_service_spec.rb' - 'ee/spec/services/boards/epic_boards/create_service_spec.rb' @@ -1695,28 +1693,11 @@ RSpec/MissingFeatureCategory: - 'ee/spec/services/boards/update_service_spec.rb' - 'ee/spec/services/boards/user_preferences/update_service_spec.rb' - 'ee/spec/services/branches/delete_service_spec.rb' - - 'ee/spec/services/ee/auto_merge_service_spec.rb' - - 'ee/spec/services/ee/event_create_service_spec.rb' - - 'ee/spec/services/ee/merge_request_metrics_service_spec.rb' - 'ee/spec/services/ee/notes/destroy_service_spec.rb' - 'ee/spec/services/ee/notes/post_process_service_spec.rb' - 'ee/spec/services/ee/notes/quick_actions_service_spec.rb' - 'ee/spec/services/ee/notes/update_service_spec.rb' - - 'ee/spec/services/ee/null_notification_service_spec.rb' - - 'ee/spec/services/ee/post_receive_service_spec.rb' - - 'ee/spec/services/ee/preview_markdown_service_spec.rb' - - 'ee/spec/services/ee/users/approve_service_spec.rb' - - 'ee/spec/services/ee/users/authorized_build_service_spec.rb' - - 'ee/spec/services/ee/users/block_service_spec.rb' - - 'ee/spec/services/ee/users/build_service_spec.rb' - - 'ee/spec/services/ee/users/create_service_spec.rb' - - 'ee/spec/services/ee/users/destroy_service_spec.rb' - - 'ee/spec/services/ee/users/migrate_records_to_ghost_user_service_spec.rb' - - 'ee/spec/services/ee/users/reject_service_spec.rb' - - 'ee/spec/services/ee/users/update_service_spec.rb' - - 'ee/spec/services/ee/vulnerability_feedback_module/update_service_spec.rb' - 'ee/spec/services/external_status_checks/create_service_spec.rb' - - 'ee/spec/services/ldap_group_reset_service_spec.rb' - 'ee/spec/services/projects/after_rename_service_spec.rb' - 'ee/spec/services/projects/alerting/notify_service_spec.rb' - 'ee/spec/services/projects/cleanup_service_spec.rb' @@ -1756,33 +1737,7 @@ RSpec/MissingFeatureCategory: - 'ee/spec/services/requirements_management/process_test_reports_service_spec.rb' - 'ee/spec/services/resource_access_tokens/create_service_spec.rb' - 'ee/spec/services/resource_access_tokens/revoke_service_spec.rb' - - 'ee/spec/services/start_pull_mirroring_service_spec.rb' - - 'ee/spec/services/system_note_service_spec.rb' - 'ee/spec/services/timebox_report_service_spec.rb' - - 'ee/spec/services/todo_service_spec.rb' - - 'ee/spec/services/users/abuse/namespace_bans/create_service_spec.rb' - - 'ee/spec/services/users/abuse/namespace_bans/destroy_service_spec.rb' - - 'ee/spec/services/users/abuse/projects_download_ban_check_service_spec.rb' - - 'ee/spec/services/users/captcha_challenge_service_spec.rb' - - 'ee/spec/services/users/update_highest_member_role_service_spec.rb' - - 'ee/spec/services/users_ops_dashboard_projects/destroy_service_spec.rb' - - 'ee/spec/services/vulnerability_exports/create_service_spec.rb' - - 'ee/spec/services/vulnerability_exports/export_service_spec.rb' - - 'ee/spec/services/vulnerability_external_issue_links/create_service_spec.rb' - - 'ee/spec/services/vulnerability_external_issue_links/destroy_service_spec.rb' - - 'ee/spec/services/vulnerability_feedback/destroy_service_spec.rb' - - 'ee/spec/services/vulnerability_issue_links/create_service_spec.rb' - - 'ee/spec/services/vulnerability_issue_links/delete_service_spec.rb' - - 'ee/spec/services/vulnerability_merge_request_links/create_service_spec.rb' - - 'ee/spec/services/vulnerability_scanners/list_service_spec.rb' - - 'ee/spec/services/web_hook_service_spec.rb' - - 'ee/spec/services/wiki_pages/create_service_spec.rb' - - 'ee/spec/services/wiki_pages/destroy_service_spec.rb' - - 'ee/spec/services/wiki_pages/update_service_spec.rb' - - 'ee/spec/services/wikis/create_attachment_service_spec.rb' - - 'ee/spec/services/work_items/update_service_spec.rb' - - 'ee/spec/services/work_items/widgets/status_service/update_service_spec.rb' - - 'ee/spec/services/work_items/widgets/weight_service/update_service_spec.rb' - 'ee/spec/tasks/geo/git_rake_spec.rb' - 'ee/spec/tasks/gitlab/license_rake_spec.rb' - 'ee/spec/tasks/gitlab/spdx_rake_spec.rb' @@ -6096,120 +6051,10 @@ RSpec/MissingFeatureCategory: - 'spec/serializers/user_serializer_spec.rb' - 'spec/serializers/web_ide_terminal_entity_spec.rb' - 'spec/serializers/web_ide_terminal_serializer_spec.rb' - - 'spec/services/access_token_validation_service_spec.rb' - 'spec/services/application_settings/update_service_spec.rb' - 'spec/services/applications/create_service_spec.rb' - - 'spec/services/audit_event_service_spec.rb' - - 'spec/services/auto_merge_service_spec.rb' - - 'spec/services/base_container_service_spec.rb' - - 'spec/services/base_count_service_spec.rb' - - 'spec/services/bulk_create_integration_service_spec.rb' - - 'spec/services/bulk_push_event_payload_service_spec.rb' - - 'spec/services/bulk_update_integration_service_spec.rb' - - 'spec/services/cohorts_service_spec.rb' - - 'spec/services/compare_service_spec.rb' - - 'spec/services/event_create_service_spec.rb' - 'spec/services/gpg_keys/destroy_service_spec.rb' - - 'spec/services/gravatar_service_spec.rb' - - 'spec/services/import_export_clean_up_service_spec.rb' - - 'spec/services/markdown_content_rewriter_service_spec.rb' - 'spec/services/metrics/dashboard/grafana_metric_embed_service_spec.rb' - - 'spec/services/note_summary_spec.rb' - - 'spec/services/post_receive_service_spec.rb' - - 'spec/services/preview_markdown_service_spec.rb' - - 'spec/services/push_event_payload_service_spec.rb' - - 'spec/services/repository_archive_clean_up_service_spec.rb' - - 'spec/services/reset_project_cache_service_spec.rb' - - 'spec/services/service_response_spec.rb' - - 'spec/services/system_hooks_service_spec.rb' - - 'spec/services/task_list_toggle_service_spec.rb' - - 'spec/services/tasks_to_be_done/base_service_spec.rb' - - 'spec/services/terraform/remote_state_handler_spec.rb' - - 'spec/services/terraform/states/destroy_service_spec.rb' - - 'spec/services/terraform/states/trigger_destroy_service_spec.rb' - - 'spec/services/test_hooks/project_service_spec.rb' - - 'spec/services/test_hooks/system_service_spec.rb' - - 'spec/services/timelogs/delete_service_spec.rb' - - 'spec/services/todo_service_spec.rb' - - 'spec/services/todos/allowed_target_filter_service_spec.rb' - - 'spec/services/todos/destroy/confidential_issue_service_spec.rb' - - 'spec/services/todos/destroy/design_service_spec.rb' - - 'spec/services/todos/destroy/destroyed_issuable_service_spec.rb' - - 'spec/services/todos/destroy/project_private_service_spec.rb' - - 'spec/services/todos/destroy/unauthorized_features_service_spec.rb' - - 'spec/services/topics/merge_service_spec.rb' - - 'spec/services/two_factor/destroy_service_spec.rb' - - 'spec/services/update_container_registry_info_service_spec.rb' - - 'spec/services/update_merge_request_metrics_service_spec.rb' - - 'spec/services/upload_service_spec.rb' - - 'spec/services/uploads/destroy_service_spec.rb' - - 'spec/services/user_preferences/update_service_spec.rb' - - 'spec/services/users/activity_service_spec.rb' - - 'spec/services/users/approve_service_spec.rb' - - 'spec/services/users/authorized_build_service_spec.rb' - - 'spec/services/users/ban_service_spec.rb' - - 'spec/services/users/banned_user_base_service_spec.rb' - - 'spec/services/users/batch_status_cleaner_service_spec.rb' - - 'spec/services/users/block_service_spec.rb' - - 'spec/services/users/build_service_spec.rb' - - 'spec/services/users/create_service_spec.rb' - - 'spec/services/users/destroy_service_spec.rb' - - 'spec/services/users/dismiss_callout_service_spec.rb' - - 'spec/services/users/dismiss_group_callout_service_spec.rb' - - 'spec/services/users/dismiss_project_callout_service_spec.rb' - - 'spec/services/users/email_verification/generate_token_service_spec.rb' - - 'spec/services/users/email_verification/validate_token_service_spec.rb' - - 'spec/services/users/in_product_marketing_email_records_spec.rb' - - 'spec/services/users/keys_count_service_spec.rb' - - 'spec/services/users/last_push_event_service_spec.rb' - - 'spec/services/users/migrate_records_to_ghost_user_in_batches_service_spec.rb' - - 'spec/services/users/migrate_records_to_ghost_user_service_spec.rb' - - 'spec/services/users/refresh_authorized_projects_service_spec.rb' - - 'spec/services/users/registrations_build_service_spec.rb' - - 'spec/services/users/reject_service_spec.rb' - - 'spec/services/users/repair_ldap_blocked_service_spec.rb' - - 'spec/services/users/respond_to_terms_service_spec.rb' - - 'spec/services/users/saved_replies/create_service_spec.rb' - - 'spec/services/users/saved_replies/destroy_service_spec.rb' - - 'spec/services/users/saved_replies/update_service_spec.rb' - - 'spec/services/users/set_status_service_spec.rb' - - 'spec/services/users/signup_service_spec.rb' - - 'spec/services/users/unban_service_spec.rb' - - 'spec/services/users/unblock_service_spec.rb' - - 'spec/services/users/update_canonical_email_service_spec.rb' - - 'spec/services/users/update_highest_member_role_service_spec.rb' - - 'spec/services/users/update_service_spec.rb' - - 'spec/services/users/update_todo_count_cache_service_spec.rb' - - 'spec/services/users/upsert_credit_card_validation_service_spec.rb' - - 'spec/services/users/validate_manual_otp_service_spec.rb' - - 'spec/services/users/validate_push_otp_service_spec.rb' - - 'spec/services/verify_pages_domain_service_spec.rb' - - 'spec/services/web_hooks/destroy_service_spec.rb' - - 'spec/services/web_hooks/log_destroy_service_spec.rb' - - 'spec/services/web_hooks/log_execution_service_spec.rb' - - 'spec/services/webauthn/authenticate_service_spec.rb' - - 'spec/services/webauthn/register_service_spec.rb' - - 'spec/services/wiki_pages/base_service_spec.rb' - - 'spec/services/wiki_pages/create_service_spec.rb' - - 'spec/services/wiki_pages/destroy_service_spec.rb' - - 'spec/services/wiki_pages/event_create_service_spec.rb' - - 'spec/services/wiki_pages/update_service_spec.rb' - - 'spec/services/wikis/create_attachment_service_spec.rb' - - 'spec/services/work_items/build_service_spec.rb' - - 'spec/services/work_items/create_from_task_service_spec.rb' - - 'spec/services/work_items/create_service_spec.rb' - - 'spec/services/work_items/delete_service_spec.rb' - - 'spec/services/work_items/delete_task_service_spec.rb' - - 'spec/services/work_items/parent_links/destroy_service_spec.rb' - - 'spec/services/work_items/task_list_reference_removal_service_spec.rb' - - 'spec/services/work_items/task_list_reference_replacement_service_spec.rb' - - 'spec/services/work_items/update_service_spec.rb' - - 'spec/services/work_items/widgets/assignees_service/update_service_spec.rb' - - 'spec/services/work_items/widgets/description_service/update_service_spec.rb' - - 'spec/services/work_items/widgets/milestone_service/create_service_spec.rb' - - 'spec/services/work_items/widgets/milestone_service/update_service_spec.rb' - - 'spec/services/work_items/widgets/start_and_due_date_service/update_service_spec.rb' - - 'spec/services/x509_certificate_revoke_service_spec.rb' - 'spec/sidekiq/cron/job_gem_dependency_spec.rb' - 'spec/sidekiq_cluster/sidekiq_cluster_spec.rb' - 'spec/spam/concerns/has_spam_action_response_fields_spec.rb' diff --git a/app/assets/javascripts/behaviors/markdown/render_observability.js b/app/assets/javascripts/behaviors/markdown/render_observability.js index 85aae6f53c4..6346fb8ab48 100644 --- a/app/assets/javascripts/behaviors/markdown/render_observability.js +++ b/app/assets/javascripts/behaviors/markdown/render_observability.js @@ -1,25 +1,19 @@ import Vue from 'vue'; -import { darkModeEnabled } from '~/lib/utils/color_utils'; -import { setUrlParams } from '~/lib/utils/url_utility'; - -export function getFrameSrc(url) { - return `${setUrlParams({ theme: darkModeEnabled() ? 'dark' : 'light' }, url)}&kiosk=inline-embed`; -} +import ObservabilityApp from '~/observability/components/observability_app.vue'; +import { SKELETON_VARIANT_EMBED, INLINE_EMBED_DIMENSIONS } from '~/observability/constants'; const mountVueComponent = (element) => { - const url = [element.dataset.frameUrl]; - + const url = element.dataset.frameUrl; return new Vue({ el: element, render(h) { - return h('iframe', { - style: { - height: '366px', - width: '768px', - }, - attrs: { - src: getFrameSrc(url), - frameBorder: '0', + return h(ObservabilityApp, { + props: { + observabilityIframeSrc: url, + inlineEmbed: true, + skeletonVariant: SKELETON_VARIANT_EMBED, + height: INLINE_EMBED_DIMENSIONS.HEIGHT, + width: INLINE_EMBED_DIMENSIONS.WIDTH, }, }); }, @@ -27,7 +21,5 @@ const mountVueComponent = (element) => { }; export default function renderObservability(elements) { - elements.forEach((element) => { - mountVueComponent(element); - }); + return elements.map(mountVueComponent); } diff --git a/app/assets/javascripts/issuable/components/related_issuable_item.vue b/app/assets/javascripts/issuable/components/related_issuable_item.vue index ded54d60d1d..c4b9bdb150b 100644 --- a/app/assets/javascripts/issuable/components/related_issuable_item.vue +++ b/app/assets/javascripts/issuable/components/related_issuable_item.vue @@ -102,10 +102,10 @@ export default { 'issuable-info-container': !canReorder, 'card-body': canReorder, }" - class="item-body gl-display-flex gl-align-items-center gl-gap-3 gl-px-3 gl-py-2 py-xl-0 gl-mx-n2" + class="item-body gl-display-flex gl-align-items-center gl-gap-3 gl-mx-n2" > <div - class="item-contents gl-display-flex gl-align-items-center gl-flex-wrap gl-flex-grow-1 gl-gap-2 flex-xl-nowrap gl-min-h-7" + class="item-contents gl-display-flex gl-align-items-center gl-flex-wrap gl-flex-grow-1 gl-gap-2 gl-px-3 gl-py-2 py-xl-0 flex-xl-nowrap gl-min-h-7" > <!-- Title area: Status icon (XL) and title --> <div class="item-title gl-display-flex gl-gap-3 gl-min-w-0"> diff --git a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue index 92d1a2ffc22..c3f87699d58 100644 --- a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue +++ b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue @@ -96,8 +96,12 @@ export default { label="Fetching related merge requests" class="gl-py-4" /> - <ul v-else class="content-list related-items-list"> - <li v-for="mr in mergeRequests" :key="mr.id" class="list-item gl-m-0! gl-px-4! gl-py-3!"> + <ul v-else class="content-list related-items-list gl-px-4! gl-py-3!"> + <li + v-for="mr in mergeRequests" + :key="mr.id" + class="list-item gl-m-0! gl-p-0! gl-border-b-0!" + > <related-issuable-item :id-key="mr.id" :display-reference="mr.reference" diff --git a/app/assets/javascripts/observability/components/observability_app.vue b/app/assets/javascripts/observability/components/observability_app.vue index ff9cf6ff6c5..36cbe715149 100644 --- a/app/assets/javascripts/observability/components/observability_app.vue +++ b/app/assets/javascripts/observability/components/observability_app.vue @@ -2,7 +2,7 @@ import { darkModeEnabled } from '~/lib/utils/color_utils'; import { setUrlParams } from '~/lib/utils/url_utility'; -import { MESSAGE_EVENT_TYPE, SKELETON_VARIANTS_BY_ROUTE } from '../constants'; +import { MESSAGE_EVENT_TYPE, FULL_APP_DIMENSIONS } from '../constants'; import ObservabilitySkeleton from './skeleton/index.vue'; export default { @@ -14,25 +14,33 @@ export default { type: String, required: true, }, + inlineEmbed: { + type: Boolean, + required: false, + default: false, + }, + skeletonVariant: { + type: String, + required: false, + default: 'dashboards', + }, + height: { + type: String, + required: false, + default: FULL_APP_DIMENSIONS.HEIGHT, + }, + width: { + type: String, + required: false, + default: FULL_APP_DIMENSIONS.WIDTH, + }, }, computed: { iframeSrcWithParams() { - return setUrlParams( + return `${setUrlParams( { theme: darkModeEnabled() ? 'dark' : 'light', username: gon?.current_username }, this.observabilityIframeSrc, - ); - }, - getSkeletonVariant() { - const [, variant] = - Object.entries(SKELETON_VARIANTS_BY_ROUTE).find(([path]) => - this.$route.path.endsWith(path), - ) || []; - - const DEFAULT_SKELETON = 'dashboards'; - - if (!variant) return DEFAULT_SKELETON; - - return variant; + )}${this.inlineEmbed ? '&kiosk=inline-embed' : ''}`; }, }, mounted() { @@ -54,38 +62,24 @@ export default { this.$refs.observabilitySkeleton.onContentLoaded(); break; case MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE: - this.routeUpdateHandler(payload); + this.$emit('route-update', payload); break; default: break; } }, - routeUpdateHandler(payload) { - const isNewObservabilityPath = this.$route?.query?.observability_path !== payload?.url; - - const shouldNotHandleMessage = !payload.url || !isNewObservabilityPath; - - if (shouldNotHandleMessage) { - return; - } - - // this will update the `observability_path` query param on each route change inside Observability UI - this.$router.replace({ - name: this.$route.pathname, - query: { ...this.$route.query, observability_path: payload.url }, - }); - }, }, }; </script> <template> - <observability-skeleton ref="observabilitySkeleton" :variant="getSkeletonVariant"> + <observability-skeleton ref="observabilitySkeleton" :variant="skeletonVariant"> <iframe id="observability-ui-iframe" data-testid="observability-ui-iframe" frameborder="0" - height="100%" + :width="width" + :height="height" :src="iframeSrcWithParams" sandbox="allow-same-origin allow-forms allow-scripts" ></iframe> diff --git a/app/assets/javascripts/observability/components/skeleton/embed.vue b/app/assets/javascripts/observability/components/skeleton/embed.vue new file mode 100644 index 00000000000..7abaf2b1bc7 --- /dev/null +++ b/app/assets/javascripts/observability/components/skeleton/embed.vue @@ -0,0 +1,15 @@ +<script> +import { GlSkeletonLoader } from '@gitlab/ui'; + +export default { + components: { + GlSkeletonLoader, + }, +}; +</script> +<template> + <gl-skeleton-loader> + <rect y="5" width="400" height="30" rx="2" ry="2" /> + <rect y="50" width="400" height="80" rx="2" ry="2" /> + </gl-skeleton-loader> +</template> diff --git a/app/assets/javascripts/observability/components/skeleton/index.vue b/app/assets/javascripts/observability/components/skeleton/index.vue index c8f196a43f4..d91f2874943 100644 --- a/app/assets/javascripts/observability/components/skeleton/index.vue +++ b/app/assets/javascripts/observability/components/skeleton/index.vue @@ -8,10 +8,12 @@ import { OBSERVABILITY_ROUTES, TIMEOUT_ERROR_LABEL, TIMEOUT_ERROR_MESSAGE, + SKELETON_VARIANT_EMBED, } from '../../constants'; import DashboardsSkeleton from './dashboards.vue'; import ExploreSkeleton from './explore.vue'; import ManageSkeleton from './manage.vue'; +import EmbedSkeleton from './embed.vue'; export default { components: { @@ -19,11 +21,13 @@ export default { DashboardsSkeleton, ExploreSkeleton, ManageSkeleton, + EmbedSkeleton, GlAlert, }, SKELETON_VARIANTS_BY_ROUTE, SKELETON_STATE, OBSERVABILITY_ROUTES, + SKELETON_VARIANT_EMBED, i18n: { TIMEOUT_ERROR_LABEL, TIMEOUT_ERROR_MESSAGE, @@ -102,6 +106,7 @@ export default { <dashboards-skeleton v-if="isSkeletonShown($options.OBSERVABILITY_ROUTES.DASHBOARDS)" /> <explore-skeleton v-else-if="isSkeletonShown($options.OBSERVABILITY_ROUTES.EXPLORE)" /> <manage-skeleton v-else-if="isSkeletonShown($options.OBSERVABILITY_ROUTES.MANAGE)" /> + <embed-skeleton v-else-if="variant === $options.SKELETON_VARIANT_EMBED" /> <gl-skeleton-loader v-else> <rect y="2" width="10" height="8" /> @@ -122,12 +127,14 @@ export default { {{ $options.i18n.TIMEOUT_ERROR_MESSAGE }} </gl-alert> - <div - v-show="state === $options.SKELETON_STATE.HIDDEN" - data-testid="observability-wrapper" - class="gl-flex-grow-1 gl-display-flex gl-flex-direction-column gl-flex-align-items-stretch" - > - <slot></slot> - </div> + <transition> + <div + v-show="state === $options.SKELETON_STATE.HIDDEN" + data-testid="observability-wrapper" + class="gl-flex-grow-1 gl-display-flex gl-flex-direction-column gl-flex-align-items-stretch" + > + <slot></slot> + </div> + </transition> </div> </template> diff --git a/app/assets/javascripts/observability/constants.js b/app/assets/javascripts/observability/constants.js index e4827dd169f..6b97c51e997 100644 --- a/app/assets/javascripts/observability/constants.js +++ b/app/assets/javascripts/observability/constants.js @@ -17,6 +17,8 @@ export const SKELETON_VARIANTS_BY_ROUTE = Object.freeze({ [OBSERVABILITY_ROUTES.MANAGE]: 'manage', }); +export const SKELETON_VARIANT_EMBED = 'embed'; + export const SKELETON_STATE = Object.freeze({ ERROR: 'error', VISIBLE: 'visible', @@ -30,3 +32,13 @@ export const DEFAULT_TIMERS = Object.freeze({ export const TIMEOUT_ERROR_LABEL = __('Unable to load the page'); export const TIMEOUT_ERROR_MESSAGE = __('Reload the page to try again.'); + +export const INLINE_EMBED_DIMENSIONS = Object.freeze({ + HEIGHT: '366px', + WIDTH: '768px', +}); + +export const FULL_APP_DIMENSIONS = Object.freeze({ + HEIGHT: '100%', + WIDTH: '100%', +}); diff --git a/app/assets/javascripts/observability/index.js b/app/assets/javascripts/observability/index.js index cd342ebee3e..72ff1357551 100644 --- a/app/assets/javascripts/observability/index.js +++ b/app/assets/javascripts/observability/index.js @@ -2,6 +2,7 @@ import Vue from 'vue'; import VueRouter from 'vue-router'; import ObservabilityApp from './components/observability_app.vue'; +import { SKELETON_VARIANTS_BY_ROUTE } from './constants'; Vue.use(VueRouter); @@ -17,10 +18,41 @@ export default () => { return new Vue({ el, router, + computed: { + skeletonVariant() { + const [, variant] = + Object.entries(SKELETON_VARIANTS_BY_ROUTE).find(([path]) => + this.$route.path.endsWith(path), + ) || []; + + return variant; + }, + }, + methods: { + routeUpdateHandler(payload) { + const isNewObservabilityPath = this.$route?.query?.observability_path !== payload?.url; + + const shouldNotHandleMessage = !payload.url || !isNewObservabilityPath; + + if (shouldNotHandleMessage) { + return; + } + + // this will update the `observability_path` query param on each route change inside Observability UI + this.$router.replace({ + name: this.$route?.pathname, + query: { ...this.$route.query, observability_path: payload.url }, + }); + }, + }, render(h) { return h(ObservabilityApp, { props: { observabilityIframeSrc: el.dataset.observabilityIframeSrc, + skeletonVariant: this.skeletonVariant, + }, + on: { + 'route-update': (payload) => this.routeUpdateHandler(payload), }, }); }, diff --git a/app/assets/stylesheets/components/related_items_list.scss b/app/assets/stylesheets/components/related_items_list.scss index 6cb7dcca27d..0b30b4c3ef0 100644 --- a/app/assets/stylesheets/components/related_items_list.scss +++ b/app/assets/stylesheets/components/related_items_list.scss @@ -159,6 +159,11 @@ $item-remove-button-space: 42px; .mr-ci-status { line-height: 0; + + a:focus { + @include gl-rounded-full; + @include gl-focus; + } } @include media-breakpoint-down(xs) { diff --git a/app/graphql/types/projects/namespace_project_sort_enum.rb b/app/graphql/types/projects/namespace_project_sort_enum.rb index 7c7b54226d3..14a315781ef 100644 --- a/app/graphql/types/projects/namespace_project_sort_enum.rb +++ b/app/graphql/types/projects/namespace_project_sort_enum.rb @@ -7,8 +7,9 @@ module Types description 'Values for sorting projects' value 'SIMILARITY', 'Most similar to the search query.', value: :similarity - value 'STORAGE', 'Sort by storage size.', value: :storage - value 'ACTIVITY_DESC', 'Sort by latest activity, in descending order.', value: :latest_activity_desc + value 'ACTIVITY_DESC', 'Sort by latest activity, descending order.', value: :latest_activity_desc end end end + +Types::Projects::NamespaceProjectSortEnum.prepend_mod diff --git a/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml b/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml index 1afb59328c9..8c45809261c 100644 --- a/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml +++ b/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml @@ -13,4 +13,5 @@ help_text: '%{help_text} %{learn_more_link}'.html_safe % { help_text: help_text, learn_more_link: learn_more_link }, checkbox_options: { checked: group.auto_devops_enabled? } - = f.submit _('Save changes'), class: 'gl-mt-5', pajamas_button: true + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { class: 'gl-mt-5' }) do + = _('Save changes') diff --git a/db/docs/bulk_import_batch_trackers.yml b/db/docs/bulk_import_batch_trackers.yml index d69888aaadd..6e6ee123588 100644 --- a/db/docs/bulk_import_batch_trackers.yml +++ b/db/docs/bulk_import_batch_trackers.yml @@ -1,6 +1,7 @@ --- table_name: bulk_import_batch_trackers -classes: [] +classes: +- BulkImports::BatchTracker feature_categories: - importers description: Used to store and track the import status of a batch of relations for the migration diff --git a/db/docs/bulk_import_export_batches.yml b/db/docs/bulk_import_export_batches.yml index 8d25e2e4a3d..8cbd032a23a 100644 --- a/db/docs/bulk_import_export_batches.yml +++ b/db/docs/bulk_import_export_batches.yml @@ -1,6 +1,7 @@ --- table_name: bulk_import_export_batches -classes: [] +classes: +- BulkImports::ExportBatch feature_categories: - importers description: Used to track the generation status of export batch files for groups diff --git a/db/docs/integrations.yml b/db/docs/integrations.yml index c1b18b29804..91675f8de35 100644 --- a/db/docs/integrations.yml +++ b/db/docs/integrations.yml @@ -47,6 +47,7 @@ classes: - Integrations::Shimo - Integrations::Slack - Integrations::SlackSlashCommands +- Integrations::SquashTm - Integrations::Teamcity - Integrations::UnifyCircuit - Integrations::WebexTeams diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index d818a6d2060..cb9f225f03f 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -23781,9 +23781,11 @@ Values for sorting projects. | Value | Description | | ----- | ----------- | -| <a id="namespaceprojectsortactivity_desc"></a>`ACTIVITY_DESC` | Sort by latest activity, in descending order. | +| <a id="namespaceprojectsortactivity_desc"></a>`ACTIVITY_DESC` | Sort by latest activity, descending order. | | <a id="namespaceprojectsortsimilarity"></a>`SIMILARITY` | Most similar to the search query. | -| <a id="namespaceprojectsortstorage"></a>`STORAGE` | Sort by storage size. | +| <a id="namespaceprojectsortstorage"></a>`STORAGE` | Sort by excess repository storage size, descending order. | +| <a id="namespaceprojectsortstorage_size_asc"></a>`STORAGE_SIZE_ASC` | Sort by total storage size, ascending order. | +| <a id="namespaceprojectsortstorage_size_desc"></a>`STORAGE_SIZE_DESC` | Sort by total storage size, descending order. | ### `NegatedIterationWildcardId` diff --git a/doc/user/application_security/dependency_scanning/index.md b/doc/user/application_security/dependency_scanning/index.md index dd76a212ffe..7641c39d6d6 100644 --- a/doc/user/application_security/dependency_scanning/index.md +++ b/doc/user/application_security/dependency_scanning/index.md @@ -630,6 +630,7 @@ The following variables allow configuration of global dependency scanning settin | `DS_EXCLUDED_ANALYZERS` | Specify the analyzers (by name) to exclude from Dependency Scanning. For more information, see [Dependency Scanning Analyzers](analyzers.md). | | `DS_EXCLUDED_PATHS` | Exclude files and directories from the scan based on the paths. A comma-separated list of patterns. Patterns can be globs (see [`doublestar.Match`](https://pkg.go.dev/github.com/bmatcuk/doublestar/v4@v4.0.2#Match) for supported patterns), or file or folder paths (for example, `doc,spec`). Parent directories also match patterns. Default: `"spec, test, tests, tmp"`. | | `DS_IMAGE_SUFFIX` | Suffix added to the image name. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/354796) in GitLab 14.10.) Automatically set to `"-fips"` when FIPS mode is enabled. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/357922) in GitLab 15.0.) | +| `DS_MAX_DEPTH` | Defines how many directory levels deep that the analyzer should search for supported files to scan. A value of `-1` scans all directories regardless of depth. Default: `2`. | | `SECURE_ANALYZERS_PREFIX` | Override the name of the Docker registry providing the official default images (proxy). Read more about [customizing analyzers](analyzers.md). | | `SECURE_LOG_LEVEL` | Set the minimum logging level. Messages of this logging level or higher are output. From highest to lowest severity, the logging levels are: `fatal`, `error`, `warn`, `info`, `debug`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10880) in GitLab 13.1. Default: `info`. | diff --git a/doc/user/application_security/policies/scan-result-policies.md b/doc/user/application_security/policies/scan-result-policies.md index a9e78ba7a79..104462529c1 100644 --- a/doc/user/application_security/policies/scan-result-policies.md +++ b/doc/user/application_security/policies/scan-result-policies.md @@ -10,8 +10,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w You can use scan result policies to take action based on scan results. For example, one type of scan result policy is a security approval policy that allows approval to be required based on the -findings of one or more security scan jobs. Scan result policies are evaluated after a CI scanning -job is fully executed. The following video gives you an overview of GitLab scan result policies: +findings of one or more security scan jobs. Scan result policies are evaluated after a CI scanning job is fully executed. + +NOTE: +Scan result policies are applicable only to [protected](../../project/protected_branches.md) target branches. + +The following video gives you an overview of GitLab scan result policies: <div class="video-fallback"> See the video: <a href="https://youtu.be/w5I9gcUgr9U">Overview of GitLab Scan Result Policies</a>. diff --git a/doc/user/compliance/compliance_report/index.md b/doc/user/compliance/compliance_report/index.md index 5b0dde80cec..d5af7edf515 100644 --- a/doc/user/compliance/compliance_report/index.md +++ b/doc/user/compliance/compliance_report/index.md @@ -170,11 +170,7 @@ passing in an optional value to the `commit_sha` query parameter. ## Compliance frameworks report -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/387910) in GitLab 15.10 with a flag named `compliance_frameworks_report`. Disabled by default. - -FLAG: -On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `compliance_frameworks_report`. -On GitLab.com, this feature is available. +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/387910) in GitLab 15.10. With compliance frameworks report, you can see the compliance frameworks that are applied to projects in a group. Each row of the report shows: diff --git a/doc/user/compliance/license_approval_policies.md b/doc/user/compliance/license_approval_policies.md index 3e43869aabd..2769732c49a 100644 --- a/doc/user/compliance/license_approval_policies.md +++ b/doc/user/compliance/license_approval_policies.md @@ -9,7 +9,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w > [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8092) in GitLab 15.9 [with a flag](../../administration/feature_flags.md) named `license_scanning_policies`. Disabled by default. -License Approval Policies allow you to specify multiple types of criteria that define when approval is required before a merge request can be merged in. The following video provides an overview of these policies. +License Approval Policies allow you to specify multiple types of criteria that define when approval is required before a merge request can be merged in. + +NOTE: +License Approval Policies are applicable only to [protected](../project/protected_branches.md) target branches. + +The following video provides an overview of these policies. <div class="video-fallback"> See the video: <a href="https://www.youtube.com/watch?v=34qBQ9t8qO8">Overview of GitLab License Approval Policies</a>. diff --git a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml index eb8e5de5b56..31d19779434 100644 --- a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml @@ -56,15 +56,15 @@ dependency_scanning: .gemnasium-shared-rule: exists: - - '{Gemfile.lock,*/Gemfile.lock,*/*/Gemfile.lock}' - - '{composer.lock,*/composer.lock,*/*/composer.lock}' - - '{gems.locked,*/gems.locked,*/*/gems.locked}' - - '{go.sum,*/go.sum,*/*/go.sum}' - - '{npm-shrinkwrap.json,*/npm-shrinkwrap.json,*/*/npm-shrinkwrap.json}' - - '{package-lock.json,*/package-lock.json,*/*/package-lock.json}' - - '{yarn.lock,*/yarn.lock,*/*/yarn.lock}' - - '{packages.lock.json,*/packages.lock.json,*/*/packages.lock.json}' - - '{conan.lock,*/conan.lock,*/*/conan.lock}' + - '**/Gemfile.lock' + - '**/composer.lock' + - '**/gems.locked' + - '**/go.sum' + - '**/npm-shrinkwrap.json' + - '**/package-lock.json' + - '**/yarn.lock' + - '**/packages.lock.json' + - '**/conan.lock' gemnasium-dependency_scanning: extends: @@ -91,10 +91,10 @@ gemnasium-dependency_scanning: .gemnasium-maven-shared-rule: exists: - - '{build.gradle,*/build.gradle,*/*/build.gradle}' - - '{build.gradle.kts,*/build.gradle.kts,*/*/build.gradle.kts}' - - '{build.sbt,*/build.sbt,*/*/build.sbt}' - - '{pom.xml,*/pom.xml,*/*/pom.xml}' + - '**/build.gradle' + - '**/build.gradle.kts' + - '**/build.sbt' + - '**/pom.xml' gemnasium-maven-dependency_scanning: extends: @@ -119,12 +119,12 @@ gemnasium-maven-dependency_scanning: .gemnasium-python-shared-rule: exists: - - '{requirements.txt,*/requirements.txt,*/*/requirements.txt}' - - '{requirements.pip,*/requirements.pip,*/*/requirements.pip}' - - '{Pipfile,*/Pipfile,*/*/Pipfile}' - - '{requires.txt,*/requires.txt,*/*/requires.txt}' - - '{setup.py,*/setup.py,*/*/setup.py}' - - '{poetry.lock,*/poetry.lock,*/*/poetry.lock}' + - '**/requirements.txt' + - '**/requirements.pip' + - '**/Pipfile' + - '**/requires.txt' + - '**/setup.py' + - '**/poetry.lock' gemnasium-python-dependency_scanning: extends: diff --git a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml index 655ac6ee712..9ab17997c27 100644 --- a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml @@ -56,15 +56,15 @@ dependency_scanning: .gemnasium-shared-rule: exists: - - '{Gemfile.lock,*/Gemfile.lock,*/*/Gemfile.lock}' - - '{composer.lock,*/composer.lock,*/*/composer.lock}' - - '{gems.locked,*/gems.locked,*/*/gems.locked}' - - '{go.sum,*/go.sum,*/*/go.sum}' - - '{npm-shrinkwrap.json,*/npm-shrinkwrap.json,*/*/npm-shrinkwrap.json}' - - '{package-lock.json,*/package-lock.json,*/*/package-lock.json}' - - '{yarn.lock,*/yarn.lock,*/*/yarn.lock}' - - '{packages.lock.json,*/packages.lock.json,*/*/packages.lock.json}' - - '{conan.lock,*/conan.lock,*/*/conan.lock}' + - '**/Gemfile.lock' + - '**/composer.lock' + - '**/gems.locked' + - '**/go.sum' + - '**/npm-shrinkwrap.json' + - '**/package-lock.json' + - '**/yarn.lock' + - '**/packages.lock.json' + - '**/conan.lock' gemnasium-dependency_scanning: extends: @@ -109,10 +109,10 @@ gemnasium-dependency_scanning: .gemnasium-maven-shared-rule: exists: - - '{build.gradle,*/build.gradle,*/*/build.gradle}' - - '{build.gradle.kts,*/build.gradle.kts,*/*/build.gradle.kts}' - - '{build.sbt,*/build.sbt,*/*/build.sbt}' - - '{pom.xml,*/pom.xml,*/*/pom.xml}' + - '**/build.gradle' + - '**/build.gradle.kts' + - '**/build.sbt' + - '**/pom.xml' gemnasium-maven-dependency_scanning: extends: @@ -155,12 +155,12 @@ gemnasium-maven-dependency_scanning: .gemnasium-python-shared-rule: exists: - - '{requirements.txt,*/requirements.txt,*/*/requirements.txt}' - - '{requirements.pip,*/requirements.pip,*/*/requirements.pip}' - - '{Pipfile,*/Pipfile,*/*/Pipfile}' - - '{requires.txt,*/requires.txt,*/*/requires.txt}' - - '{setup.py,*/setup.py,*/*/setup.py}' - - '{poetry.lock,*/poetry.lock,*/*/poetry.lock}' + - '**/requirements.txt' + - '**/requirements.pip' + - '**/Pipfile' + - '**/requires.txt' + - '**/setup.py' + - '**/poetry.lock' gemnasium-python-dependency_scanning: extends: diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/unlocking_job_artifacts_across_parent_child_pipelines_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/unlocking_job_artifacts_across_parent_child_pipelines_spec.rb index 685be0d7225..072c957f4dc 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/unlocking_job_artifacts_across_parent_child_pipelines_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/unlocking_job_artifacts_across_parent_child_pipelines_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Verify', :runner, product_group: :pipeline_security do + RSpec.describe 'Verify', :runner, product_group: :pipeline_security, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/396855', + type: :flaky + } do describe "Unlocking job artifacts across parent-child pipelines" do let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(number: 8)}" } diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 5510e73ef0f..2aa70ec1953 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -147,14 +147,14 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do selected_group.add_owner(user) end - it 'can successfully transfer the group', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/384966' do + it 'can successfully transfer the group' do visit edit_group_path(selected_group) page.within('[data-testid="transfer-locations-dropdown"]') do click_button _('Select parent group') fill_in _('Search'), with: target_group_name wait_for_requests - click_button target_group_name + click_button(target_group_name || 'No parent group') end click_button s_('GroupSettings|Transfer group') @@ -166,7 +166,10 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do click_button 'Confirm' end - expect(page).to have_text "Group '#{selected_group.name}' was successfully transferred." + within('[data-testid="breadcrumb-links"]') do + expect(page).to have_content(target_group_name) if target_group_name + expect(page).to have_content(selected_group.name) + end expect(current_url).to include(selected_group.reload.full_path) end end @@ -175,7 +178,7 @@ RSpec.describe 'Edit group settings', feature_category: :subgroups do let(:selected_group) { create(:group, path: 'foo-subgroup', parent: group) } context 'when transfering to no parent group' do - let(:target_group_name) { 'No parent group' } + let(:target_group_name) { nil } it_behaves_like 'can transfer the group' end diff --git a/spec/features/markdown/observability_spec.rb b/spec/features/markdown/observability_spec.rb index 7bc59a3dc8c..ec414d4396e 100644 --- a/spec/features/markdown/observability_spec.rb +++ b/spec/features/markdown/observability_spec.rb @@ -8,9 +8,6 @@ RSpec.describe 'Observability rendering', :js, feature_category: :metrics do let_it_be(:user) { create(:user) } let_it_be(:observable_url) { "https://www.gitlab.com/groups/#{group.path}/-/observability/explore?observability_path=/explore?foo=bar" } let_it_be(:expected_observable_url) { "https://observe.gitlab.com/-/#{group.id}/explore?foo=bar" } - let_it_be(:expected) do - %(<iframe src="#{expected_observable_url}&theme=light&kiosk=inline-embed" frameborder="0") - end before do stub_config_setting(url: "https://www.gitlab.com") diff --git a/spec/frontend/behaviors/markdown/render_observability_spec.js b/spec/frontend/behaviors/markdown/render_observability_spec.js index 7ca426d8cd6..f464c01ac15 100644 --- a/spec/frontend/behaviors/markdown/render_observability_spec.js +++ b/spec/frontend/behaviors/markdown/render_observability_spec.js @@ -1,40 +1,43 @@ +import Vue from 'vue'; +import { createWrapper } from '@vue/test-utils'; import renderObservability from '~/behaviors/markdown/render_observability'; -import * as ColorUtils from '~/lib/utils/color_utils'; +import { INLINE_EMBED_DIMENSIONS, SKELETON_VARIANT_EMBED } from '~/observability/constants'; +import ObservabilityApp from '~/observability/components/observability_app.vue'; -describe('Observability iframe renderer', () => { - const findObservabilityIframes = (theme = 'light') => - document.querySelectorAll( - `iframe[src="https://observe.gitlab.com/?theme=${theme}&kiosk=inline-embed"]`, - ); - - const renderEmbeddedObservability = () => { - renderObservability([...document.querySelectorAll('.js-render-observability')]); - jest.runAllTimers(); - }; +describe('renderObservability', () => { + let subject; beforeEach(() => { - document.body.dataset.page = ''; - document.body.innerHTML = ''; + subject = document.createElement('div'); + subject.classList.add('js-render-observability'); + subject.dataset.frameUrl = 'https://observe.gitlab.com/'; + document.body.appendChild(subject); }); - it('renders an observability iframe', () => { - document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/"></div>`; - - expect(findObservabilityIframes()).toHaveLength(0); - - renderEmbeddedObservability(); - - expect(findObservabilityIframes()).toHaveLength(1); + afterEach(() => { + subject.remove(); }); - it('renders iframe with dark param when GL has dark theme', () => { - document.body.innerHTML = `<div class="js-render-observability" data-frame-url="https://observe.gitlab.com/"></div>`; - jest.spyOn(ColorUtils, 'darkModeEnabled').mockImplementation(() => true); + it('should return an array of Vue instances', () => { + const vueInstances = renderObservability([ + ...document.querySelectorAll('.js-render-observability'), + ]); + expect(vueInstances).toEqual([expect.any(Vue)]); + }); - expect(findObservabilityIframes('dark')).toHaveLength(0); + it('should correctly pass props to the ObservabilityApp component', () => { + const vueInstances = renderObservability([ + ...document.querySelectorAll('.js-render-observability'), + ]); - renderEmbeddedObservability(); + const wrapper = createWrapper(vueInstances[0]); - expect(findObservabilityIframes('dark')).toHaveLength(1); + expect(wrapper.findComponent(ObservabilityApp).props()).toMatchObject({ + observabilityIframeSrc: 'https://observe.gitlab.com/', + skeletonVariant: SKELETON_VARIANT_EMBED, + inlineEmbed: true, + height: INLINE_EMBED_DIMENSIONS.HEIGHT, + width: INLINE_EMBED_DIMENSIONS.WIDTH, + }); }); }); diff --git a/spec/frontend/observability/index_spec.js b/spec/frontend/observability/index_spec.js new file mode 100644 index 00000000000..83f72ff72b5 --- /dev/null +++ b/spec/frontend/observability/index_spec.js @@ -0,0 +1,64 @@ +import { createWrapper } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; +import renderObservability from '~/observability/index'; +import ObservabilityApp from '~/observability/components/observability_app.vue'; +import { SKELETON_VARIANTS_BY_ROUTE } from '~/observability/constants'; + +describe('renderObservability', () => { + let element; + let vueInstance; + let component; + + const OBSERVABILITY_ROUTES = Object.keys(SKELETON_VARIANTS_BY_ROUTE); + const SKELETON_VARIANTS = Object.values(SKELETON_VARIANTS_BY_ROUTE); + + beforeEach(() => { + element = document.createElement('div'); + element.setAttribute('id', 'js-observability-app'); + element.dataset.observabilityIframeSrc = 'https://observe.gitlab.com/'; + document.body.appendChild(element); + + vueInstance = renderObservability(); + component = createWrapper(vueInstance).findComponent(ObservabilityApp); + }); + + afterEach(() => { + element.remove(); + }); + + it('should return a Vue instance', () => { + expect(vueInstance).toEqual(expect.any(Vue)); + }); + + it('should render the ObservabilityApp component', () => { + expect(component.props('observabilityIframeSrc')).toBe('https://observe.gitlab.com/'); + }); + + describe('skeleton variant', () => { + it.each` + pathDescription | path | variant + ${'dashboards'} | ${OBSERVABILITY_ROUTES[0]} | ${SKELETON_VARIANTS[0]} + ${'explore'} | ${OBSERVABILITY_ROUTES[1]} | ${SKELETON_VARIANTS[1]} + ${'manage dashboards'} | ${OBSERVABILITY_ROUTES[2]} | ${SKELETON_VARIANTS[2]} + ${'any other'} | ${'unknown/route'} | ${SKELETON_VARIANTS[0]} + `( + 'renders the $variant skeleton variant for $pathDescription path', + async ({ path, variant }) => { + component.vm.$router.push(path); + await nextTick(); + + expect(component.props('skeletonVariant')).toBe(variant); + }, + ); + }); + + it('handle route-update events', async () => { + component.vm.$router.push('/something?foo=bar'); + component.vm.$emit('route-update', { url: '/some_path' }); + expect(component.vm.$router.currentRoute.path).toBe('/something'); + expect(component.vm.$router.currentRoute.query).toEqual({ + foo: 'bar', + observability_path: '/some_path', + }); + }); +}); diff --git a/spec/frontend/observability/observability_app_spec.js b/spec/frontend/observability/observability_app_spec.js index 5f41e36595f..4a9be71b880 100644 --- a/spec/frontend/observability/observability_app_spec.js +++ b/spec/frontend/observability/observability_app_spec.js @@ -1,19 +1,20 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import ObservabilityApp from '~/observability/components/observability_app.vue'; import ObservabilitySkeleton from '~/observability/components/skeleton/index.vue'; - -import { MESSAGE_EVENT_TYPE, SKELETON_VARIANTS_BY_ROUTE } from '~/observability/constants'; +import { + MESSAGE_EVENT_TYPE, + INLINE_EMBED_DIMENSIONS, + FULL_APP_DIMENSIONS, + SKELETON_VARIANT_EMBED, +} from '~/observability/constants'; import { darkModeEnabled } from '~/lib/utils/color_utils'; jest.mock('~/lib/utils/color_utils'); -describe('Observability root app', () => { +describe('ObservabilityApp', () => { let wrapper; - const replace = jest.fn(); - const $router = { - replace, - }; + const $route = { pathname: 'https://gitlab.com/gitlab-org/', path: 'https://gitlab.com/gitlab-org/-/observability/dashboards', @@ -26,21 +27,19 @@ describe('Observability root app', () => { const TEST_IFRAME_SRC = 'https://observe.gitlab.com/9970/?groupId=14485840'; - const OBSERVABILITY_ROUTES = Object.keys(SKELETON_VARIANTS_BY_ROUTE); - - const SKELETON_VARIANTS = Object.values(SKELETON_VARIANTS_BY_ROUTE); + const TEST_USERNAME = 'test-user'; - const mountComponent = (route = $route) => { + const mountComponent = (props) => { wrapper = shallowMountExtended(ObservabilityApp, { propsData: { observabilityIframeSrc: TEST_IFRAME_SRC, + ...props, }, stubs: { 'observability-skeleton': ObservabilitySkeleton, }, mocks: { - $router, - $route: route, + $route, }, }); }; @@ -48,13 +47,11 @@ describe('Observability root app', () => { const dispatchMessageEvent = (message) => window.dispatchEvent(new MessageEvent('message', message)); - describe('iframe src', () => { - const TEST_USERNAME = 'test-user'; - - beforeEach(() => { - gon.current_username = TEST_USERNAME; - }); + beforeEach(() => { + gon.current_username = TEST_USERNAME; + }); + describe('iframe src', () => { it('should render an iframe with observabilityIframeSrc, decorated with light theme and username', () => { darkModeEnabled.mockReturnValueOnce(false); mountComponent(); @@ -88,48 +85,70 @@ describe('Observability root app', () => { }); }); - describe('on GOUI_ROUTE_UPDATE', () => { - it('should not call replace method from vue router if message event does not have url', () => { - mountComponent(); - dispatchMessageEvent({ - type: MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE, - payload: { data: 'some other data' }, + describe('iframe kiosk query param', () => { + it('when inlineEmbed, it should set the proper kiosk query parameter', () => { + mountComponent({ + inlineEmbed: true, }); - expect(replace).not.toHaveBeenCalled(); + + const iframe = findIframe(); + + expect(iframe.attributes('src')).toBe( + `${TEST_IFRAME_SRC}&theme=light&username=${TEST_USERNAME}&kiosk=inline-embed`, + ); }); + }); - it.each` - condition | origin | observability_path | url - ${'message origin is different from iframe source origin'} | ${'https://example.com'} | ${'/'} | ${'/explore'} - ${'path is same as before (observability_path)'} | ${'https://observe.gitlab.com'} | ${'/foo?bar=test'} | ${'/foo?bar=test'} - `( - 'should not call replace method from vue router if $condition', - async ({ origin, observability_path, url }) => { - mountComponent({ ...$route, query: { observability_path } }); - dispatchMessageEvent({ - data: { type: MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE, payload: { url } }, - origin, - }); - expect(replace).not.toHaveBeenCalled(); - }, - ); + describe('iframe size', () => { + it('should set the specified size', () => { + mountComponent({ + height: INLINE_EMBED_DIMENSIONS.HEIGHT, + width: INLINE_EMBED_DIMENSIONS.WIDTH, + }); + + const iframe = findIframe(); + + expect(iframe.attributes('width')).toBe(INLINE_EMBED_DIMENSIONS.WIDTH); + expect(iframe.attributes('height')).toBe(INLINE_EMBED_DIMENSIONS.HEIGHT); + }); + + it('should fallback to default size', () => { + mountComponent({}); - it('should call replace method from vue router on message event callback', () => { + const iframe = findIframe(); + + expect(iframe.attributes('width')).toBe(FULL_APP_DIMENSIONS.WIDTH); + expect(iframe.attributes('height')).toBe(FULL_APP_DIMENSIONS.HEIGHT); + }); + }); + + describe('skeleton variant', () => { + it('sets the specified skeleton variant', () => { + mountComponent({ skeletonVariant: SKELETON_VARIANT_EMBED }); + const props = wrapper.findComponent(ObservabilitySkeleton).props(); + + expect(props.variant).toBe(SKELETON_VARIANT_EMBED); + }); + + it('should have a default skeleton variant', () => { + mountComponent(); + const props = wrapper.findComponent(ObservabilitySkeleton).props(); + + expect(props.variant).toBe('dashboards'); + }); + }); + + describe('on GOUI_ROUTE_UPDATE', () => { + it('should emit a route-update event', () => { mountComponent(); + const payload = { url: '/explore' }; dispatchMessageEvent({ - data: { type: MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE, payload: { url: '/explore' } }, + data: { type: MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE, payload }, origin: 'https://observe.gitlab.com', }); - expect(replace).toHaveBeenCalled(); - expect(replace).toHaveBeenCalledWith({ - name: 'https://gitlab.com/gitlab-org/', - query: { - otherQuery: 100, - observability_path: '/explore', - }, - }); + expect(wrapper.emitted('route-update')[0]).toEqual([payload]); }); }); @@ -163,34 +182,17 @@ describe('Observability root app', () => { }); }); - describe('skeleton variant', () => { - it.each` - pathDescription | path | variant - ${'dashboards'} | ${OBSERVABILITY_ROUTES[0]} | ${SKELETON_VARIANTS[0]} - ${'explore'} | ${OBSERVABILITY_ROUTES[1]} | ${SKELETON_VARIANTS[1]} - ${'manage dashboards'} | ${OBSERVABILITY_ROUTES[2]} | ${SKELETON_VARIANTS[2]} - ${'any other'} | ${'unknown/route'} | ${SKELETON_VARIANTS[0]} - `('renders the $variant skeleton variant for $pathDescription path', ({ path, variant }) => { - mountComponent({ ...$route, path }); - const props = wrapper.findComponent(ObservabilitySkeleton).props(); - - expect(props.variant).toBe(variant); - }); - }); - - describe('on observability ui unmount', () => { - it('should remove message event and should not call replace method from vue router', () => { + describe('on unmount', () => { + it('should not emit any even on route update', () => { mountComponent(); wrapper.destroy(); - // testing event cleanup logic, should not call on messege event after component is destroyed - dispatchMessageEvent({ data: { type: MESSAGE_EVENT_TYPE.GOUI_ROUTE_UPDATE, payload: { url: '/explore' } }, origin: 'https://observe.gitlab.com', }); - expect(replace).not.toHaveBeenCalled(); + expect(wrapper.emitted('route-update')).toBeUndefined(); }); }); }); diff --git a/spec/frontend/observability/skeleton_spec.js b/spec/frontend/observability/skeleton_spec.js index a95597d8516..65dbb003743 100644 --- a/spec/frontend/observability/skeleton_spec.js +++ b/spec/frontend/observability/skeleton_spec.js @@ -6,8 +6,13 @@ import Skeleton from '~/observability/components/skeleton/index.vue'; import DashboardsSkeleton from '~/observability/components/skeleton/dashboards.vue'; import ExploreSkeleton from '~/observability/components/skeleton/explore.vue'; import ManageSkeleton from '~/observability/components/skeleton/manage.vue'; +import EmbedSkeleton from '~/observability/components/skeleton/embed.vue'; -import { SKELETON_VARIANTS_BY_ROUTE, DEFAULT_TIMERS } from '~/observability/constants'; +import { + SKELETON_VARIANTS_BY_ROUTE, + DEFAULT_TIMERS, + SKELETON_VARIANT_EMBED, +} from '~/observability/constants'; describe('Skeleton component', () => { let wrapper; @@ -22,6 +27,8 @@ describe('Skeleton component', () => { const findManageSkeleton = () => wrapper.findComponent(ManageSkeleton); + const findEmbedSkeleton = () => wrapper.findComponent(EmbedSkeleton); + const findAlert = () => wrapper.findComponent(GlAlert); const mountComponent = ({ ...props } = {}) => { @@ -97,16 +104,20 @@ describe('Skeleton component', () => { ${'dashboards'} | ${'variant is dashboards'} | ${SKELETON_VARIANTS[0]} ${'explore'} | ${'variant is explore'} | ${SKELETON_VARIANTS[1]} ${'manage'} | ${'variant is manage'} | ${SKELETON_VARIANTS[2]} + ${'embed'} | ${'variant is embed'} | ${SKELETON_VARIANT_EMBED} ${'default'} | ${'variant is not manage, dashboards or explore'} | ${'unknown'} `('should render $skeletonType skeleton if $condition', async ({ skeletonType, variant }) => { mountComponent({ variant }); jest.advanceTimersByTime(DEFAULT_TIMERS.CONTENT_WAIT_MS); await nextTick(); - const showsDefaultSkeleton = !SKELETON_VARIANTS.includes(variant); + const showsDefaultSkeleton = ![...SKELETON_VARIANTS, SKELETON_VARIANT_EMBED].includes( + variant, + ); expect(findDashboardsSkeleton().exists()).toBe(skeletonType === SKELETON_VARIANTS[0]); expect(findExploreSkeleton().exists()).toBe(skeletonType === SKELETON_VARIANTS[1]); expect(findManageSkeleton().exists()).toBe(skeletonType === SKELETON_VARIANTS[2]); + expect(findEmbedSkeleton().exists()).toBe(skeletonType === SKELETON_VARIANT_EMBED); expect(wrapper.findComponent(GlSkeletonLoader).exists()).toBe(showsDefaultSkeleton); }); diff --git a/spec/services/access_token_validation_service_spec.rb b/spec/services/access_token_validation_service_spec.rb index 2bf74d64dc9..4cdce094358 100644 --- a/spec/services/access_token_validation_service_spec.rb +++ b/spec/services/access_token_validation_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe AccessTokenValidationService do +RSpec.describe AccessTokenValidationService, feature_category: :system_access do describe ".include_any_scope?" do let(:request) { double("request") } diff --git a/spec/services/audit_event_service_spec.rb b/spec/services/audit_event_service_spec.rb index 4f8b90fcb4a..8a20f7775eb 100644 --- a/spec/services/audit_event_service_spec.rb +++ b/spec/services/audit_event_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe AuditEventService, :with_license do +RSpec.describe AuditEventService, :with_license, feature_category: :audit_events do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user, :with_sign_ins) } let_it_be(:project_member) { create(:project_member, user: user) } diff --git a/spec/services/auto_merge_service_spec.rb b/spec/services/auto_merge_service_spec.rb index 7584e44152e..94f4b414dca 100644 --- a/spec/services/auto_merge_service_spec.rb +++ b/spec/services/auto_merge_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe AutoMergeService do +RSpec.describe AutoMergeService, feature_category: :code_review_workflow do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user) } diff --git a/spec/services/base_container_service_spec.rb b/spec/services/base_container_service_spec.rb index 1de79eec702..7406f0aea93 100644 --- a/spec/services/base_container_service_spec.rb +++ b/spec/services/base_container_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BaseContainerService do +RSpec.describe BaseContainerService, feature_category: :container_registry do let(:project) { Project.new } let(:user) { User.new } diff --git a/spec/services/base_count_service_spec.rb b/spec/services/base_count_service_spec.rb index 18cab2e8e9a..9a731f52b09 100644 --- a/spec/services/base_count_service_spec.rb +++ b/spec/services/base_count_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BaseCountService, :use_clean_rails_memory_store_caching do +RSpec.describe BaseCountService, :use_clean_rails_memory_store_caching, feature_category: :shared do let(:service) { described_class.new } describe '#relation_for_count' do diff --git a/spec/services/bulk_create_integration_service_spec.rb b/spec/services/bulk_create_integration_service_spec.rb index 22bb1736f9f..57bdfdbd4cb 100644 --- a/spec/services/bulk_create_integration_service_spec.rb +++ b/spec/services/bulk_create_integration_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BulkCreateIntegrationService do +RSpec.describe BulkCreateIntegrationService, feature_category: :integrations do include JiraIntegrationHelpers before_all do diff --git a/spec/services/bulk_push_event_payload_service_spec.rb b/spec/services/bulk_push_event_payload_service_spec.rb index 381c735c003..95e1c831498 100644 --- a/spec/services/bulk_push_event_payload_service_spec.rb +++ b/spec/services/bulk_push_event_payload_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BulkPushEventPayloadService do +RSpec.describe BulkPushEventPayloadService, feature_category: :source_code_management do let(:event) { create(:push_event) } let(:push_data) do diff --git a/spec/services/bulk_update_integration_service_spec.rb b/spec/services/bulk_update_integration_service_spec.rb index 24a868b524d..260eed3c734 100644 --- a/spec/services/bulk_update_integration_service_spec.rb +++ b/spec/services/bulk_update_integration_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe BulkUpdateIntegrationService do +RSpec.describe BulkUpdateIntegrationService, feature_category: :integrations do include JiraIntegrationHelpers before_all do diff --git a/spec/services/cohorts_service_spec.rb b/spec/services/cohorts_service_spec.rb index dce8d4f80f2..ab53bcf8657 100644 --- a/spec/services/cohorts_service_spec.rb +++ b/spec/services/cohorts_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe CohortsService do +RSpec.describe CohortsService, feature_category: :shared do describe '#execute' do def month_start(months_ago) months_ago.months.ago.beginning_of_month.to_date diff --git a/spec/services/compare_service_spec.rb b/spec/services/compare_service_spec.rb index e96a7f2f4f4..6757fbdf5d4 100644 --- a/spec/services/compare_service_spec.rb +++ b/spec/services/compare_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe CompareService do +RSpec.describe CompareService, feature_category: :source_code_management do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:service) { described_class.new(project, 'feature') } diff --git a/spec/services/event_create_service_spec.rb b/spec/services/event_create_service_spec.rb index 6805f14133e..d14f130233e 100644 --- a/spec/services/event_create_service_spec.rb +++ b/spec/services/event_create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe EventCreateService, :clean_gitlab_redis_cache, :clean_gitlab_redis_shared_state do +RSpec.describe EventCreateService, :clean_gitlab_redis_cache, :clean_gitlab_redis_shared_state, feature_category: :service_ping do include SnowplowHelpers let(:service) { described_class.new } diff --git a/spec/services/gravatar_service_spec.rb b/spec/services/gravatar_service_spec.rb index a6418b02f78..6ccb362cc5c 100644 --- a/spec/services/gravatar_service_spec.rb +++ b/spec/services/gravatar_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe GravatarService do +RSpec.describe GravatarService, feature_category: :user_profile do describe '#execute' do let(:url) { 'http://example.com/avatar?hash=%{hash}&size=%{size}&email=%{email}&username=%{username}' } diff --git a/spec/services/import_export_clean_up_service_spec.rb b/spec/services/import_export_clean_up_service_spec.rb index 2bcdfa6dd8f..7b638b4948b 100644 --- a/spec/services/import_export_clean_up_service_spec.rb +++ b/spec/services/import_export_clean_up_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe ImportExportCleanUpService do +RSpec.describe ImportExportCleanUpService, feature_category: :importers do describe '#execute' do let(:service) { described_class.new } diff --git a/spec/services/markdown_content_rewriter_service_spec.rb b/spec/services/markdown_content_rewriter_service_spec.rb index d94289856cf..bf15ef08647 100644 --- a/spec/services/markdown_content_rewriter_service_spec.rb +++ b/spec/services/markdown_content_rewriter_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe MarkdownContentRewriterService do +RSpec.describe MarkdownContentRewriterService, feature_category: :team_planning do let_it_be(:user) { create(:user) } let_it_be(:source_parent) { create(:project, :public) } let_it_be(:target_parent) { create(:project, :public) } diff --git a/spec/services/note_summary_spec.rb b/spec/services/note_summary_spec.rb index ad244f62292..1cbbb68205d 100644 --- a/spec/services/note_summary_spec.rb +++ b/spec/services/note_summary_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe NoteSummary do +RSpec.describe NoteSummary, feature_category: :code_review_workflow do let(:project) { build(:project) } let(:noteable) { build(:issue) } let(:user) { build(:user) } diff --git a/spec/services/post_receive_service_spec.rb b/spec/services/post_receive_service_spec.rb index aa955b3445b..13bd103003f 100644 --- a/spec/services/post_receive_service_spec.rb +++ b/spec/services/post_receive_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe PostReceiveService do +RSpec.describe PostReceiveService, feature_category: :team_planning do include GitlabShellHelpers include Gitlab::Routing diff --git a/spec/services/preview_markdown_service_spec.rb b/spec/services/preview_markdown_service_spec.rb index d1bc10cfd28..97e31ec2cd3 100644 --- a/spec/services/preview_markdown_service_spec.rb +++ b/spec/services/preview_markdown_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe PreviewMarkdownService do +RSpec.describe PreviewMarkdownService, feature_category: :team_planning do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/services/push_event_payload_service_spec.rb b/spec/services/push_event_payload_service_spec.rb index de2bec21a3c..50da5ca9b24 100644 --- a/spec/services/push_event_payload_service_spec.rb +++ b/spec/services/push_event_payload_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe PushEventPayloadService do +RSpec.describe PushEventPayloadService, feature_category: :source_code_management do let(:event) { create(:push_event) } describe '#execute' do diff --git a/spec/services/repository_archive_clean_up_service_spec.rb b/spec/services/repository_archive_clean_up_service_spec.rb index 8db1a6858fa..1ce68080c73 100644 --- a/spec/services/repository_archive_clean_up_service_spec.rb +++ b/spec/services/repository_archive_clean_up_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe RepositoryArchiveCleanUpService do +RSpec.describe RepositoryArchiveCleanUpService, feature_category: :source_code_management do subject(:service) { described_class.new } describe '#execute (new archive locations)' do diff --git a/spec/services/reset_project_cache_service_spec.rb b/spec/services/reset_project_cache_service_spec.rb index 165b38ee338..6ae516a5f07 100644 --- a/spec/services/reset_project_cache_service_spec.rb +++ b/spec/services/reset_project_cache_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe ResetProjectCacheService do +RSpec.describe ResetProjectCacheService, feature_category: :projects do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/services/service_response_spec.rb b/spec/services/service_response_spec.rb index 58dd2fd4c5e..6171ca1a8a6 100644 --- a/spec/services/service_response_spec.rb +++ b/spec/services/service_response_spec.rb @@ -7,7 +7,7 @@ require 're2' require_relative '../../app/services/service_response' require_relative '../../lib/gitlab/error_tracking' -RSpec.describe ServiceResponse do +RSpec.describe ServiceResponse, feature_category: :shared do describe '.success' do it 'creates a successful response without a message' do expect(described_class.success).to be_success diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb index 5d60b6e0487..883a7d3a2ce 100644 --- a/spec/services/system_hooks_service_spec.rb +++ b/spec/services/system_hooks_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe SystemHooksService do +RSpec.describe SystemHooksService, feature_category: :webhooks do describe '#execute_hooks_for' do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } diff --git a/spec/services/task_list_toggle_service_spec.rb b/spec/services/task_list_toggle_service_spec.rb index f889f298213..b0444a5ba72 100644 --- a/spec/services/task_list_toggle_service_spec.rb +++ b/spec/services/task_list_toggle_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TaskListToggleService do +RSpec.describe TaskListToggleService, feature_category: :team_planning do let(:markdown) do <<-EOT.strip_heredoc * [ ] Task 1 diff --git a/spec/services/tasks_to_be_done/base_service_spec.rb b/spec/services/tasks_to_be_done/base_service_spec.rb index cfeff36cc0d..ff4eefdfb3a 100644 --- a/spec/services/tasks_to_be_done/base_service_spec.rb +++ b/spec/services/tasks_to_be_done/base_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TasksToBeDone::BaseService do +RSpec.describe TasksToBeDone::BaseService, feature_category: :team_planning do let_it_be(:project) { create(:project) } let_it_be(:current_user) { create(:user) } let_it_be(:assignee_one) { create(:user) } diff --git a/spec/services/terraform/remote_state_handler_spec.rb b/spec/services/terraform/remote_state_handler_spec.rb index 369309e4d5a..f4f7a8a0985 100644 --- a/spec/services/terraform/remote_state_handler_spec.rb +++ b/spec/services/terraform/remote_state_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Terraform::RemoteStateHandler do +RSpec.describe Terraform::RemoteStateHandler, feature_category: :infrastructure_as_code do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user, developer_projects: [project]) } let_it_be(:maintainer) { create(:user, maintainer_projects: [project]) } diff --git a/spec/services/terraform/states/destroy_service_spec.rb b/spec/services/terraform/states/destroy_service_spec.rb index 5acf32cd73c..3515a758827 100644 --- a/spec/services/terraform/states/destroy_service_spec.rb +++ b/spec/services/terraform/states/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Terraform::States::DestroyService do +RSpec.describe Terraform::States::DestroyService, feature_category: :infrastructure_as_code do let_it_be(:state) { create(:terraform_state, :with_version, :deletion_in_progress) } let(:file) { instance_double(Terraform::StateUploader, relative_path: 'path') } diff --git a/spec/services/terraform/states/trigger_destroy_service_spec.rb b/spec/services/terraform/states/trigger_destroy_service_spec.rb index 459f4c3bdb9..0b37d962353 100644 --- a/spec/services/terraform/states/trigger_destroy_service_spec.rb +++ b/spec/services/terraform/states/trigger_destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Terraform::States::TriggerDestroyService do +RSpec.describe Terraform::States::TriggerDestroyService, feature_category: :infrastructure_as_code do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user, maintainer_projects: [project]) } diff --git a/spec/services/test_hooks/project_service_spec.rb b/spec/services/test_hooks/project_service_spec.rb index 13f863dbbdb..31f97edbd08 100644 --- a/spec/services/test_hooks/project_service_spec.rb +++ b/spec/services/test_hooks/project_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TestHooks::ProjectService do +RSpec.describe TestHooks::ProjectService, feature_category: :code_testing do include AfterNextHelpers let(:current_user) { create(:user) } diff --git a/spec/services/test_hooks/system_service_spec.rb b/spec/services/test_hooks/system_service_spec.rb index e94ea4669c6..4c5009fea54 100644 --- a/spec/services/test_hooks/system_service_spec.rb +++ b/spec/services/test_hooks/system_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TestHooks::SystemService do +RSpec.describe TestHooks::SystemService, feature_category: :code_testing do include AfterNextHelpers describe '#execute' do diff --git a/spec/services/timelogs/delete_service_spec.rb b/spec/services/timelogs/delete_service_spec.rb index ee1133af6b3..c0543bafcec 100644 --- a/spec/services/timelogs/delete_service_spec.rb +++ b/spec/services/timelogs/delete_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Timelogs::DeleteService do +RSpec.describe Timelogs::DeleteService, feature_category: :team_planning do let_it_be(:author) { create(:user) } let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 8afa409b0cf..f0aabd0a8dc 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TodoService do +RSpec.describe TodoService, feature_category: :team_planning do include AfterNextHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/services/todos/allowed_target_filter_service_spec.rb b/spec/services/todos/allowed_target_filter_service_spec.rb index 1d2b1b044db..3929e3788d0 100644 --- a/spec/services/todos/allowed_target_filter_service_spec.rb +++ b/spec/services/todos/allowed_target_filter_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::AllowedTargetFilterService do +RSpec.describe Todos::AllowedTargetFilterService, feature_category: :team_planning do include DesignManagementTestHelpers let_it_be(:authorized_group) { create(:group, :private) } diff --git a/spec/services/todos/destroy/confidential_issue_service_spec.rb b/spec/services/todos/destroy/confidential_issue_service_spec.rb index e3dcc2bae95..9de71faf8bf 100644 --- a/spec/services/todos/destroy/confidential_issue_service_spec.rb +++ b/spec/services/todos/destroy/confidential_issue_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::Destroy::ConfidentialIssueService do +RSpec.describe Todos::Destroy::ConfidentialIssueService, feature_category: :team_planning do let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:author) { create(:user) } diff --git a/spec/services/todos/destroy/design_service_spec.rb b/spec/services/todos/destroy/design_service_spec.rb index 92b25d94dc6..628398e7062 100644 --- a/spec/services/todos/destroy/design_service_spec.rb +++ b/spec/services/todos/destroy/design_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::Destroy::DesignService do +RSpec.describe Todos::Destroy::DesignService, feature_category: :design_management do let_it_be(:user) { create(:user) } let_it_be(:user_2) { create(:user) } let_it_be(:design) { create(:design) } diff --git a/spec/services/todos/destroy/destroyed_issuable_service_spec.rb b/spec/services/todos/destroy/destroyed_issuable_service_spec.rb index 6d6abe06d1c..63ff189ede5 100644 --- a/spec/services/todos/destroy/destroyed_issuable_service_spec.rb +++ b/spec/services/todos/destroy/destroyed_issuable_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::Destroy::DestroyedIssuableService do +RSpec.describe Todos::Destroy::DestroyedIssuableService, feature_category: :team_planning do describe '#execute' do let_it_be(:user) { create(:user) } diff --git a/spec/services/todos/destroy/project_private_service_spec.rb b/spec/services/todos/destroy/project_private_service_spec.rb index 1d1c010535d..cc15f6eab8b 100644 --- a/spec/services/todos/destroy/project_private_service_spec.rb +++ b/spec/services/todos/destroy/project_private_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::Destroy::ProjectPrivateService do +RSpec.describe Todos::Destroy::ProjectPrivateService, feature_category: :team_planning do let(:group) { create(:group, :public) } let(:project) { create(:project, :public, group: group) } let(:user) { create(:user) } diff --git a/spec/services/todos/destroy/unauthorized_features_service_spec.rb b/spec/services/todos/destroy/unauthorized_features_service_spec.rb index 5f6c9b0cdf0..c02c0dfd5c8 100644 --- a/spec/services/todos/destroy/unauthorized_features_service_spec.rb +++ b/spec/services/todos/destroy/unauthorized_features_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Todos::Destroy::UnauthorizedFeaturesService do +RSpec.describe Todos::Destroy::UnauthorizedFeaturesService, feature_category: :team_planning do let_it_be(:project, reload: true) { create(:project, :public, :repository) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:mr) { create(:merge_request, source_project: project) } diff --git a/spec/services/topics/merge_service_spec.rb b/spec/services/topics/merge_service_spec.rb index 98247250a61..41afabdf2ca 100644 --- a/spec/services/topics/merge_service_spec.rb +++ b/spec/services/topics/merge_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Topics::MergeService do +RSpec.describe Topics::MergeService, feature_category: :shared do let_it_be(:source_topic) { create(:topic, name: 'source_topic') } let_it_be(:target_topic) { create(:topic, name: 'target_topic') } let_it_be(:project_1) { create(:project, :public, topic_list: source_topic.name) } diff --git a/spec/services/two_factor/destroy_service_spec.rb b/spec/services/two_factor/destroy_service_spec.rb index 30c189520fd..0811ce336c8 100644 --- a/spec/services/two_factor/destroy_service_spec.rb +++ b/spec/services/two_factor/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TwoFactor::DestroyService do +RSpec.describe TwoFactor::DestroyService, feature_category: :system_access do let_it_be(:current_user) { create(:user) } subject { described_class.new(current_user, user: user).execute } diff --git a/spec/services/update_container_registry_info_service_spec.rb b/spec/services/update_container_registry_info_service_spec.rb index 64071e79508..416b08bd04b 100644 --- a/spec/services/update_container_registry_info_service_spec.rb +++ b/spec/services/update_container_registry_info_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe UpdateContainerRegistryInfoService do +RSpec.describe UpdateContainerRegistryInfoService, feature_category: :container_registry do let_it_be(:application_settings) { Gitlab::CurrentSettings } let_it_be(:api_url) { 'http://registry.gitlab' } diff --git a/spec/services/update_merge_request_metrics_service_spec.rb b/spec/services/update_merge_request_metrics_service_spec.rb index a07fcee91e4..f30836fbaf5 100644 --- a/spec/services/update_merge_request_metrics_service_spec.rb +++ b/spec/services/update_merge_request_metrics_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe MergeRequestMetricsService do +RSpec.describe MergeRequestMetricsService, feature_category: :code_review_workflow do let(:metrics) { create(:merge_request).metrics } describe '#merge' do diff --git a/spec/services/upload_service_spec.rb b/spec/services/upload_service_spec.rb index 48aa65451f3..518d12d5b41 100644 --- a/spec/services/upload_service_spec.rb +++ b/spec/services/upload_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe UploadService do +RSpec.describe UploadService, feature_category: :shared do describe 'File service' do before do @user = create(:user) diff --git a/spec/services/uploads/destroy_service_spec.rb b/spec/services/uploads/destroy_service_spec.rb index bb58da231b6..76ac2ec245e 100644 --- a/spec/services/uploads/destroy_service_spec.rb +++ b/spec/services/uploads/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Uploads::DestroyService do +RSpec.describe Uploads::DestroyService, feature_category: :shared do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } let_it_be_with_reload(:upload) { create(:upload, :issuable_upload, model: project) } diff --git a/spec/services/user_preferences/update_service_spec.rb b/spec/services/user_preferences/update_service_spec.rb index 59089a4a7af..09acc01729e 100644 --- a/spec/services/user_preferences/update_service_spec.rb +++ b/spec/services/user_preferences/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe UserPreferences::UpdateService do +RSpec.describe UserPreferences::UpdateService, feature_category: :user_profile do let(:user) { create(:user) } let(:params) { { view_diffs_file_by_file: false } } diff --git a/spec/services/users/activity_service_spec.rb b/spec/services/users/activity_service_spec.rb index 6c0d93f568a..f78535569b3 100644 --- a/spec/services/users/activity_service_spec.rb +++ b/spec/services/users/activity_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::ActivityService do +RSpec.describe Users::ActivityService, feature_category: :user_profile do include ExclusiveLeaseHelpers let(:user) { create(:user, last_activity_on: last_activity_on) } diff --git a/spec/services/users/approve_service_spec.rb b/spec/services/users/approve_service_spec.rb index 34eb5b18ff6..1b063a9ad1c 100644 --- a/spec/services/users/approve_service_spec.rb +++ b/spec/services/users/approve_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::ApproveService do +RSpec.describe Users::ApproveService, feature_category: :user_management do let_it_be(:current_user) { create(:admin) } let(:user) { create(:user, :blocked_pending_approval) } diff --git a/spec/services/users/authorized_build_service_spec.rb b/spec/services/users/authorized_build_service_spec.rb index 57a122cbf35..7eed6833cba 100644 --- a/spec/services/users/authorized_build_service_spec.rb +++ b/spec/services/users/authorized_build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::AuthorizedBuildService do +RSpec.describe Users::AuthorizedBuildService, feature_category: :user_management do describe '#execute' do let_it_be(:current_user) { create(:user) } diff --git a/spec/services/users/ban_service_spec.rb b/spec/services/users/ban_service_spec.rb index 3f9c7ebf067..5be5de82e91 100644 --- a/spec/services/users/ban_service_spec.rb +++ b/spec/services/users/ban_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::BanService do +RSpec.describe Users::BanService, feature_category: :user_management do let(:user) { create(:user) } let_it_be(:current_user) { create(:admin) } diff --git a/spec/services/users/banned_user_base_service_spec.rb b/spec/services/users/banned_user_base_service_spec.rb index 29a549f0f49..65b24e08d80 100644 --- a/spec/services/users/banned_user_base_service_spec.rb +++ b/spec/services/users/banned_user_base_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::BannedUserBaseService do +RSpec.describe Users::BannedUserBaseService, feature_category: :user_management do let(:admin) { create(:admin) } let(:base_service) { described_class.new(admin) } diff --git a/spec/services/users/batch_status_cleaner_service_spec.rb b/spec/services/users/batch_status_cleaner_service_spec.rb index 46a004542d8..8feec761fd0 100644 --- a/spec/services/users/batch_status_cleaner_service_spec.rb +++ b/spec/services/users/batch_status_cleaner_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::BatchStatusCleanerService do +RSpec.describe Users::BatchStatusCleanerService, feature_category: :user_management do let_it_be(:user_status_1) { create(:user_status, emoji: 'coffee', message: 'msg1', clear_status_at: 1.year.ago) } let_it_be(:user_status_2) { create(:user_status, emoji: 'coffee', message: 'msg1', clear_status_at: 1.year.from_now) } let_it_be(:user_status_3) { create(:user_status, emoji: 'coffee', message: 'msg1', clear_status_at: 2.years.ago) } diff --git a/spec/services/users/block_service_spec.rb b/spec/services/users/block_service_spec.rb index 7ff9a887f38..63aa375c8af 100644 --- a/spec/services/users/block_service_spec.rb +++ b/spec/services/users/block_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::BlockService do +RSpec.describe Users::BlockService, feature_category: :user_management do let_it_be(:current_user) { create(:admin) } subject(:service) { described_class.new(current_user) } diff --git a/spec/services/users/build_service_spec.rb b/spec/services/users/build_service_spec.rb index 98fe6d9b5ba..f3236d40412 100644 --- a/spec/services/users/build_service_spec.rb +++ b/spec/services/users/build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::BuildService do +RSpec.describe Users::BuildService, feature_category: :user_management do using RSpec::Parameterized::TableSyntax describe '#execute' do diff --git a/spec/services/users/create_service_spec.rb b/spec/services/users/create_service_spec.rb index f3c9701c556..eac4faa2042 100644 --- a/spec/services/users/create_service_spec.rb +++ b/spec/services/users/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::CreateService do +RSpec.describe Users::CreateService, feature_category: :user_management do describe '#execute' do let(:password) { User.random_password } let(:admin_user) { create(:admin) } diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb index 18ad946b289..5cd11efe942 100644 --- a/spec/services/users/destroy_service_spec.rb +++ b/spec/services/users/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::DestroyService do +RSpec.describe Users::DestroyService, feature_category: :user_management do let!(:user) { create(:user) } let!(:admin) { create(:admin) } let!(:namespace) { user.namespace } diff --git a/spec/services/users/dismiss_callout_service_spec.rb b/spec/services/users/dismiss_callout_service_spec.rb index 6ba9f180444..776388ef5f1 100644 --- a/spec/services/users/dismiss_callout_service_spec.rb +++ b/spec/services/users/dismiss_callout_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::DismissCalloutService do +RSpec.describe Users::DismissCalloutService, feature_category: :user_management do describe '#execute' do let_it_be(:user) { create(:user) } diff --git a/spec/services/users/dismiss_group_callout_service_spec.rb b/spec/services/users/dismiss_group_callout_service_spec.rb index d74602a7606..a653fa7ee00 100644 --- a/spec/services/users/dismiss_group_callout_service_spec.rb +++ b/spec/services/users/dismiss_group_callout_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::DismissGroupCalloutService do +RSpec.describe Users::DismissGroupCalloutService, feature_category: :user_management do describe '#execute' do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } diff --git a/spec/services/users/dismiss_project_callout_service_spec.rb b/spec/services/users/dismiss_project_callout_service_spec.rb index 73e50a4c37d..7bcb11e4dbc 100644 --- a/spec/services/users/dismiss_project_callout_service_spec.rb +++ b/spec/services/users/dismiss_project_callout_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::DismissProjectCalloutService do +RSpec.describe Users::DismissProjectCalloutService, feature_category: :user_management do describe '#execute' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/services/users/email_verification/generate_token_service_spec.rb b/spec/services/users/email_verification/generate_token_service_spec.rb index e7aa1bf8306..3b299622a90 100644 --- a/spec/services/users/email_verification/generate_token_service_spec.rb +++ b/spec/services/users/email_verification/generate_token_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::EmailVerification::GenerateTokenService do +RSpec.describe Users::EmailVerification::GenerateTokenService, feature_category: :system_access do using RSpec::Parameterized::TableSyntax let(:service) { described_class.new(attr: attr) } diff --git a/spec/services/users/email_verification/validate_token_service_spec.rb b/spec/services/users/email_verification/validate_token_service_spec.rb index 44af4a4d36f..9b69034290a 100644 --- a/spec/services/users/email_verification/validate_token_service_spec.rb +++ b/spec/services/users/email_verification/validate_token_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::EmailVerification::ValidateTokenService, :clean_gitlab_redis_rate_limiting do +RSpec.describe Users::EmailVerification::ValidateTokenService, :clean_gitlab_redis_rate_limiting, feature_category: :system_access do using RSpec::Parameterized::TableSyntax let(:service) { described_class.new(attr: attr, user: user, token: token) } diff --git a/spec/services/users/in_product_marketing_email_records_spec.rb b/spec/services/users/in_product_marketing_email_records_spec.rb index 0b9400dcd12..059f0890b53 100644 --- a/spec/services/users/in_product_marketing_email_records_spec.rb +++ b/spec/services/users/in_product_marketing_email_records_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::InProductMarketingEmailRecords do +RSpec.describe Users::InProductMarketingEmailRecords, feature_category: :onboarding do let_it_be(:user) { create :user } subject(:records) { described_class.new } diff --git a/spec/services/users/keys_count_service_spec.rb b/spec/services/users/keys_count_service_spec.rb index 607d2946b2c..258fe351e4b 100644 --- a/spec/services/users/keys_count_service_spec.rb +++ b/spec/services/users/keys_count_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::KeysCountService, :use_clean_rails_memory_store_caching do +RSpec.describe Users::KeysCountService, :use_clean_rails_memory_store_caching, feature_category: :system_access do let(:user) { create(:user) } subject { described_class.new(user) } diff --git a/spec/services/users/last_push_event_service_spec.rb b/spec/services/users/last_push_event_service_spec.rb index 5b755db407f..fe61f12fe1a 100644 --- a/spec/services/users/last_push_event_service_spec.rb +++ b/spec/services/users/last_push_event_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::LastPushEventService do +RSpec.describe Users::LastPushEventService, feature_category: :source_code_management do let(:user) { build(:user, id: 1) } let(:project) { build(:project, id: 2) } let(:event) { build(:push_event, id: 3, author: user, project: project) } diff --git a/spec/services/users/migrate_records_to_ghost_user_in_batches_service_spec.rb b/spec/services/users/migrate_records_to_ghost_user_in_batches_service_spec.rb index 107ff82016c..0b9f92a868e 100644 --- a/spec/services/users/migrate_records_to_ghost_user_in_batches_service_spec.rb +++ b/spec/services/users/migrate_records_to_ghost_user_in_batches_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::MigrateRecordsToGhostUserInBatchesService do +RSpec.describe Users::MigrateRecordsToGhostUserInBatchesService, feature_category: :user_management do let(:service) { described_class.new } let_it_be(:ghost_user_migration) { create(:ghost_user_migration) } diff --git a/spec/services/users/migrate_records_to_ghost_user_service_spec.rb b/spec/services/users/migrate_records_to_ghost_user_service_spec.rb index 827d6f652a4..cfa0ddff04d 100644 --- a/spec/services/users/migrate_records_to_ghost_user_service_spec.rb +++ b/spec/services/users/migrate_records_to_ghost_user_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::MigrateRecordsToGhostUserService do +RSpec.describe Users::MigrateRecordsToGhostUserService, feature_category: :user_management do include BatchDestroyDependentAssociationsHelper let!(:user) { create(:user) } diff --git a/spec/services/users/refresh_authorized_projects_service_spec.rb b/spec/services/users/refresh_authorized_projects_service_spec.rb index e33886d2add..55b27954a74 100644 --- a/spec/services/users/refresh_authorized_projects_service_spec.rb +++ b/spec/services/users/refresh_authorized_projects_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::RefreshAuthorizedProjectsService do +RSpec.describe Users::RefreshAuthorizedProjectsService, feature_category: :user_management do include ExclusiveLeaseHelpers # We're using let! here so that any expectations for the service class are not diff --git a/spec/services/users/registrations_build_service_spec.rb b/spec/services/users/registrations_build_service_spec.rb index fa53a4cc604..736db855fe0 100644 --- a/spec/services/users/registrations_build_service_spec.rb +++ b/spec/services/users/registrations_build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::RegistrationsBuildService do +RSpec.describe Users::RegistrationsBuildService, feature_category: :system_access do describe '#execute' do let(:base_params) { build_stubbed(:user).slice(:first_name, :last_name, :username, :email, :password) } let(:skip_param) { {} } diff --git a/spec/services/users/reject_service_spec.rb b/spec/services/users/reject_service_spec.rb index 37d003c5dac..f72666d8a63 100644 --- a/spec/services/users/reject_service_spec.rb +++ b/spec/services/users/reject_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::RejectService do +RSpec.describe Users::RejectService, feature_category: :user_management do let_it_be(:current_user) { create(:admin) } let(:user) { create(:user, :blocked_pending_approval) } diff --git a/spec/services/users/repair_ldap_blocked_service_spec.rb b/spec/services/users/repair_ldap_blocked_service_spec.rb index 54540d68af2..424c14ccdbc 100644 --- a/spec/services/users/repair_ldap_blocked_service_spec.rb +++ b/spec/services/users/repair_ldap_blocked_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::RepairLdapBlockedService do +RSpec.describe Users::RepairLdapBlockedService, feature_category: :system_access do let(:user) { create(:omniauth_user, provider: 'ldapmain', state: 'ldap_blocked') } let(:identity) { user.ldap_identity } diff --git a/spec/services/users/respond_to_terms_service_spec.rb b/spec/services/users/respond_to_terms_service_spec.rb index 1997dcd0e04..dc33f98535a 100644 --- a/spec/services/users/respond_to_terms_service_spec.rb +++ b/spec/services/users/respond_to_terms_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::RespondToTermsService do +RSpec.describe Users::RespondToTermsService, feature_category: :user_profile do let(:user) { create(:user) } let(:term) { create(:term) } diff --git a/spec/services/users/saved_replies/create_service_spec.rb b/spec/services/users/saved_replies/create_service_spec.rb index e01b6248308..ee42a53a220 100644 --- a/spec/services/users/saved_replies/create_service_spec.rb +++ b/spec/services/users/saved_replies/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::SavedReplies::CreateService do +RSpec.describe Users::SavedReplies::CreateService, feature_category: :team_planning do describe '#execute' do let_it_be(:current_user) { create(:user) } let_it_be(:saved_reply) { create(:saved_reply, user: current_user) } diff --git a/spec/services/users/saved_replies/destroy_service_spec.rb b/spec/services/users/saved_replies/destroy_service_spec.rb index cb97fac7b7c..41c2013e3df 100644 --- a/spec/services/users/saved_replies/destroy_service_spec.rb +++ b/spec/services/users/saved_replies/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::SavedReplies::DestroyService do +RSpec.describe Users::SavedReplies::DestroyService, feature_category: :team_planning do describe '#execute' do let!(:saved_reply) { create(:saved_reply) } diff --git a/spec/services/users/saved_replies/update_service_spec.rb b/spec/services/users/saved_replies/update_service_spec.rb index bdb54d7c8f7..c18b7395040 100644 --- a/spec/services/users/saved_replies/update_service_spec.rb +++ b/spec/services/users/saved_replies/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::SavedReplies::UpdateService do +RSpec.describe Users::SavedReplies::UpdateService, feature_category: :team_planning do describe '#execute' do let_it_be(:current_user) { create(:user) } let_it_be(:saved_reply) { create(:saved_reply, user: current_user) } diff --git a/spec/services/users/set_status_service_spec.rb b/spec/services/users/set_status_service_spec.rb index 76e86506d94..b75c558785f 100644 --- a/spec/services/users/set_status_service_spec.rb +++ b/spec/services/users/set_status_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::SetStatusService do +RSpec.describe Users::SetStatusService, feature_category: :user_management do let(:current_user) { create(:user) } subject(:service) { described_class.new(current_user, params) } diff --git a/spec/services/users/signup_service_spec.rb b/spec/services/users/signup_service_spec.rb index 3ae8d481541..29663411346 100644 --- a/spec/services/users/signup_service_spec.rb +++ b/spec/services/users/signup_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::SignupService do +RSpec.describe Users::SignupService, feature_category: :system_access do let(:user) { create(:user, setup_for_company: true) } describe '#execute' do diff --git a/spec/services/users/unban_service_spec.rb b/spec/services/users/unban_service_spec.rb index 3dcb8450e7b..20fe40b370f 100644 --- a/spec/services/users/unban_service_spec.rb +++ b/spec/services/users/unban_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UnbanService do +RSpec.describe Users::UnbanService, feature_category: :user_management do let(:user) { create(:user) } let_it_be(:current_user) { create(:admin) } diff --git a/spec/services/users/unblock_service_spec.rb b/spec/services/users/unblock_service_spec.rb index 25ee99427ab..95a077d6100 100644 --- a/spec/services/users/unblock_service_spec.rb +++ b/spec/services/users/unblock_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UnblockService do +RSpec.describe Users::UnblockService, feature_category: :user_management do let_it_be(:current_user) { create(:admin) } subject(:service) { described_class.new(current_user) } diff --git a/spec/services/users/update_canonical_email_service_spec.rb b/spec/services/users/update_canonical_email_service_spec.rb index 1dead13d338..559b759a400 100644 --- a/spec/services/users/update_canonical_email_service_spec.rb +++ b/spec/services/users/update_canonical_email_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UpdateCanonicalEmailService do +RSpec.describe Users::UpdateCanonicalEmailService, feature_category: :user_profile do let(:other_email) { "differentaddress@includeddomain.com" } before do diff --git a/spec/services/users/update_highest_member_role_service_spec.rb b/spec/services/users/update_highest_member_role_service_spec.rb index 89ddd635bb6..06f4d787d72 100644 --- a/spec/services/users/update_highest_member_role_service_spec.rb +++ b/spec/services/users/update_highest_member_role_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UpdateHighestMemberRoleService do +RSpec.describe Users::UpdateHighestMemberRoleService, feature_category: :user_management do let(:user) { create(:user) } let(:execute_service) { described_class.new(user).execute } diff --git a/spec/services/users/update_service_spec.rb b/spec/services/users/update_service_spec.rb index f4ea757f81a..1716685566c 100644 --- a/spec/services/users/update_service_spec.rb +++ b/spec/services/users/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UpdateService do +RSpec.describe Users::UpdateService, feature_category: :user_profile do let(:password) { User.random_password } let(:user) { create(:user, password: password, password_confirmation: password) } diff --git a/spec/services/users/update_todo_count_cache_service_spec.rb b/spec/services/users/update_todo_count_cache_service_spec.rb index 3d96af928df..eec637cf5b4 100644 --- a/spec/services/users/update_todo_count_cache_service_spec.rb +++ b/spec/services/users/update_todo_count_cache_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UpdateTodoCountCacheService do +RSpec.describe Users::UpdateTodoCountCacheService, feature_category: :team_planning do describe '#execute' do let_it_be(:user1) { create(:user) } let_it_be(:user2) { create(:user) } diff --git a/spec/services/users/upsert_credit_card_validation_service_spec.rb b/spec/services/users/upsert_credit_card_validation_service_spec.rb index ac7e619612f..37aa5fed838 100644 --- a/spec/services/users/upsert_credit_card_validation_service_spec.rb +++ b/spec/services/users/upsert_credit_card_validation_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::UpsertCreditCardValidationService do +RSpec.describe Users::UpsertCreditCardValidationService, feature_category: :user_profile do let_it_be(:user) { create(:user, requires_credit_card_verification: true) } let(:user_id) { user.id } diff --git a/spec/services/users/validate_manual_otp_service_spec.rb b/spec/services/users/validate_manual_otp_service_spec.rb index 4bb2c0b6ab6..9a6083bc41c 100644 --- a/spec/services/users/validate_manual_otp_service_spec.rb +++ b/spec/services/users/validate_manual_otp_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::ValidateManualOtpService, feature_category: :system_access do +RSpec.describe Users::ValidateManualOtpService, feature_category: :user_profile do let_it_be(:user) { create(:user) } let(:otp_code) { 42 } diff --git a/spec/services/users/validate_push_otp_service_spec.rb b/spec/services/users/validate_push_otp_service_spec.rb index 960b6bcd3bb..4ef374cbb7f 100644 --- a/spec/services/users/validate_push_otp_service_spec.rb +++ b/spec/services/users/validate_push_otp_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Users::ValidatePushOtpService do +RSpec.describe Users::ValidatePushOtpService, feature_category: :user_profile do let_it_be(:user) { create(:user) } subject(:validate) { described_class.new(user).execute } diff --git a/spec/services/verify_pages_domain_service_spec.rb b/spec/services/verify_pages_domain_service_spec.rb index 42f7ebc85f9..d66d584d3d0 100644 --- a/spec/services/verify_pages_domain_service_spec.rb +++ b/spec/services/verify_pages_domain_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe VerifyPagesDomainService do +RSpec.describe VerifyPagesDomainService, feature_category: :pages do using RSpec::Parameterized::TableSyntax include EmailHelpers diff --git a/spec/services/web_hooks/destroy_service_spec.rb b/spec/services/web_hooks/destroy_service_spec.rb index ca8cb8a1b75..642c25ab312 100644 --- a/spec/services/web_hooks/destroy_service_spec.rb +++ b/spec/services/web_hooks/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WebHooks::DestroyService do +RSpec.describe WebHooks::DestroyService, feature_category: :webhooks do let_it_be(:user) { create(:user) } subject { described_class.new(user) } diff --git a/spec/services/web_hooks/log_destroy_service_spec.rb b/spec/services/web_hooks/log_destroy_service_spec.rb index 7634726e5a4..b0444b659ba 100644 --- a/spec/services/web_hooks/log_destroy_service_spec.rb +++ b/spec/services/web_hooks/log_destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WebHooks::LogDestroyService do +RSpec.describe WebHooks::LogDestroyService, feature_category: :webhooks do subject(:service) { described_class.new(hook.id) } describe '#execute' do diff --git a/spec/services/web_hooks/log_execution_service_spec.rb b/spec/services/web_hooks/log_execution_service_spec.rb index 8a845f60ad2..f56c07386fa 100644 --- a/spec/services/web_hooks/log_execution_service_spec.rb +++ b/spec/services/web_hooks/log_execution_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WebHooks::LogExecutionService do +RSpec.describe WebHooks::LogExecutionService, feature_category: :webhooks do include ExclusiveLeaseHelpers using RSpec::Parameterized::TableSyntax diff --git a/spec/services/webauthn/authenticate_service_spec.rb b/spec/services/webauthn/authenticate_service_spec.rb index b40f9465b63..ca940dff0eb 100644 --- a/spec/services/webauthn/authenticate_service_spec.rb +++ b/spec/services/webauthn/authenticate_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'webauthn/fake_client' -RSpec.describe Webauthn::AuthenticateService do +RSpec.describe Webauthn::AuthenticateService, feature_category: :system_access do let(:client) { WebAuthn::FakeClient.new(origin) } let(:user) { create(:user) } let(:challenge) { Base64.strict_encode64(SecureRandom.random_bytes(32)) } diff --git a/spec/services/webauthn/register_service_spec.rb b/spec/services/webauthn/register_service_spec.rb index bb9fa2080d2..2286d261e94 100644 --- a/spec/services/webauthn/register_service_spec.rb +++ b/spec/services/webauthn/register_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'webauthn/fake_client' -RSpec.describe Webauthn::RegisterService do +RSpec.describe Webauthn::RegisterService, feature_category: :system_access do let(:client) { WebAuthn::FakeClient.new(origin) } let(:user) { create(:user) } let(:challenge) { Base64.strict_encode64(SecureRandom.random_bytes(32)) } diff --git a/spec/services/wiki_pages/base_service_spec.rb b/spec/services/wiki_pages/base_service_spec.rb index 6ccc796014c..f434dc689ef 100644 --- a/spec/services/wiki_pages/base_service_spec.rb +++ b/spec/services/wiki_pages/base_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WikiPages::BaseService do +RSpec.describe WikiPages::BaseService, feature_category: :wiki do let(:project) { double('project') } let(:user) { double('user') } diff --git a/spec/services/wiki_pages/create_service_spec.rb b/spec/services/wiki_pages/create_service_spec.rb index fd3776f4207..ca2d38ad70d 100644 --- a/spec/services/wiki_pages/create_service_spec.rb +++ b/spec/services/wiki_pages/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WikiPages::CreateService do +RSpec.describe WikiPages::CreateService, feature_category: :wiki do it_behaves_like 'WikiPages::CreateService#execute', :project describe '#execute' do diff --git a/spec/services/wiki_pages/destroy_service_spec.rb b/spec/services/wiki_pages/destroy_service_spec.rb index 9384ea1cd43..ff29fc59b3e 100644 --- a/spec/services/wiki_pages/destroy_service_spec.rb +++ b/spec/services/wiki_pages/destroy_service_spec.rb @@ -2,6 +2,6 @@ require 'spec_helper' -RSpec.describe WikiPages::DestroyService do +RSpec.describe WikiPages::DestroyService, feature_category: :wiki do it_behaves_like 'WikiPages::DestroyService#execute', :project end diff --git a/spec/services/wiki_pages/event_create_service_spec.rb b/spec/services/wiki_pages/event_create_service_spec.rb index 8476f872e98..cbc2bd82a98 100644 --- a/spec/services/wiki_pages/event_create_service_spec.rb +++ b/spec/services/wiki_pages/event_create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WikiPages::EventCreateService do +RSpec.describe WikiPages::EventCreateService, feature_category: :wiki do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } diff --git a/spec/services/wiki_pages/update_service_spec.rb b/spec/services/wiki_pages/update_service_spec.rb index 62881817e32..79b2b55907b 100644 --- a/spec/services/wiki_pages/update_service_spec.rb +++ b/spec/services/wiki_pages/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WikiPages::UpdateService do +RSpec.describe WikiPages::UpdateService, feature_category: :wiki do it_behaves_like 'WikiPages::UpdateService#execute', :project describe '#execute' do diff --git a/spec/services/wikis/create_attachment_service_spec.rb b/spec/services/wikis/create_attachment_service_spec.rb index 22e34e1f373..fccdbd3040b 100644 --- a/spec/services/wikis/create_attachment_service_spec.rb +++ b/spec/services/wikis/create_attachment_service_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe Wikis::CreateAttachmentService do +RSpec.describe Wikis::CreateAttachmentService, feature_category: :wiki do let(:container) { create(:project, :wiki_repo) } let(:user) { create(:user) } let(:file_name) { 'filename.txt' } diff --git a/spec/services/work_items/build_service_spec.rb b/spec/services/work_items/build_service_spec.rb index 405b4414fc2..3ecf78e0659 100644 --- a/spec/services/work_items/build_service_spec.rb +++ b/spec/services/work_items/build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::BuildService do +RSpec.describe WorkItems::BuildService, feature_category: :team_planning do let_it_be(:project) { create(:project, :repository) } let_it_be(:guest) { create(:user) } diff --git a/spec/services/work_items/create_from_task_service_spec.rb b/spec/services/work_items/create_from_task_service_spec.rb index 7c5430f038c..b2f81f1dc54 100644 --- a/spec/services/work_items/create_from_task_service_spec.rb +++ b/spec/services/work_items/create_from_task_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::CreateFromTaskService do +RSpec.describe WorkItems::CreateFromTaskService, feature_category: :team_planning do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user) } let_it_be(:list_work_item, refind: true) { create(:work_item, project: project, description: "- [ ] Item to be converted\n second line\n third line") } diff --git a/spec/services/work_items/create_service_spec.rb b/spec/services/work_items/create_service_spec.rb index 1b134c308f2..ecd7937f933 100644 --- a/spec/services/work_items/create_service_spec.rb +++ b/spec/services/work_items/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::CreateService do +RSpec.describe WorkItems::CreateService, feature_category: :team_planning do include AfterNextHelpers let_it_be_with_reload(:project) { create(:project) } diff --git a/spec/services/work_items/delete_service_spec.rb b/spec/services/work_items/delete_service_spec.rb index 69ae881a12f..ac72815a57e 100644 --- a/spec/services/work_items/delete_service_spec.rb +++ b/spec/services/work_items/delete_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::DeleteService do +RSpec.describe WorkItems::DeleteService, feature_category: :team_planning do let_it_be(:project) { create(:project, :repository) } let_it_be(:guest) { create(:user) } let_it_be(:work_item, refind: true) { create(:work_item, project: project, author: guest) } diff --git a/spec/services/work_items/delete_task_service_spec.rb b/spec/services/work_items/delete_task_service_spec.rb index 07a0d8d6c1a..dc01da65771 100644 --- a/spec/services/work_items/delete_task_service_spec.rb +++ b/spec/services/work_items/delete_task_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::DeleteTaskService do +RSpec.describe WorkItems::DeleteTaskService, feature_category: :team_planning do let_it_be(:project) { create(:project) } let_it_be(:developer) { create(:user).tap { |u| project.add_developer(u) } } let_it_be_with_refind(:task) { create(:work_item, project: project, author: developer) } diff --git a/spec/services/work_items/parent_links/destroy_service_spec.rb b/spec/services/work_items/parent_links/destroy_service_spec.rb index 654a03ef6f7..c77546f6ca1 100644 --- a/spec/services/work_items/parent_links/destroy_service_spec.rb +++ b/spec/services/work_items/parent_links/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::ParentLinks::DestroyService do +RSpec.describe WorkItems::ParentLinks::DestroyService, feature_category: :team_planning do describe '#execute' do let_it_be(:reporter) { create(:user) } let_it_be(:guest) { create(:user) } diff --git a/spec/services/work_items/task_list_reference_removal_service_spec.rb b/spec/services/work_items/task_list_reference_removal_service_spec.rb index 91b7814ae92..4e87ce66c21 100644 --- a/spec/services/work_items/task_list_reference_removal_service_spec.rb +++ b/spec/services/work_items/task_list_reference_removal_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::TaskListReferenceRemovalService do +RSpec.describe WorkItems::TaskListReferenceRemovalService, feature_category: :team_planning do let_it_be(:developer) { create(:user) } let_it_be(:project) { create(:project, :repository).tap { |project| project.add_developer(developer) } } let_it_be(:task) { create(:work_item, project: project, title: 'Task title') } diff --git a/spec/services/work_items/task_list_reference_replacement_service_spec.rb b/spec/services/work_items/task_list_reference_replacement_service_spec.rb index 965c5f1d554..8f696109fa1 100644 --- a/spec/services/work_items/task_list_reference_replacement_service_spec.rb +++ b/spec/services/work_items/task_list_reference_replacement_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::TaskListReferenceReplacementService do +RSpec.describe WorkItems::TaskListReferenceReplacementService, feature_category: :team_planning do let_it_be(:developer) { create(:user) } let_it_be(:project) { create(:project, :repository).tap { |project| project.add_developer(developer) } } let_it_be(:single_line_work_item, refind: true) { create(:work_item, project: project, description: '- [ ] single line', lock_version: 3) } diff --git a/spec/services/work_items/update_service_spec.rb b/spec/services/work_items/update_service_spec.rb index 435995c6570..5647f8c085c 100644 --- a/spec/services/work_items/update_service_spec.rb +++ b/spec/services/work_items/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::UpdateService do +RSpec.describe WorkItems::UpdateService, feature_category: :team_planning do let_it_be(:developer) { create(:user) } let_it_be(:guest) { create(:user) } let_it_be(:project) { create(:project) } diff --git a/spec/services/work_items/widgets/assignees_service/update_service_spec.rb b/spec/services/work_items/widgets/assignees_service/update_service_spec.rb index 0ab2c85f078..67736592876 100644 --- a/spec/services/work_items/widgets/assignees_service/update_service_spec.rb +++ b/spec/services/work_items/widgets/assignees_service/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::Widgets::AssigneesService::UpdateService, :freeze_time do +RSpec.describe WorkItems::Widgets::AssigneesService::UpdateService, :freeze_time, feature_category: :portfolio_management do let_it_be(:reporter) { create(:user) } let_it_be(:project) { create(:project, :private) } let_it_be(:new_assignee) { create(:user) } diff --git a/spec/services/work_items/widgets/description_service/update_service_spec.rb b/spec/services/work_items/widgets/description_service/update_service_spec.rb index 4275950e720..20b5758dde9 100644 --- a/spec/services/work_items/widgets/description_service/update_service_spec.rb +++ b/spec/services/work_items/widgets/description_service/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::Widgets::DescriptionService::UpdateService do +RSpec.describe WorkItems::Widgets::DescriptionService::UpdateService, feature_category: :portfolio_management do let_it_be(:random_user) { create(:user) } let_it_be(:author) { create(:user) } let_it_be(:guest) { create(:user) } diff --git a/spec/services/work_items/widgets/milestone_service/create_service_spec.rb b/spec/services/work_items/widgets/milestone_service/create_service_spec.rb index 3f90784b703..64ab2421c74 100644 --- a/spec/services/work_items/widgets/milestone_service/create_service_spec.rb +++ b/spec/services/work_items/widgets/milestone_service/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::Widgets::MilestoneService::CreateService do +RSpec.describe WorkItems::Widgets::MilestoneService::CreateService, feature_category: :portfolio_management do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, :private, group: group) } let_it_be(:project_milestone) { create(:milestone, project: project) } diff --git a/spec/services/work_items/widgets/milestone_service/update_service_spec.rb b/spec/services/work_items/widgets/milestone_service/update_service_spec.rb index f3a7fc156b9..c5bc2b12fc5 100644 --- a/spec/services/work_items/widgets/milestone_service/update_service_spec.rb +++ b/spec/services/work_items/widgets/milestone_service/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::Widgets::MilestoneService::UpdateService do +RSpec.describe WorkItems::Widgets::MilestoneService::UpdateService, feature_category: :portfolio_management do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, :private, group: group) } let_it_be(:project_milestone) { create(:milestone, project: project) } diff --git a/spec/services/work_items/widgets/start_and_due_date_service/update_service_spec.rb b/spec/services/work_items/widgets/start_and_due_date_service/update_service_spec.rb index d328c541fc7..a46e9ac9f7a 100644 --- a/spec/services/work_items/widgets/start_and_due_date_service/update_service_spec.rb +++ b/spec/services/work_items/widgets/start_and_due_date_service/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItems::Widgets::StartAndDueDateService::UpdateService do +RSpec.describe WorkItems::Widgets::StartAndDueDateService::UpdateService, feature_category: :portfolio_management do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be_with_reload(:work_item) { create(:work_item, project: project) } diff --git a/spec/services/x509_certificate_revoke_service_spec.rb b/spec/services/x509_certificate_revoke_service_spec.rb index ff5d2dc058b..460381afd79 100644 --- a/spec/services/x509_certificate_revoke_service_spec.rb +++ b/spec/services/x509_certificate_revoke_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe X509CertificateRevokeService do +RSpec.describe X509CertificateRevokeService, feature_category: :system_access do describe '#execute' do let(:service) { described_class.new } let!(:x509_signature_1) { create(:x509_commit_signature, x509_certificate: x509_certificate, verification_status: :verified) } diff --git a/spec/support/shared_examples/observability/embed_observabilities_examples.rb b/spec/support/shared_examples/observability/embed_observabilities_examples.rb index 27a8bd614e3..c8d4e9e0d7e 100644 --- a/spec/support/shared_examples/observability/embed_observabilities_examples.rb +++ b/spec/support/shared_examples/observability/embed_observabilities_examples.rb @@ -3,7 +3,7 @@ RSpec.shared_examples 'embeds observability' do it 'renders iframe in description' do page.within('.description') do - expect(page.html).to include(expected) + expect_observability_iframe(page.html) end end @@ -18,7 +18,7 @@ RSpec.shared_examples 'embeds observability' do wait_for_requests page.within('.note-text') do - expect(page.html).to include(expected) + expect_observability_iframe(page.html) end end end @@ -26,8 +26,7 @@ end RSpec.shared_examples 'does not embed observability' do it 'does not render iframe in description' do page.within('.description') do - expect(page.html).not_to include(expected) - expect(page.html).to include(observable_url) + expect_observability_iframe(page.html, to_be_nil: true) end end @@ -42,8 +41,21 @@ RSpec.shared_examples 'does not embed observability' do wait_for_requests page.within('.note-text') do - expect(page.html).not_to include(expected) - expect(page.html).to include(observable_url) + expect_observability_iframe(page.html, to_be_nil: true) end end end + +def expect_observability_iframe(html, to_be_nil: false) + iframe = Nokogiri::HTML.parse(html).at_css('#observability-ui-iframe') + + expect(html).to include(observable_url) + + if to_be_nil + expect(iframe).to be_nil + else + expect(iframe).not_to be_nil + iframe_src = "#{expected_observable_url}&theme=light&username=#{user.username}&kiosk=inline-embed" + expect(iframe.attributes['src'].value).to eq(iframe_src) + end +end diff --git a/workhorse/go.mod b/workhorse/go.mod index aad0ec2592e..4f0d1cabbc9 100644 --- a/workhorse/go.mod +++ b/workhorse/go.mod @@ -26,7 +26,7 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/smartystreets/goconvey v1.7.2 github.com/stretchr/testify v1.8.2 - gitlab.com/gitlab-org/gitaly/v15 v15.9.2 + gitlab.com/gitlab-org/gitaly/v15 v15.9.3 gitlab.com/gitlab-org/golang-archive-zip v0.1.1 gitlab.com/gitlab-org/labkit v1.18.0 gocloud.dev v0.29.0 diff --git a/workhorse/go.sum b/workhorse/go.sum index 6581f5d5401..e7cd75f0745 100644 --- a/workhorse/go.sum +++ b/workhorse/go.sum @@ -1916,8 +1916,8 @@ github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/gitlab-org/gitaly/v15 v15.9.2 h1:qYVmONm8RBXXtmAHFVdaIvwzEBHgzJR6ePagkTNNyuA= -gitlab.com/gitlab-org/gitaly/v15 v15.9.2/go.mod h1:MLAmjPsXan0TixWBOnF2GUTjHcNLoAiYv1x1LRx7gHQ= +gitlab.com/gitlab-org/gitaly/v15 v15.9.3 h1:jloqZdc+TkpZHU2pr4grHKNAp+zg6NeB4vQZgRrOvCE= +gitlab.com/gitlab-org/gitaly/v15 v15.9.3/go.mod h1:MLAmjPsXan0TixWBOnF2GUTjHcNLoAiYv1x1LRx7gHQ= gitlab.com/gitlab-org/golang-archive-zip v0.1.1 h1:35k9giivbxwF03+8A05Cm8YoxoakU8FBCj5gysjCTCE= gitlab.com/gitlab-org/golang-archive-zip v0.1.1/go.mod h1:ZDtqpWPGPB9qBuZnZDrKQjIdJtkN7ZAoVwhT6H2o2kE= gitlab.com/gitlab-org/labkit v1.18.0 h1:uYCIqDt/5V1hLIecTR4UNc1sD2+xiYplyKeyfpNN26A= |